Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 0b64bdee authored by HUYNH Kim-Tam's avatar HUYNH Kim-Tam
Browse files

Add code for decreasing coverage

parent 4dd1da4b
No related branches found
No related tags found
No related merge requests found
Pipeline #697759 passed
...@@ -14,6 +14,10 @@ Requirements: ...@@ -14,6 +14,10 @@ Requirements:
* CI/CD is enabled: `Settings/General/Visibility, project features, permissions/Repository/'CI/CD'` * CI/CD is enabled: `Settings/General/Visibility, project features, permissions/Repository/'CI/CD'`
* Shared runners are enabled : `Settings/'CI/CD'/Runners/Shared runners/Enable shared runners for this project` * Shared runners are enabled : `Settings/'CI/CD'/Runners/Shared runners/Enable shared runners for this project`
Ref:
* [Gitlab docs: test reports](https://docs.gitlab.com/ee/ci/testing/unit_test_reports.html)
* [Gitlab docs: test coverage](https://docs.gitlab.com/ee/ci/testing/test_coverage_visualization.html)
The gitlab-ci configuration is written in the file [.gitlab-ci.yml](.gitlab-ci.yml). The gitlab-ci configuration is written in the file [.gitlab-ci.yml](.gitlab-ci.yml).
Gitlab may use test reports to provide some UI functionalities if you upload them as artifacts. Gitlab may use test reports to provide some UI functionalities if you upload them as artifacts.
...@@ -31,18 +35,23 @@ tests: ...@@ -31,18 +35,23 @@ tests:
coverage: '/^TOTAL.+?(\d+\%)$/' coverage: '/^TOTAL.+?(\d+\%)$/'
``` ```
Ref: You can download these artifacts on [Pipeline page](https://gitlab.inria.fr/gitlabci_gallery/testing/pytest-gitlab-reports/-/pipelines) with the download button on the right of a pipeline.
* [Gitlab docs: test reports](https://docs.gitlab.com/ee/ci/testing/unit_test_reports.html)
* [Gitlab docs: test coverage](https://docs.gitlab.com/ee/ci/testing/test_coverage_visualization.html) ## Visualization on Gitlab UI
## Test reports ### Test reports
On [latest pipeline page](https://gitlab.inria.fr/gitlabci_gallery/testing/pytest-gitlab-reports/-/pipelines/main/latest), the Tests tab displays a list of test suites and cases reported from the XML file. On [latest pipeline page](https://gitlab.inria.fr/gitlabci_gallery/testing/pytest-gitlab-reports/-/pipelines/main/latest), the Tests tab displays a list of test suites and cases reported from the XML file.
## Coverage ### Coverage
#### In Analytics
You can view a graph of coverage evolution on default branch in `Analytics` menu.
For example, on this project, it is visible at: https://gitlab.inria.fr/gitlabci_gallery/testing/pytest-gitlab-reports/-/graphs/main/charts.
### Adding coverage badge #### Adding coverage badge
To add a coverage badge to your project, go to `Settings/General/Badges` to add a badge. To add a coverage badge to your project, go to `Settings/General/Badges` to add a badge.
......
...@@ -5,3 +5,9 @@ def return_value(value): ...@@ -5,3 +5,9 @@ def return_value(value):
def raise_error(msg_kw): def raise_error(msg_kw):
raise ValueError(f"Exception {msg_kw} raised") raise ValueError(f"Exception {msg_kw} raised")
def factorielle(n):
if n == 0:
return 1
else:
return n * factorielle(n-1)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment