Skip to content

Commit 6354953

Browse files
committed
Persist coverage reports to host
1 parent d799120 commit 6354953

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/stage-2-test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
run: |
4545
cp .env.example .env
4646
make test-unit
47+
ls -lah
4748
- name: "Save the result of fast test suite"
4849
run: |
4950
docker cp lung_cancer_screening-web:/tmp/coverage.xml ./coverage.xml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ lung_cancer_screening/assets/compiled/*
2222
tests/TEST-*.xml
2323
node_modules
2424
.coverage
25+
coverage.xml

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ RUN pip install poetry
8787
RUN poetry install --no-root && rm -rf $POETRY_CACHE_DIR
8888
RUN poetry run playwright install --with-deps chromium
8989

90+
RUN chown -R ${USER}:${USER} ${APP_DIR}
91+
9092
USER ${USER}
9193
COPY --chown=${USER}:${USER} . .
9294

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ omit = [
4343
"*/tests/*",
4444
"manage.py"
4545
]
46-
data_file = "/tmp/.coverage"
46+
data_file = ".coverage"
4747

4848
[tool.coverage.xml]
49-
output = "/tmp/coverage.xml"
49+
output = "coverage.xml"

scripts/tests/unit.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ else
3333
TEST_MODULE=""
3434
fi
3535

36+
echo "Running as app user: $(id -u):$(id -g)"
3637
docker compose run --rm --remove-orphans web sh -c \
3738
"echo 'Running unit tests...' && \
39+
echo 'Running as app user: $(id -u):$(id -g)' && \
40+
ls -lah && && \
3841
poetry run coverage run manage.py test $TEST_MODULE $TAG \
3942
--settings=lung_cancer_screening.settings_test \
4043
--exclude-tag=accessibility && \
41-
echo 'Generating coverage report...' && \
42-
coverage xml && \
43-
coverage report -m --skip-covered"
44+
echo 'Generating coverage report...'"
4445

0 commit comments

Comments
 (0)