Skip to content
Snippets Groups Projects
Commit 1b96c67c authored by Daniel Lyons's avatar Daniel Lyons Committed by Sam Kagan
Browse files

Add rule to unit-test macro to keep JUnit-style XML reports for Gitlab CI integration

parent 77a55d83
No related branches found
No related tags found
2 merge requests!1706merge 2.8.4 to main,!1649Show unit test reports in Gitlab
......@@ -2,14 +2,20 @@
image: ${REGISTRY_URL}/workspaces/${SERVICE_NAME}:${IMAGE_TAG}
script:
- ls -la
- pip3 install --upgrade pip
- pip3 install -r test-requirements.txt
- cd ${PATH_PREFIX}${SERVICE_NAME}
# use the poetry virtual environment and packages
- poetry install --with test
- $(poetry env info -p)/bin/pytest --cov=${SERVICE_NAME} --cov-report=
- $(poetry env info -p)/bin/pytest --junitxml=tests.xml --cov=${SERVICE_NAME} --cov-report=
- mv ./.coverage ${CI_PROJECT_DIR}/.coverage.${SERVICE_NAME}.${CI_COMMIT_SHORT_SHA}
artifacts:
paths:
- .coverage.${SERVICE_NAME}.${CI_COMMIT_SHORT_SHA}
- tests.xml
reports:
junit:
- tests.xml
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /(^[0-9](\.[0-9])*)-DEVELOPMENT/'
variables:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment