From 527856bffd198190a3aea6169c28bc4c44079af7 Mon Sep 17 00:00:00 2001 From: Hartmut Date: Mon, 18 Sep 2023 15:01:21 +0200 Subject: [PATCH 1/3] ci: report junit surefire test results to workflow output --- .github/workflows/callable.build.yml | 6 ++++++ .github/workflows/callable.integration-test.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/callable.build.yml b/.github/workflows/callable.build.yml index 6229e9b..13b1314 100644 --- a/.github/workflows/callable.build.yml +++ b/.github/workflows/callable.build.yml @@ -22,3 +22,9 @@ jobs: cache-write-only: true - name: Run build (incl. test) run: ./gradlew build -x intTest --no-daemon + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v4 + if: success() || failure() # always run even if the previous step fails + with: + report_paths: '**/build/test-results/test/TEST-*.xml' diff --git a/.github/workflows/callable.integration-test.yml b/.github/workflows/callable.integration-test.yml index 5635554..4347ded 100644 --- a/.github/workflows/callable.integration-test.yml +++ b/.github/workflows/callable.integration-test.yml @@ -23,3 +23,9 @@ jobs: - name: Run integration tests run: ./gradlew intTest -x test --no-daemon + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v4 + if: success() || failure() # always run even if the previous step fails + with: + report_paths: '**/build/test-results/test/TEST-*.xml' From 96c194fc50e4476042735ca1812b87d7e39d45ef Mon Sep 17 00:00:00 2001 From: Hartmut Date: Mon, 18 Sep 2023 15:05:57 +0200 Subject: [PATCH 2/3] ci: to test CI 'junit test report', adds one failing + one disabled unit test --- .../template/JavaLibraryTemplateTest.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/java-library-template/src/test/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateTest.java b/java-library-template/src/test/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateTest.java index 4a51403..b3b9a0b 100644 --- a/java-library-template/src/test/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateTest.java +++ b/java-library-template/src/test/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateTest.java @@ -17,4 +17,29 @@ void toFunkyCase() { // then assertEquals("hElLo wOrLd!!!", output); } + + @Test + void toFunkyCaseBroken() { + // given + String input = "hello world!!!"; + + // when + String output = JavaLibraryTemplate.toFunkyCase(input); + + // then + assertEquals("hello world!!!", output); + } + + @Test + @org.junit.jupiter.api.Disabled + void toFunkyCaseDisabled() { + // given + String input = "hello world!!!"; + + // when + String output = JavaLibraryTemplate.toFunkyCase(input); + + // then + assertEquals("hElLo wOrLd!!!", output); + } } From 647c499929b2a81af3383da0db24c1b787f96dcb Mon Sep 17 00:00:00 2001 From: Hartmut Date: Mon, 18 Sep 2023 15:12:39 +0200 Subject: [PATCH 3/3] ci: drops failing test, adds a note to the @Disabled test --- .../library/template/JavaLibraryTemplateTest.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/java-library-template/src/test/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateTest.java b/java-library-template/src/test/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateTest.java index b3b9a0b..dcfa6e2 100644 --- a/java-library-template/src/test/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateTest.java +++ b/java-library-template/src/test/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateTest.java @@ -1,5 +1,6 @@ package dev.thriving.oss.java.library.template; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; @@ -19,19 +20,7 @@ void toFunkyCase() { } @Test - void toFunkyCaseBroken() { - // given - String input = "hello world!!!"; - - // when - String output = JavaLibraryTemplate.toFunkyCase(input); - - // then - assertEquals("hello world!!!", output); - } - - @Test - @org.junit.jupiter.api.Disabled + @Disabled // was introduced to verify the 'junit test report' output in CI/CD pipeline results void toFunkyCaseDisabled() { // given String input = "hello world!!!";