Compare commits

...

2 Commits

Author SHA1 Message Date
Claire Wang
28e513f824 wip 2023-11-21 12:16:53 -05:00
Claire Wang
a56a7de9f2 wip 2023-11-21 12:10:22 -05:00
2 changed files with 23 additions and 5 deletions

View File

@@ -128,6 +128,13 @@ jobs:
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: /tmp/coverage.out
- name: upload test output
uses: actions/upload-artifact@v3
with:
name: ${{ github.job }}-${{ runner.os }}-${{ matrix.goarch }}-test-attempts.json
path: test_attempts.json
- name: remove upload test output
run: rm test_attempts.json
- name: bench all
run: ./tool/go test ${{matrix.buildflags}} -bench=. -benchtime=1x -run=^$ $(for x in $(git grep -l "^func Benchmark" | xargs dirname | sort | uniq); do echo "./$x"; done)
env:

View File

@@ -38,12 +38,12 @@ const (
)
type testAttempt struct {
pkg string // "tailscale.com/types/key"
testName string // "TestFoo"
outcome string // "pass", "fail", "skip"
pkg string // "tailscale.com/types/key" `json:",inline"`
testName string // "TestFoo" `json:",inline"`
outcome string // "pass", "fail", "skip" `json:",omitempty"`
logs bytes.Buffer
isMarkedFlaky bool // set if the test is marked as flaky
issueURL string // set if the test is marked as flaky
isMarkedFlaky bool // set if the test is marked as flaky `json:",omitempty"`
issueURL string // set if the test is marked as flaky `json:",omitempty"`
pkgFinished bool
}
@@ -201,6 +201,12 @@ func main() {
return
}
f, err := os.Create("test_attempts.json")
if err != nil {
log.Printf("error creating test attempt json file: %v", err)
}
defer f.Close()
ctx := context.Background()
type nextRun struct {
tests []*packageTests
@@ -320,6 +326,11 @@ func main() {
} else {
failed = true
}
testAttemptJson, _ := json.Marshal(tr)
_, err := f.Write(testAttemptJson)
if err != nil {
log.Printf("error appending to test attempt json file: %v", err)
}
}
if failed {
fmt.Println("\n\nNot retrying flaky tests because non-flaky tests failed.")