Skip to content
Snippets Groups Projects
Commit 7cf7154a authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Use PyTest instead of xmlrunner to discover Python tests with Ubuntu CI.

parent 8d1450e1
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ build:ubuntu_python:
before_script:
- !reference [.retrieve_deps:apt, script]
- DEPENDENCY_JOB="build:ubuntu_python"
- !reference [.ubuntu:download:artifacts, before_script]
- !reference [.ubuntu:download:artifacts, before_script]
- python3 -m pip install virtualenv
script:
......@@ -44,7 +44,8 @@ test:ubuntu_python:
before_script:
- !reference [.retrieve_deps:apt, script]
- source venv/bin/activate
- python -m pip install unittest-xml-reporting pytest
# - python -m pip install unittest-xml-reporting pytest
- python -m pip install pytest
- which python
- python -m pip list
- >
......@@ -53,9 +54,10 @@ test:ubuntu_python:
fi
script:
- cd ${CI_PROJECT_NAME}
# Run on discovery all tests located in project/unit_tests/python and discard the stdout
# Run on discovery all tests located in project/unit_tests/python and discard the stdout
# only to show the errors/warnings and the results of the tests
- python -m xmlrunner discover -s unit_tests/ -v -b --output-file xmlrunner-results.xml
# - python -m xmlrunner discover -s unit_tests/ -v -b --output-file xmlrunner-results.xml
- pytest unit_tests/ -v --junitxml=xmlrunner-results.xml
artifacts:
reports:
......@@ -71,12 +73,12 @@ coverage:ubuntu_python:
tags:
- docker
before_script:
before_script:
- !reference [.retrieve_deps:apt, script]
- source venv/bin/activate
- which python
- python -m pip list
- python -m pip install numpy coverage requests unittest-xml-reporting
- python -m pip install numpy coverage requests unittest-xml-reporting
- >
if [[ "$CI_PROJECT_NAME" == "aidge_onnx" ]]; then
python -m pip install pytest onnxruntime>=1.18.0
......
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