Skip to content

Commit

Permalink
try pull request with --rerun-fails-run-root-test
Browse files Browse the repository at this point in the history
  • Loading branch information
neiser committed Aug 30, 2022
1 parent 6bf7ea8 commit b02acc0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
)

func Test_sayHello(t *testing.T) {
someFlag := false
t.Run("empty name", func(t *testing.T) {
require.NoError(t, sayHello(""))
})
Expand All @@ -14,5 +15,9 @@ func Test_sayHello(t *testing.T) {
})
t.Run("Voldemort makes it fail every second time", func(t *testing.T) {
require.NoError(t, sayHello("Voldemort"))
someFlag = true
})
t.Run("check flag", func(t *testing.T) {
require.True(t, someFlag)
})
}
3 changes: 2 additions & 1 deletion run-test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
gotestsum --rerun-fails --packages=. -- -coverprofile=coverage.out -coverpkg="."
go install gotest.tools/gotestsum@rerun-root-cases
gotestsum --debug --rerun-fails --rerun-fails-run-root-test --packages=. -- -coverprofile=coverage.out -coverpkg="."
go tool cover -func coverage.out

0 comments on commit b02acc0

Please sign in to comment.