[Piuparts-devel] [Git][debian/piuparts][nose-to-pytest] Make gitlab-ci use pytest too

Nicolas Dandrimont (@olasd) gitlab at salsa.debian.org
Tue Sep 24 14:44:00 BST 2024



Nicolas Dandrimont pushed to branch nose-to-pytest at Debian / piuparts


Commits:
a78350cb by Nicolas Dandrimont at 2024-09-24T15:43:53+02:00
Make gitlab-ci use pytest too

- - - - -


2 changed files:

- .gitlab-ci/Dockerfile
- .gitlab-ci/test.yml


Changes:

=====================================
.gitlab-ci/Dockerfile
=====================================
@@ -9,6 +9,7 @@ RUN apt-get update --allow-releaseinfo-change -qq \
           pip \
           python3-coverage \
           python3-dev \
+          python3-pytest-cov \
           python3-requests \
           python3-yaml \
     && groupadd --system --gid 1001 unprivileged \


=====================================
.gitlab-ci/test.yml
=====================================
@@ -1,17 +1,9 @@
 ---
 
-nosetests:
+pythontests:
   stage: test
   script:
-    - exit_code=0
-    - echo -e "\e[0Ksection_start:`date +%s`:nose_tests[collapsed=true]\r\e[0KNose test results"
-    - python3 -m coverage run -m nose -v --with-xunit --xunit-file=gitlab-ci-xunit.xml || exit_code=$?
-    - echo -e "\e[0Ksection_end:`date +%s`:nose_tests\r\e[0K"
-    - echo -e "\e[0Ksection_start:`date +%s`:coverage_results\r\e[0KCoverage results"
-    - python3 -m coverage report
-    - python3 -m coverage xml -o gitlab-ci-coverage.xml
-    - echo -e "\e[0Ksection_end:`date +%s`:coverage_results\r\e[0K"
-    - exit $exit_code
+    - python3 -m pytest -v --cov --cov-report=xml:gitlab-ci-coverage.xml --cov-report=term --junitxml=gitlab-ci-xunit.xml
   coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
   artifacts:
     when: always



View it on GitLab: https://salsa.debian.org/debian/piuparts/-/commit/a78350cb98ef61a46eba62e73c06903dcece0860

-- 
View it on GitLab: https://salsa.debian.org/debian/piuparts/-/commit/a78350cb98ef61a46eba62e73c06903dcece0860
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/piuparts-devel/attachments/20240924/49c022e2/attachment-0001.htm>


More information about the Piuparts-devel mailing list