Skip to content

Commit

Permalink
Merge pull request #1576 from mozilla/circle-ci-xml-test-reports
Browse files Browse the repository at this point in the history
Generate and store Circle-CI XML test reports
  • Loading branch information
groovecoder authored Feb 28, 2022
2 parents bf389d0 + 26557ad commit c6fbdd1
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,32 @@ jobs:

- run:
name: Test Code
command: docker run --entrypoint "/app/.local/bin/coverage" fx-private-relay run --source=. -m pytest --cov=./ --cov-fail-under=60
command: |
# Create a volume owned by the app user
docker run \
--volume /tmp/test-results \
--name test-results \
alpine \
/bin/sh -c \
"chmod 0777 /tmp/test-results && \
chown 10001:10001 /tmp/test-results"
# Run coverage tests, outputting the results in XML format
docker run \
--entrypoint "/bin/bash" \
--volumes-from test-results \
fx-private-relay \
-c \
'mkdir -p /tmp/test-results/pytest && \
mkdir -p /tmp/test-results/coverage && \
/app/.local/bin/coverage run --source=. --branch -m pytest \
--cov=./ --cov-fail-under=60 \
--junitxml=/tmp/test-results/pytest/results.xml && \
/app/.local/bin/coverage xml -o /tmp/test-results/coverage/results.xml'
# Copy results to local disk
docker cp test-results:/tmp/test-results /tmp
- store_test_results:
path: /tmp/test-results

deploy:
docker:
Expand Down

0 comments on commit c6fbdd1

Please sign in to comment.