Skip to content

Commit

Permalink
Remove support for browser proxy option (#872)
Browse files Browse the repository at this point in the history
A decision was made to remove proxy from browser option as, even though
the option is parsed and accepted, it has no implication on the rest of
the code as we are missing the actual implementation. Therefore the
option will not be parsed from now on until we complete the
implementation so it can have an effect on k6 browser execution.
  • Loading branch information
ka3de committed May 3, 2023
1 parent af0f9f0 commit 6fa11b9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
13 changes: 0 additions & 13 deletions common/browser_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,10 @@ const (
optHeadless = "headless"
optIgnoreDefaultArgs = "ignoreDefaultArgs"
optLogCategoryFilter = "logCategoryFilter"
optProxy = "proxy"
optSlowMo = "slowMo"
optTimeout = "timeout"
)

// ProxyOptions allows configuring a proxy server.
type ProxyOptions struct {
Server string
Bypass string
Username string
Password string
}

// LaunchOptions stores browser launch options.
type LaunchOptions struct {
Args []string
Expand All @@ -38,7 +29,6 @@ type LaunchOptions struct {
Headless bool
IgnoreDefaultArgs []string
LogCategoryFilter string
Proxy ProxyOptions
SlowMo time.Duration
Timeout time.Duration

Expand Down Expand Up @@ -112,8 +102,6 @@ func (l *LaunchOptions) Parse(ctx context.Context, logger *log.Logger, opts goja
err = exportOpt(rt, k, v, &l.IgnoreDefaultArgs)
case optLogCategoryFilter:
l.LogCategoryFilter, err = parseStrOpt(k, v)
case optProxy:
err = exportOpt(rt, k, v, &l.Proxy)
case optSlowMo:
l.SlowMo, err = parseTimeOpt(k, v)
case optTimeout:
Expand All @@ -137,7 +125,6 @@ func (l *LaunchOptions) shouldIgnoreIfBrowserIsRemote(opt string) bool {
optExecutablePath: {},
optHeadless: {},
optIgnoreDefaultArgs: {},
optProxy: {},
}
_, ignore := shouldIgnoreIfBrowserIsRemote[opt]

Expand Down
24 changes: 0 additions & 24 deletions common/browser_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func TestBrowserLaunchOptionsParse(t *testing.T) {
"executablePath": "something else",
"headless": false,
"ignoreDefaultArgs": []string{"any"},
"proxy": ProxyOptions{Server: "srv"},
// allow changing the following opts
"debug": true,
"logCategoryFilter": "...",
Expand Down Expand Up @@ -168,29 +167,6 @@ func TestBrowserLaunchOptionsParse(t *testing.T) {
opts: map[string]any{"logCategoryFilter": 1},
err: "logCategoryFilter should be a string",
},
"proxy": {
opts: map[string]any{
"proxy": ProxyOptions{
Server: "serverVal",
Bypass: "bypassVal",
Username: "usernameVal",
Password: "passwordVal",
},
},
assert: func(tb testing.TB, lo *LaunchOptions) {
tb.Helper()
assert.Equal(t, ProxyOptions{
Server: "serverVal",
Bypass: "bypassVal",
Username: "usernameVal",
Password: "passwordVal",
}, lo.Proxy)
},
},
"proxy_err": {
opts: map[string]any{"proxy": 1},
err: "proxy should be an object",
},
"slowMo": {
opts: map[string]any{
"slowMo": "5s",
Expand Down

0 comments on commit 6fa11b9

Please sign in to comment.