good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
websocket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
github
nhooyr
websocket
Commits
dee24acb
Commit
dee24acb
authored
7 months ago
by
Mathias Fredriksson
Browse files
Options
Downloads
Patches
Plain Diff
Clean out env passed to wasmbrowsertest in TestWasm
parent
418f92ed
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
conn_test.go
+13
-1
13 additions, 1 deletion
conn_test.go
with
13 additions
and
1 deletion
conn_test.go
+
13
−
1
View file @
dee24acb
...
...
@@ -364,7 +364,7 @@ func TestWasm(t *testing.T) {
defer
cancel
()
cmd
:=
exec
.
CommandContext
(
ctx
,
"go"
,
"test"
,
"-exec=wasmbrowsertest"
,
"."
,
"-v"
)
cmd
.
Env
=
append
(
os
.
Environ
(),
"GOOS=js"
,
"GOARCH=wasm"
,
fmt
.
Sprintf
(
"WS_ECHO_SERVER_URL=%v"
,
s
.
URL
))
cmd
.
Env
=
append
(
cleanEnv
(
os
.
Environ
()
)
,
"GOOS=js"
,
"GOARCH=wasm"
,
fmt
.
Sprintf
(
"WS_ECHO_SERVER_URL=%v"
,
s
.
URL
))
b
,
err
:=
cmd
.
CombinedOutput
()
if
err
!=
nil
{
...
...
@@ -372,6 +372,18 @@ func TestWasm(t *testing.T) {
}
}
func
cleanEnv
(
env
[]
string
)
(
out
[]
string
)
{
for
_
,
e
:=
range
env
{
// Filter out GITHUB envs and anything with token in it,
// especially GITHUB_TOKEN in CI as it breaks TestWasm.
if
strings
.
HasPrefix
(
e
,
"GITHUB"
)
||
strings
.
Contains
(
e
,
"TOKEN"
)
{
continue
}
out
=
append
(
out
,
e
)
}
return
out
}
func
assertCloseStatus
(
exp
websocket
.
StatusCode
,
err
error
)
error
{
if
websocket
.
CloseStatus
(
err
)
==
-
1
{
return
fmt
.
Errorf
(
"expected websocket.CloseError: %T %v"
,
err
,
err
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment