diff --git a/README.md b/README.md index 860d4d96e2c6156847759d4dbbb6200f77205403..8812335606b6e233653840575ee58fb080725607 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,10 @@ Requirements: * 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` +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). Gitlab may use test reports to provide some UI functionalities if you upload them as artifacts. @@ -31,18 +35,23 @@ tests: coverage: '/^TOTAL.+?(\d+\%)$/' ``` -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) +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. + +## 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. -## 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. diff --git a/codexample/functions.py b/codexample/functions.py index 55b6f0fc5f26f3073a28cb4cfd35d0dca1a65dac..3dd85ebeeeb43f13afb15205f456cd02750c9e9e 100644 --- a/codexample/functions.py +++ b/codexample/functions.py @@ -5,3 +5,9 @@ def return_value(value): def raise_error(msg_kw): raise ValueError(f"Exception {msg_kw} raised") + +def factorielle(n): + if n == 0: + return 1 + else: + return n * factorielle(n-1)