Skip to content
Snippets Groups Projects
Commit 91f92aad authored by Olivier BICHLER's avatar Olivier BICHLER
Browse files

Fixed Python coverage

parent 49c815ad
No related branches found
No related tags found
No related merge requests found
......@@ -24,8 +24,10 @@ coverage:ubuntu_python:
script:
- source venv/bin/activate
- python3 -m pip install numpy coverage
- cd aidge_core
- python3 -m coverage run --source=. -m unittest discover -s unit_tests/ -v -b
- cd ${CI_PROJECT_NAME}
# Retrieve the installation path of the module, since it is installed with pip.
- export MODULE_LOCATION=`python -c "import ${CI_PROJECT_NAME} as _; print(_.__path__[0])"`
- python3 -m coverage run --source=$MODULE_LOCATION -m unittest discover -s unit_tests/ -v -b
- python3 -m coverage report
- python3 -m coverage xml
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
......@@ -33,4 +35,4 @@ coverage:ubuntu_python:
reports:
coverage_report:
coverage_format: cobertura
path: aidge_core/coverage.xml
path: ${CI_PROJECT_NAME}/coverage.xml
......@@ -26,8 +26,8 @@ static_analysis:python:
script:
- pip install pylint
- pip install pylint-gitlab
- pylint --rcfile=.pylintrc --exit-zero --output-format=pylint_gitlab.GitlabCodeClimateReporter aidge_core/ > codeclimate.json
- pylint --rcfile=.pylintrc --exit-zero --output-format=pylint_gitlab.GitlabPagesHtmlReporter aidge_core/ > pylint.html
- pylint --rcfile=.pylintrc --exit-zero --output-format=pylint_gitlab.GitlabCodeClimateReporter ${CI_PROJECT_NAME}/ > codeclimate.json
- pylint --rcfile=.pylintrc --exit-zero --output-format=pylint_gitlab.GitlabPagesHtmlReporter ${CI_PROJECT_NAME}/ > pylint.html
- mkdir -p public/python/$CI_COMMIT_REF_NAME
- mv pylint.html public/python/$CI_COMMIT_REF_NAME/
artifacts:
......
......@@ -17,14 +17,14 @@ test:ubuntu_python:
- docker
script:
- source venv/bin/activate
- cd aidge_core
- cd ${CI_PROJECT_NAME}
- python3 -m pip install unittest-xml-reporting
- python3 -m pip list
# Run on discovery all tests located in core/unit_tests/python
- python3 -m xmlrunner discover -s unit_tests/ -v -b --output-file xmlrunner-results.xml
artifacts:
reports:
junit: aidge_core/xmlrunner-results.xml
junit: ${CI_PROJECT_NAME}/xmlrunner-results.xml
test:windows_cpp:
stage: test
......
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