@@ -16,6 +16,12 @@ VERSION := release-${sha}
1616CODECOV_UPLOAD_TOKEN ?= "notset"
1717CODECOV_STATIC_TOKEN ?= "notset"
1818CODECOV_URL ?= "https://api.codecov.io"
19+
20+ # We allow this to be overridden so that we can run `pytest` from this directory
21+ # but have the junit file use paths relative to a parent directory. This will
22+ # help us move to a monorepo.
23+ PYTEST_ROOTDIR ?= "."
24+
1925export DOCKER_BUILDKIT =1
2026export WORKER_DOCKER_REPO =${AR_REPO}
2127export WORKER_DOCKER_VERSION =${VERSION}
@@ -44,13 +50,13 @@ build.portable:
4450 --build-arg RELEASE_VERSION=" ${release_version} "
4551
4652test :
47- COVERAGE_CORE=sysmon pytest --cov=./ --junitxml=junit.xml -o junit_family=legacy
53+ COVERAGE_CORE=sysmon pytest --cov=./ --junitxml=junit.xml -o junit_family=legacy -c pytest.ini --rootdir= ${PYTEST_ROOTDIR}
4854
4955test.unit :
50- COVERAGE_CORE=sysmon pytest --cov=./ -m " not integration" --cov-report=xml:unit.coverage.xml --junitxml=unit.junit.xml -o junit_family=legacy
56+ COVERAGE_CORE=sysmon pytest --cov=./ -m " not integration" --cov-report=xml:unit.coverage.xml --junitxml=unit.junit.xml -o junit_family=legacy -c pytest.ini --rootdir= ${PYTEST_ROOTDIR}
5157
5258test.integration :
53- COVERAGE_CORE=sysmon pytest --cov=./ -m " integration" --cov-report=xml:integration.coverage.xml --junitxml=integration.junit.xml -o junit_family=legacy
59+ COVERAGE_CORE=sysmon pytest --cov=./ -m " integration" --cov-report=xml:integration.coverage.xml --junitxml=integration.junit.xml -o junit_family=legacy -c pytest.ini --rootdir= ${PYTEST_ROOTDIR}
5460
5561lint :
5662 make lint.install
@@ -228,10 +234,10 @@ test_env.container_check_db:
228234 while ! nc -vz timescale 5432; do sleep 1; echo " waiting for timescale" ; done
229235
230236test_env.run_unit :
231- docker-compose exec worker make test.unit
237+ docker-compose exec worker make test.unit PYTEST_ROOTDIR= ${PYTEST_ROOTDIR}
232238
233239test_env.run_integration :
234- docker-compose exec worker make test.integration
240+ docker-compose exec worker make test.integration PYTEST_ROOTDIR= ${PYTEST_ROOTDIR}
235241
236242test_env :
237243 make test_env.up
0 commit comments