Skip to content

Commit

Permalink
Dump junit xml
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dandavison committed Nov 28, 2024
1 parent 592ae12 commit 283216c
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 8 deletions.
34 changes: 29 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ jobs:
working-directory: ./internal/cmd/build

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

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

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

- name: Upload junit-xml artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: junit-xml--${{github.run_id}}--${{github.run_attempt}}--${{matrix.os}}-${{matrix.go-version}}
path: .build/junit-xml # This path is also hardcoded in internal/cmd/build/main.go
retention-days: 14

- name: Docker compose - checkout
if: ${{ matrix.testDockerCompose }}
uses: actions/checkout@v4
Expand Down Expand Up @@ -120,13 +128,29 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest

- name: Create junit-xml directory
run: mkdir junit-xml-cloud

- name: Single integration test against cloud
run: 'go test -v --count 1 -p 1 . -run "TestIntegrationSuite/TestBasic$"'
run: 'gotestsum --junitfile ../junit-xml-cloud/${{matrix.go-version}}-integration.xml -- -v --count 1 -p 1 . -run "TestIntegrationSuite/TestBasic$"'
working-directory: test

- name: Cloud operations tests
run: 'go test -v --count 1 -p 1 . -run "TestCloudOperationsSuite/.*" -cloud-operations-tests'
run: 'gotestsum --junitfile ../junit-xml-cloud/${{matrix.go-version}}-cloud-operations.xml -- -v --count 1 -p 1 . -run "TestCloudOperationsSuite/.*" -cloud-operations-tests'
working-directory: test

- name: Upload junit-xml artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: junit-xml-cloud--${{github.run_id}}--${{github.run_attempt}}--${{matrix.go-version}}
path: junit-xml-cloud
retention-days: 14

features-test:
uses: temporalio/features/.github/workflows/go.yaml@main
with:
Expand Down
9 changes: 9 additions & 0 deletions internal/cmd/build/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@ require (
)

require (
github.com/bitfield/gotestdox v0.2.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dnephin/pflag v1.0.7 // indirect
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/nexus-rpc/sdk-go v0.0.10 // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand All @@ -30,6 +37,7 @@ require (
golang.org/x/net v0.28.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.21.1-0.20240531212143-b6235391adb3 // indirect
Expand All @@ -38,6 +46,7 @@ require (
google.golang.org/grpc v1.65.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/gotestsum v1.12.0 // indirect
)

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

0 comments on commit 283216c

Please sign in to comment.