Skip to content

Commit 197bed2

Browse files
ci: report junit surefire test results to workflow output (#13)
* ci: report junit surefire test results to workflow output * ci: to test CI 'junit test report', adds one failing + one disabled unit test * ci: drops failing test, adds a note to the @disabled test
1 parent 75ec655 commit 197bed2

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

.github/workflows/callable.build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ jobs:
2222
cache-write-only: true
2323
- name: Run build (incl. test)
2424
run: ./gradlew build -x intTest --no-daemon
25+
26+
- name: Publish Test Report
27+
uses: mikepenz/action-junit-report@v4
28+
if: success() || failure() # always run even if the previous step fails
29+
with:
30+
report_paths: '**/build/test-results/test/TEST-*.xml'

.github/workflows/callable.integration-test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,9 @@ jobs:
2323

2424
- name: Run integration tests
2525
run: ./gradlew intTest -x test --no-daemon
26+
27+
- name: Publish Test Report
28+
uses: mikepenz/action-junit-report@v4
29+
if: success() || failure() # always run even if the previous step fails
30+
with:
31+
report_paths: '**/build/test-results/test/TEST-*.xml'

java-library-template/src/test/java/dev/thriving/oss/java/library/template/JavaLibraryTemplateTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dev.thriving.oss.java.library.template;
22

3+
import org.junit.jupiter.api.Disabled;
34
import org.junit.jupiter.api.Test;
45

56
import static org.junit.jupiter.api.Assertions.*;
@@ -17,4 +18,17 @@ void toFunkyCase() {
1718
// then
1819
assertEquals("hElLo wOrLd!!!", output);
1920
}
21+
22+
@Test
23+
@Disabled // was introduced to verify the 'junit test report' output in CI/CD pipeline results
24+
void toFunkyCaseDisabled() {
25+
// given
26+
String input = "hello world!!!";
27+
28+
// when
29+
String output = JavaLibraryTemplate.toFunkyCase(input);
30+
31+
// then
32+
assertEquals("hElLo wOrLd!!!", output);
33+
}
2034
}

0 commit comments

Comments
 (0)