Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate and store Circle-CI XML test reports #1576

Merged
merged 1 commit into from
Feb 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,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 \
groovecoder marked this conversation as resolved.
Show resolved Hide resolved
--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