From c7a4b9dd2197c81c4110b2cfc802b82d393a2e97 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Thu, 7 Nov 2024 19:10:01 +0000 Subject: [PATCH] (ci) Add JUnit-based test reporting for `test-stdlib` With this configuration in place, GitLab should be able to pick up the test results and display them in the web interface. https://gitlab.perlang.org/perlang/perlang/-/merge_requests/556 --- .gitlab-ci.yml | 20 +++++++++++--------- Makefile | 2 +- release-notes/v0.6.0.md | 4 +++- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1f6221d..8d20dd6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,22 +57,24 @@ test: - make perlang_cli_install_integration_test_release - > if [[ "$TEST_MODE" == 'valgrind' ]]; then - PERLANG_RUN_WITH_VALGRIND=true dotnet test --configuration Release --verbosity minimal --logger "junit;LogFilePath=perlang-junit-log.xml"; + PERLANG_RUN_WITH_VALGRIND=true dotnet test --configuration Release --verbosity minimal --logger "junit;LogFilePath=junit-log.xml"; else - dotnet test --configuration Release --verbosity minimal --logger "junit;LogFilePath=perlang-junit-log.xml"; - make test-stdlib; + dotnet test --configuration Release --verbosity minimal --logger "junit;LogFilePath=junit-log.xml"; + make test-stdlib EXTRA_CATCH_REPORTER="--reporter JUnit::out=native-stdlib-junit-log.xml"; fi artifacts: when: always paths: - - src/Perlang.Tests.Integration/perlang-junit-log.xml - - src/Perlang.Tests/perlang-junit-log.xml - - src/Perlang.Tests.Architecture/perlang-junit-log.xml + - native-stdlib-junit-log.xml + - src/Perlang.Tests.Integration/junit-log.xml + - src/Perlang.Tests/junit-log.xml + - src/Perlang.Tests.Architecture/junit-log.xml reports: junit: - - src/Perlang.Tests.Integration/perlang-junit-log.xml - - src/Perlang.Tests/perlang-junit-log.xml - - src/Perlang.Tests.Architecture/perlang-junit-log.xml + - native-stdlib-junit-log.xml + - src/Perlang.Tests.Integration/junit-log.xml + - src/Perlang.Tests/junit-log.xml + - src/Perlang.Tests.Architecture/junit-log.xml rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH diff --git a/Makefile b/Makefile index 58f7371..0d43420 100644 --- a/Makefile +++ b/Makefile @@ -156,7 +156,7 @@ test: test-stdlib: stdlib # We need --colour-mode since colour support is not auto-detected in CI. - src/stdlib/out/tests --colour-mode ansi + src/stdlib/out/tests --reporter console::out=-::colour-mode=ansi $(EXTRA_CATCH_REPORTER) # # Steps for publishing a new release: diff --git a/release-notes/v0.6.0.md b/release-notes/v0.6.0.md index f182c81..bb32c1f 100644 --- a/release-notes/v0.6.0.md +++ b/release-notes/v0.6.0.md @@ -62,7 +62,8 @@ - Run `test` job in build matrix, with and without Valgrind enabled [[!535][535]] - Add JUnit-based test reporting for GitLab CI [[!539][539]] - Enable full leak checking when running Valgrind [[!547][547]] -- Enable coloured mode for `test-stdlib` output [[!554][554] +- Enable coloured mode for `test-stdlib` output [[!554][554]] +- Add JUnit-based test reporting for `test-stdlib` [[!556][556]] ### Removed - Remove unused `Perlang.Compiler` project [[!511][511]] @@ -143,3 +144,4 @@ [553]: https://gitlab.perlang.org/perlang/perlang/merge_requests/553 [554]: https://gitlab.perlang.org/perlang/perlang/merge_requests/554 [555]: https://gitlab.perlang.org/perlang/perlang/merge_requests/555 +[556]: https://gitlab.perlang.org/perlang/perlang/merge_requests/556