Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/run: fix testing package usage for changes to API in go1.23 #392

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions flow/testdata/tasks/api/req_001.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ tasks: {
mask: {
@task(st.Mask)
val: call.resp.body
mask: { headers: "x-amzn-trace-id": string }
mask: {
headers: {
"x-amzn-trace-id": string
"x-request-start": string
}
}
}
out: { text: json.Indent(json.Marshal(mask.out), "", " ") +"\n" } @task(os.Stdout)
}
Expand All @@ -46,9 +51,9 @@ tasks: {
"cow": "moo"
},
"headers": {
"host": "postman-echo.com",
"x-forwarded-proto": "https",
"x-forwarded-port": "443",
"host": "postman-echo.com",
"accept-encoding": "gzip",
"user-agent": "Go-http-client/2.0"
},
Expand Down
6 changes: 5 additions & 1 deletion script/runtime/exe_next.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.18
//go:build go1.23

package runtime

Expand Down Expand Up @@ -65,3 +65,7 @@ func runCoverSubcommand(cprof string, mainf func() int) (exitCode int) {
}()
return mainf()
}

func (nopTestDeps) InitRuntimeCoverage() (mode string, tearDown func(string, string) (string, error), snapcov func() float64) {
return
}
4 changes: 2 additions & 2 deletions script/runtime/exe_old.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !go1.18
//go:build !go1.23

package runtime

Expand Down Expand Up @@ -49,7 +49,7 @@ func runCoverSubcommand(cprof string, mainf func() int) (exitCode int) {
// Run MainStart (recursively, but it we should be ok) with no tests
// so that it writes the coverage profile.
// go1.18 -- m := testing.MainStart(nopTestDeps{}, nil, nil, nil, nil)
m := testing.MainStart(nopTestDeps{}, nil, nil, nil)
m := testing.MainStart(nopTestDeps{}, nil, nil, nil, nil)
if code := m.Run(); code != 0 && exitCode == 0 {
exitCode = code
}
Expand Down
Loading