2024-12-06 10:20:58 -03:00
|
|
|
SHELL := bash
|
|
|
|
|
|
|
|
|
|
.SHELLFLAGS := -eu -o pipefail -c
|
|
|
|
|
|
2024-12-06 18:48:43 -03:00
|
|
|
.PHONY: unit \
|
|
|
|
|
harness-start \
|
|
|
|
|
harness-stop \
|
|
|
|
|
integration \
|
|
|
|
|
tests \
|
|
|
|
|
integration-docker \
|
2025-01-19 10:32:27 -03:00
|
|
|
image-test \
|
2025-01-20 15:38:59 -03:00
|
|
|
image-minikube \
|
2024-12-06 10:20:58 -03:00
|
|
|
clean
|
|
|
|
|
|
|
|
|
|
# Runs the unit tests locally.
|
|
|
|
|
unit:
|
2025-01-30 18:34:32 -03:00
|
|
|
poetry run pytest -m "not deluge_integration and not codex_integration"
|
2024-12-06 10:20:58 -03:00
|
|
|
|
2025-01-30 18:34:32 -03:00
|
|
|
deluge-harness-start:
|
|
|
|
|
docker compose -f docker-compose-deluge.local.yaml up
|
2024-12-06 10:20:58 -03:00
|
|
|
|
2025-01-30 18:34:32 -03:00
|
|
|
codex-harness-start:
|
|
|
|
|
docker compose -f docker-compose-codex.local.yaml up
|
|
|
|
|
|
|
|
|
|
deluge-harness-stop:
|
|
|
|
|
docker compose -f docker-compose-deluge.local.yaml down --volumes --remove-orphans
|
|
|
|
|
|
|
|
|
|
codex-harness-stop:
|
|
|
|
|
docker compose -f docker-compose-codex.local.yaml down --volumes --remove-orphans
|
2024-12-06 10:20:58 -03:00
|
|
|
|
|
|
|
|
# Runs the integration tests locally. This requires the integration harness to be running.
|
2025-01-30 18:34:32 -03:00
|
|
|
deluge-integration:
|
|
|
|
|
echo "NOTE: Make sure to have started the Deluge integration harness or this will not work"
|
|
|
|
|
poetry run pytest -m "deluge_integration"
|
2024-12-06 10:20:58 -03:00
|
|
|
|
2025-01-30 18:34:32 -03:00
|
|
|
codex-integration:
|
|
|
|
|
echo "NOTE: Make sure to have started the Codex integration harness or this will not work"
|
|
|
|
|
poetry run pytest -m "codex_integration"
|
2024-12-06 10:20:58 -03:00
|
|
|
|
2025-01-17 08:39:06 -03:00
|
|
|
image-test:
|
2024-12-06 10:20:58 -03:00
|
|
|
docker build -t bittorrent-benchmarks:test -f ./docker/bittorrent-benchmarks.Dockerfile .
|
|
|
|
|
|
2025-02-14 11:00:17 -03:00
|
|
|
export CODEX_REPO_PATH
|
|
|
|
|
|
|
|
|
|
codex-image-minikube:
|
|
|
|
|
@if [ -z "$(CODEX_REPO_PATH)" ]; then \
|
|
|
|
|
echo "Error: CODEX_REPO_PATH environment variable is not set"; \
|
|
|
|
|
exit 1; \
|
|
|
|
|
fi
|
|
|
|
|
eval $$(minikube docker-env) && \
|
|
|
|
|
cd ${CODEX_REPO_PATH} && \
|
|
|
|
|
docker build -t nim-codex:minikube -f ./docker/codex.Dockerfile .
|
|
|
|
|
|
|
|
|
|
harness-image-minikube:
|
2025-01-20 15:21:29 -03:00
|
|
|
eval $$(minikube docker-env) && \
|
2025-01-20 11:39:43 -03:00
|
|
|
docker build -t bittorrent-benchmarks:minikube \
|
|
|
|
|
--build-arg BUILD_TYPE="release" \
|
2025-01-20 17:57:21 -03:00
|
|
|
-f ./docker/bittorrent-benchmarks.Dockerfile . && \
|
|
|
|
|
docker build -t bittorrent-benchmarks-workflows:minikube \
|
|
|
|
|
-f ./docker/bittorrent-benchmarks-workflows.Dockerfile .
|
2024-12-06 10:20:58 -03:00
|
|
|
|
|
|
|
|
# Runs the integration tests in a docker container.
|
2025-01-30 18:34:32 -03:00
|
|
|
deluge-integration-docker: image-test
|
|
|
|
|
docker compose -f docker-compose-deluge.local.yaml -f docker-compose-deluge.ci.yaml down --volumes --remove-orphans
|
|
|
|
|
docker compose -f docker-compose-deluge.local.yaml -f docker-compose-deluge.ci.yaml up \
|
2024-12-06 10:20:58 -03:00
|
|
|
--abort-on-container-exit --exit-code-from test-runner
|
|
|
|
|
|
2025-01-30 18:34:32 -03:00
|
|
|
codex-integration-docker: image-test
|
|
|
|
|
docker compose -f docker-compose-codex.local.yaml -f docker-compose-codex.ci.yaml down --volumes --remove-orphans
|
|
|
|
|
docker compose -f docker-compose-codex.local.yaml -f docker-compose-codex.ci.yaml up \
|
|
|
|
|
--abort-on-container-exit --exit-code-from test-runner
|
2024-12-06 10:20:58 -03:00
|
|
|
clean:
|
|
|
|
|
docker compose -f docker-compose.local.yaml -f docker-compose.ci.yaml down --volumes --rmi all --remove-orphans
|