Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdee24ac

Browse files
committed
Clean out env passed to wasmbrowsertest in TestWasm
1 parent418f92e commitdee24ac

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

‎conn_test.go‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,26 @@ func TestWasm(t *testing.T) {
364364
defercancel()
365365

366366
cmd:=exec.CommandContext(ctx,"go","test","-exec=wasmbrowsertest",".","-v")
367-
cmd.Env=append(os.Environ(),"GOOS=js","GOARCH=wasm",fmt.Sprintf("WS_ECHO_SERVER_URL=%v",s.URL))
367+
cmd.Env=append(cleanEnv(os.Environ()),"GOOS=js","GOARCH=wasm",fmt.Sprintf("WS_ECHO_SERVER_URL=%v",s.URL))
368368

369369
b,err:=cmd.CombinedOutput()
370370
iferr!=nil {
371371
t.Fatalf("wasm test binary failed: %v:\n%s",err,b)
372372
}
373373
}
374374

375+
funccleanEnv(env []string) (out []string) {
376+
for_,e:=rangeenv {
377+
// Filter out GITHUB envs and anything with token in it,
378+
// especially GITHUB_TOKEN in CI as it breaks TestWasm.
379+
ifstrings.HasPrefix(e,"GITHUB")||strings.Contains(e,"TOKEN") {
380+
continue
381+
}
382+
out=append(out,e)
383+
}
384+
returnout
385+
}
386+
375387
funcassertCloseStatus(exp websocket.StatusCode,errerror)error {
376388
ifwebsocket.CloseStatus(err)==-1 {
377389
returnfmt.Errorf("expected websocket.CloseError: %T %v",err,err)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp