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
1 merge request!6Fixed Python coverage
Pipeline #31172 passed
...@@ -24,8 +24,10 @@ coverage:ubuntu_python: ...@@ -24,8 +24,10 @@ coverage:ubuntu_python:
script: script:
- source venv/bin/activate - source venv/bin/activate
- python3 -m pip install numpy coverage - python3 -m pip install numpy coverage
- cd aidge_core - cd ${CI_PROJECT_NAME}
- python3 -m coverage run --source=. -m unittest discover -s unit_tests/ -v -b # 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 report
- python3 -m coverage xml - python3 -m coverage xml
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
...@@ -33,4 +35,4 @@ coverage:ubuntu_python: ...@@ -33,4 +35,4 @@ coverage:ubuntu_python:
reports: reports:
coverage_report: coverage_report:
coverage_format: cobertura coverage_format: cobertura
path: aidge_core/coverage.xml path: ${CI_PROJECT_NAME}/coverage.xml
...@@ -26,8 +26,8 @@ static_analysis:python: ...@@ -26,8 +26,8 @@ static_analysis:python:
script: script:
- pip install pylint - pip install pylint
- pip install pylint-gitlab - 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.GitlabCodeClimateReporter ${CI_PROJECT_NAME}/ > 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.GitlabPagesHtmlReporter ${CI_PROJECT_NAME}/ > pylint.html
- mkdir -p public/python/$CI_COMMIT_REF_NAME - mkdir -p public/python/$CI_COMMIT_REF_NAME
- mv pylint.html public/python/$CI_COMMIT_REF_NAME/ - mv pylint.html public/python/$CI_COMMIT_REF_NAME/
artifacts: artifacts:
......
...@@ -17,14 +17,14 @@ test:ubuntu_python: ...@@ -17,14 +17,14 @@ test:ubuntu_python:
- docker - docker
script: script:
- source venv/bin/activate - source venv/bin/activate
- cd aidge_core - cd ${CI_PROJECT_NAME}
- python3 -m pip install unittest-xml-reporting - python3 -m pip install unittest-xml-reporting
- python3 -m pip list - python3 -m pip list
# Run on discovery all tests located in core/unit_tests/python # 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 - python3 -m xmlrunner discover -s unit_tests/ -v -b --output-file xmlrunner-results.xml
artifacts: artifacts:
reports: reports:
junit: aidge_core/xmlrunner-results.xml junit: ${CI_PROJECT_NAME}/xmlrunner-results.xml
test:windows_cpp: test:windows_cpp:
stage: test 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