Skip to content

Commit c237b99

Browse files
nadiamoemem
authored andcommitted
chore: k6runner/env: set K6_AUTO_EXTENSION_RESOLUTION=false by default
1 parent b1b8307 commit c237b99

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

internal/k6runner/env.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ func k6Env(localEnv []string) []string {
1313
// envDefaults maps environment variables to their value. They will be set only if the environment variable is not
1414
// already present on localEnv.
1515
envDefaults := map[string]string{
16-
"K6_BROWSER_LOG": "info",
16+
"K6_BROWSER_LOG": "info",
17+
"K6_AUTO_EXTENSION_RESOLUTION": "false",
1718
}
1819

1920
for env, val := range envDefaults {

internal/k6runner/env_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
func TestEnv(t *testing.T) {
99
t.Parallel()
1010

11-
t.Run("adds k6 browser log default", func(t *testing.T) {
11+
t.Run("adds default variables", func(t *testing.T) {
1212
t.Parallel()
1313

1414
osenv := []string{"SOMETHING=else", "FOO=bar"}
@@ -17,18 +17,25 @@ func TestEnv(t *testing.T) {
1717
if !slices.Contains(modified, "K6_BROWSER_LOG=info") {
1818
t.Fatalf("Expected env to contain browser log info")
1919
}
20+
if !slices.Contains(modified, "K6_AUTO_EXTENSION_RESOLUTION=false") {
21+
t.Fatalf("Expected env to contain K6_AUTO_EXTENSION_RESOLUTION")
22+
}
2023
})
2124

2225
t.Run("does not modify existing value", func(t *testing.T) {
2326
t.Parallel()
2427

25-
osenv := []string{"SOMETHING=else", "FOO=bar", "K6_BROWSER_LOG=debug"}
28+
osenv := []string{"SOMETHING=else", "FOO=bar", "K6_BROWSER_LOG=debug", "K6_AUTO_EXTENSION_RESOLUTION=true"}
2629
modified := k6Env(osenv)
2730

2831
if !slices.Contains(modified, "K6_BROWSER_LOG=debug") {
2932
t.Fatalf("Expected env to contain original variable")
3033
}
3134

35+
if !slices.Contains(modified, "K6_AUTO_EXTENSION_RESOLUTION=true") {
36+
t.Fatalf("Expected env to contain original variable")
37+
}
38+
3239
if slices.Contains(modified, "K6_BROWSER_LOG=info") {
3340
t.Fatalf("Expected env to _not_ contain browser log info")
3441
}

0 commit comments

Comments
 (0)