Skip to content

Commit 861daa9

Browse files
committed
TEMP: just install gotestsum in ci.yml
1 parent 7490542 commit 861daa9

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ jobs:
3636
with:
3737
go-version: ${{ matrix.go-version }}
3838

39+
- name: Install gotestsum
40+
run: go install gotest.tools/gotestsum@latest
41+
3942
- name: Create junit-xml directory
4043
run: mkdir junit-xml
4144

internal/cmd/build/main.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,6 @@ func (b *builder) integrationTest() error {
122122
return fmt.Errorf("failed parsing flags: %w", err)
123123
}
124124

125-
gotestsum, err := b.getInstalledTool("gotest.tools/gotestsum")
126-
if err != nil {
127-
return fmt.Errorf("failed getting gotestsum: %w", err)
128-
}
129125
// Also accept coverage file as env var
130126
if env := strings.TrimSpace(os.Getenv("TEMPORAL_COVERAGE_FILE")); *coverageFileFlag == "" && env != "" {
131127
*coverageFileFlag = env
@@ -176,7 +172,7 @@ func (b *builder) integrationTest() error {
176172
}
177173

178174
// Run integration test
179-
args := []string{gotestsum, "-tags", "protolegacy", "-count", "1", "-race", "-v", "-timeout", "10m"}
175+
args := []string{"gotestsum", "-tags", "protolegacy", "-count", "1", "-race", "-v", "-timeout", "10m"}
180176
if *junitFileFlag != "" {
181177
args = append(args, "--junitfile", *junitFileFlag+"-integration-test.xml")
182178
}
@@ -247,14 +243,10 @@ func (b *builder) unitTest() error {
247243
return fmt.Errorf("failed parsing flags: %w", err)
248244
}
249245

250-
gotestsum, err := b.getInstalledTool("gotest.tools/gotestsum")
251-
if err != nil {
252-
return fmt.Errorf("failed getting gotestsum: %w", err)
253-
}
254246
// Find every non ./test-prefixed package that has a test file
255247
testDirMap := map[string]struct{}{}
256248
var testDirs []string
257-
err = fs.WalkDir(os.DirFS(b.rootDir), ".", func(p string, d fs.DirEntry, err error) error {
249+
err := fs.WalkDir(os.DirFS(b.rootDir), ".", func(p string, d fs.DirEntry, err error) error {
258250
if !strings.HasPrefix(p, "test") && strings.HasSuffix(p, "_test.go") {
259251
dir := path.Dir(p)
260252
if _, ok := testDirMap[dir]; !ok {
@@ -280,7 +272,7 @@ func (b *builder) unitTest() error {
280272
log.Printf("Running unit tests in dirs: %v", testDirs)
281273
for _, testDir := range testDirs {
282274
// Run unit test
283-
args := []string{gotestsum, "-tags", "protolegacy", "-count", "1", "-race", "-v", "-timeout", "15m"}
275+
args := []string{"gotestsum", "-tags", "protolegacy", "-count", "1", "-race", "-v", "-timeout", "15m"}
284276
if *junitFileFlag != "" {
285277
args = append(args, "--junitfile", *junitFileFlag+strings.ReplaceAll(testDir, "/", "-")+"unit-test.xml")
286278
}

0 commit comments

Comments
 (0)