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
open
websocket
Commits
75bf9077
Unverified
Commit
75bf9077
authored
1 year ago
by
Anmol Sethi
Browse files
Options
Downloads
Patches
Plain Diff
autobahn_test.go: Pull image before starting container
parent
e1e65adc
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
autobahn_test.go
+11
-1
11 additions, 1 deletion
autobahn_test.go
with
11 additions
and
1 deletion
autobahn_test.go
+
11
−
1
View file @
75bf9077
...
...
@@ -112,6 +112,8 @@ func waitWS(ctx context.Context, url string) error {
// TODO: Let docker pick the port and use docker port to find it.
// Does mean we can't use -i but that's fine.
func
wstestServer
(
ctx
context
.
Context
)
(
url
string
,
closeFn
func
()
error
,
err
error
)
{
defer
errd
.
Wrap
(
&
err
,
"failed to start autobahn wstest server"
)
serverAddr
,
err
:=
unusedListenAddr
()
if
err
!=
nil
{
return
""
,
nil
,
err
...
...
@@ -141,6 +143,15 @@ func wstestServer(ctx context.Context) (url string, closeFn func() error, err er
}
}()
dockerPull
:=
exec
.
CommandContext
(
ctx
,
"docker"
,
"pull"
,
"crossbario/autobahn-testsuite"
)
// TODO: log to *testing.T
dockerPull
.
Stdout
=
os
.
Stdout
dockerPull
.
Stderr
=
os
.
Stderr
err
=
dockerPull
.
Run
()
if
err
!=
nil
{
return
""
,
nil
,
fmt
.
Errorf
(
"failed to pull docker image: %w"
,
err
)
}
wd
,
err
:=
os
.
Getwd
()
if
err
!=
nil
{
return
""
,
nil
,
err
...
...
@@ -159,7 +170,6 @@ func wstestServer(ctx context.Context) (url string, closeFn func() error, err er
"--webport=0"
,
)
fmt
.
Println
(
strings
.
Join
(
args
,
" "
))
// TODO: pull image in advance
wstest
:=
exec
.
CommandContext
(
ctx
,
"docker"
,
args
...
)
// TODO: log to *testing.T
wstest
.
Stdout
=
os
.
Stdout
...
...
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