Skip to content

Commit

Permalink
(ci) Add JUnit-based test reporting for test-stdlib
Browse files Browse the repository at this point in the history
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
  • Loading branch information
perlun committed Nov 7, 2024
1 parent 4af1862 commit c7a4b9d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
20 changes: 11 additions & 9 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion release-notes/v0.6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down Expand Up @@ -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

0 comments on commit c7a4b9d

Please sign in to comment.