Skip to content

Commit 283216c

Browse files
committed
Dump junit xml
TEMP: just install gotestsum in ci.yml Invoke gotestsum correctly go get gotest.tools/gotestsum Install gotestsum locally Pass file stem from ci.yml; allow build script to control output dir Dump junit XML for cloud test also Delete unnecessary quotes Add comment on duplicated hardcoded path
1 parent 592ae12 commit 283216c

File tree

4 files changed

+166
-8
lines changed

4 files changed

+166
-8
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@ jobs:
4141
working-directory: ./internal/cmd/build
4242

4343
- name: Unit test
44-
run: go run . unit-test -coverage=${{ matrix.uploadCoverage && 'true' || 'false' }}
44+
run: go run . unit-test -coverage=${{ matrix.uploadCoverage && 'true' || 'false' }} -junit-file-stem ${{matrix.os}}-${{matrix.go-version}}
4545
working-directory: ./internal/cmd/build
4646

4747
- name: Integration tests (without cache)
48-
run: go run . integration-test -dev-server
48+
run: go run . integration-test -dev-server -junit-file-stem ${{matrix.os}}-${{matrix.go-version}}-nocache
4949
working-directory: ./internal/cmd/build
5050
env:
5151
WORKFLOW_CACHE_SIZE: "0"
5252
TEMPORAL_COVERAGE_FILE: ${{ matrix.uploadCoverage && 'integ_test_zero_cache_cover.out' || '' }}
5353

5454
- name: Integration tests (with cache)
55-
run: go run . integration-test -dev-server
55+
run: go run . integration-test -dev-server -junit-file-stem ${{matrix.os}}-${{matrix.go-version}}-cache
5656
working-directory: ./internal/cmd/build
5757
env:
5858
TEMPORAL_COVERAGE_FILE: ${{ matrix.uploadCoverage && 'integ_test_normal_cache_cover.out' || '' }}
@@ -70,6 +70,14 @@ jobs:
7070
file: coverage.out
7171
format: golang
7272

73+
- name: Upload junit-xml artifacts
74+
uses: actions/upload-artifact@v4
75+
if: always()
76+
with:
77+
name: junit-xml--${{github.run_id}}--${{github.run_attempt}}--${{matrix.os}}-${{matrix.go-version}}
78+
path: .build/junit-xml # This path is also hardcoded in internal/cmd/build/main.go
79+
retention-days: 14
80+
7381
- name: Docker compose - checkout
7482
if: ${{ matrix.testDockerCompose }}
7583
uses: actions/checkout@v4
@@ -120,13 +128,29 @@ jobs:
120128
- uses: actions/setup-go@v5
121129
with:
122130
go-version: ${{ matrix.go-version }}
131+
132+
- name: Install gotestsum
133+
run: go install gotest.tools/gotestsum@latest
134+
135+
- name: Create junit-xml directory
136+
run: mkdir junit-xml-cloud
137+
123138
- name: Single integration test against cloud
124-
run: 'go test -v --count 1 -p 1 . -run "TestIntegrationSuite/TestBasic$"'
139+
run: 'gotestsum --junitfile ../junit-xml-cloud/${{matrix.go-version}}-integration.xml -- -v --count 1 -p 1 . -run "TestIntegrationSuite/TestBasic$"'
125140
working-directory: test
141+
126142
- name: Cloud operations tests
127-
run: 'go test -v --count 1 -p 1 . -run "TestCloudOperationsSuite/.*" -cloud-operations-tests'
143+
run: 'gotestsum --junitfile ../junit-xml-cloud/${{matrix.go-version}}-cloud-operations.xml -- -v --count 1 -p 1 . -run "TestCloudOperationsSuite/.*" -cloud-operations-tests'
128144
working-directory: test
129145

146+
- name: Upload junit-xml artifacts
147+
uses: actions/upload-artifact@v4
148+
if: always()
149+
with:
150+
name: junit-xml-cloud--${{github.run_id}}--${{github.run_attempt}}--${{matrix.go-version}}
151+
path: junit-xml-cloud
152+
retention-days: 14
153+
130154
features-test:
131155
uses: temporalio/features/.github/workflows/go.yaml@main
132156
with:

internal/cmd/build/go.mod

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,20 @@ require (
1010
)
1111

1212
require (
13+
github.com/bitfield/gotestdox v0.2.2 // indirect
1314
github.com/davecgh/go-spew v1.1.1 // indirect
15+
github.com/dnephin/pflag v1.0.7 // indirect
1416
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
17+
github.com/fatih/color v1.16.0 // indirect
18+
github.com/fsnotify/fsnotify v1.7.0 // indirect
1519
github.com/gogo/protobuf v1.3.2 // indirect
1620
github.com/golang/mock v1.6.0 // indirect
21+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
1722
github.com/google/uuid v1.6.0 // indirect
1823
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
1924
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
25+
github.com/mattn/go-colorable v0.1.13 // indirect
26+
github.com/mattn/go-isatty v0.0.20 // indirect
2027
github.com/nexus-rpc/sdk-go v0.0.10 // indirect
2128
github.com/pborman/uuid v1.2.1 // indirect
2229
github.com/pmezard/go-difflib v1.0.0 // indirect
@@ -30,6 +37,7 @@ require (
3037
golang.org/x/net v0.28.0 // indirect
3138
golang.org/x/sync v0.8.0 // indirect
3239
golang.org/x/sys v0.24.0 // indirect
40+
golang.org/x/term v0.23.0 // indirect
3341
golang.org/x/text v0.17.0 // indirect
3442
golang.org/x/time v0.5.0 // indirect
3543
golang.org/x/tools v0.21.1-0.20240531212143-b6235391adb3 // indirect
@@ -38,6 +46,7 @@ require (
3846
google.golang.org/grpc v1.65.0 // indirect
3947
google.golang.org/protobuf v1.34.2 // indirect
4048
gopkg.in/yaml.v3 v3.0.1 // indirect
49+
gotest.tools/gotestsum v1.12.0 // indirect
4150
)
4251

4352
replace go.temporal.io/sdk => ../../../

0 commit comments

Comments
 (0)