From 727d683c48497f05999c992c877948d2c2b52a7d Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Tue, 29 Jul 2025 16:03:30 +0100 Subject: [PATCH] Add zip of picamera coverage and update CI to use it --- .gitignore | 3 +++ .gitlab-ci.yml | 20 ++++++++++++++++++-- hardware-specific-tests/README.md | 2 +- picamera_coverage.zip | Bin 0 -> 53913 bytes picamera_tests.py | 4 ++-- 5 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 picamera_coverage.zip diff --git a/.gitignore b/.gitignore index b94a21d8..acc08e3c 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,9 @@ nosetests.xml coverage.xml report.xml pytest_report.xml +.coverage.picamera +.coverage.main +picamera_test_hashes.json # Translations *.mo diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4bbb1e73..244f5025 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -130,15 +130,31 @@ pytest: - git config --global user.name "Sir Unit of Test" - git config --global user.email "fake@email.no" - pytest + - mv .coverage .coverage.main # --gitlab-code-quality-report=pytest-warnings.json # can restore when it installs ok - coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' artifacts: when: always paths: - report.xml + - .coverage.main + +# Combine CI coverage with coverage from Picamera +combined-tests: + stage: testing + extends: .python + needs: + - job: pytest + artifacts: true + script: + - ./picamera_tests.py unzip + - coverage combine + - coverage report + - coverage xml + coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' + artifacts: + when: always reports: junit: report.xml -# codequality: pytest-warnings.json coverage_report: coverage_format: cobertura path: coverage.xml diff --git a/hardware-specific-tests/README.md b/hardware-specific-tests/README.md index 62172610..d5bc7191 100644 --- a/hardware-specific-tests/README.md +++ b/hardware-specific-tests/README.md @@ -10,7 +10,7 @@ It is essential to stop the server first: However, this will not archive the tests in the Git repository for reporting the coverage. For this see the section below on reporting the coverage. -When writing and debugging these unit tests it is often best to run a specific test and to use the `-s` flag to see the print statments. It is also often useful to use `--pdb` to drop you into a python debug session on any failure. For example, you might run: +When writing and debugging these unit tests it is often best to run a specific test and to use the `-s` flag to see the print statements. It is also often useful to use `--pdb` to drop you into a python debug session on any failure. For example, you might run: /picamera2/test_exposure_time_drift.py::test_exposure_time_saves_and_loads -s --pdb diff --git a/picamera_coverage.zip b/picamera_coverage.zip new file mode 100644 index 0000000000000000000000000000000000000000..0eab078c6e4e15823d138a5c44391a34947971e7 GIT binary patch literal 53913 zcmWIWW@Zs#0D%Q{f1|9kqAM9LFff3y5Ca2)UUGg}YEfc(s$M~6a$;_3QDShQPi9G~ zLRx-NZeodoF@pdDBO`-@f&v2r11AFm124!VC}wA1U|@l=K@=m1Ab>d;^pY8Q`NJ4^ z*m@cG<9Pk~b$RCSs&QZB$>r?gp2wcZnatKpz>HDp(GVC7fzc2c4T0ev0*!$@?BbG= zj7_yAiAg!BB}IwJsYMWy*Ez`5F~n6N#L>yeRRJQVpuwe}prD|utKg_mlwYn;kXodW zmYI{PkeQc~nVeXXnU}6ml938iU0R%)0;=c~N-`2lzzX%i`axRaGgA~Y^GZ_FQ;QS| ziZXK(iz*eeQ!91A3ZS-?q*jzb1k&=0QZv)@Kq?e8pxQMRic-^3i&FEFQ;WfdD`;e< zXmV*b*K@Ip3kx&0r-J>ISd^Stl+2Cdo5Z4IgjYP%6pB)l^NUhIu1_jT%uCKlE!I&; zg!?c#KM&**h;NJXbM;H|6>>83z~0O&&Me8y&r?XPNKGy+Nln4(K^;(_!LY6_C`jPG zDaltz0C^|@q7!NtQs^KwW6=p!4%M7il%JcI4+~a=Mv&FIx)3+#mF6a;7Aa(v<`#e= zrzk%cVsS}6E}h``2KyIPZ%IBxC-HHEB`%>Jh|f$xiB706I7T75O7k)cOH&nKk*}iw zRT7_>qN4!uxQ+tI6PjF_s@!bimcon-nRzLx6~%=)nI)<5iKQj^V19gJQF6RtVo@?r ziy#NPxV$`Ldm%WXfV>!=lvz>?XKa#2o>LV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