Skip to content

Commit 9246967

Browse files
authored
fix: unit test reporting (#162)
1 parent 96b5d06 commit 9246967

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

.github/workflows/pr_flow.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
pull_request:
55
branches: [ master ]
66

7+
env:
8+
TEST_REPORT_JUNIT_XML_OUTPUT_DIR: target/surefire-reports
9+
710
jobs:
811
build:
912
runs-on: ubuntu-latest
@@ -23,9 +26,11 @@ jobs:
2326
- name: Run Java Tests
2427
run: lein pom && mvn test --batch-mode --fail-at-end
2528
- name: Unit tests in Clojure
26-
run: lein junit
27-
- name: Publish Test Report
28-
if: ${{ always() }}
29-
uses: scacap/action-surefire-report@v1
29+
run: lein test
30+
- name: Test Report
31+
uses: dorny/test-reporter@v1
32+
if: success() || failure()
3033
with:
31-
report_paths: 'target/surefire-reports/*.xml'
34+
name: Unit Tests
35+
path: target/surefire-reports/*.xml
36+
reporter: java-junit

.github/workflows/pr_visual_flow.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
env:
88
STENCIL_TEST_VISUAL: true
9+
TEST_REPORT_JUNIT_XML_OUTPUT_DIR: target/visual-reports
910

1011
jobs:
1112
build:
@@ -29,6 +30,10 @@ jobs:
2930
name: test-visual-images
3031
path: |
3132
/home/runner/work/_temp/**/*.png
32-
- name: Publish Test Report
33-
if: ${{ always() }}
34-
uses: scacap/action-surefire-report@v1
33+
- name: Test Report
34+
uses: dorny/test-reporter@v1
35+
if: success() || failure()
36+
with:
37+
name: Visual Tests
38+
path: target/visual-reports/*.xml
39+
reporter: java-junit

project.clj

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
:pom-addition ([:properties ["maven.compiler.source" "8"] ["maven.compiler.target" "8"]])
1313
:pom-plugins [[org.apache.maven.plugins/maven-surefire-plugin "2.20"]]
1414
:main io.github.erdos.stencil.Main
15-
:aliases {"junit" ["with-profile" "+test" "test-out" "junit" "target/surefire-reports/clojure.xml"]
16-
"coverage" ["with-profile" "+ci" "cloverage" "--codecov"
15+
:aliases {"coverage" ["with-profile" "+ci" "cloverage" "--codecov"
1716
"--exclude-call" "clojure.core/assert"
1817
"--exclude-call" "stencil.util/trace"
1918
"--exclude-call" "stencil.util/fail"
@@ -38,7 +37,7 @@
3837
:dependencies [[junit/junit "4.13.2"]
3938
[org.xmlunit/xmlunit-core "2.5.1"]
4039
[hiccup "1.0.5"]]
41-
:plugins [[lein-test-out "0.3.1"]]
40+
:plugins [[lein-test-report-junit-xml "0.2.0"]]
4241
:resource-paths ["test-resources"]
4342
:test-paths ["java-test"]
4443
:injections [(require 'stencil.spec)

0 commit comments

Comments
 (0)