Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit e78da58

Browse files
committed
Revert env var that disables test runs
We have decided that after the merge k6 will take control of restricting test runs, allowing current browser test users to not be affected (for now).
1 parent 5121dca commit e78da58

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

browser/module.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@
22
package browser
33

44
import (
5-
"errors"
6-
"os"
7-
85
"github.com/dop251/goja"
96

107
"github.com/grafana/xk6-browser/common"
118
"github.com/grafana/xk6-browser/k6ext"
129

13-
k6common "go.k6.io/k6/js/common"
1410
k6modules "go.k6.io/k6/js/modules"
1511
)
1612

@@ -47,15 +43,6 @@ func New() *RootModule {
4743
// NewModuleInstance implements the k6modules.Module interface to return
4844
// a new instance for each VU.
4945
func (*RootModule) NewModuleInstance(vu k6modules.VU) k6modules.Instance {
50-
if _, ok := os.LookupEnv("K6_BROWSER_DISABLE_RUN"); ok {
51-
msg := "Disable run flag enabled, browser test run aborted. Please contact support."
52-
if m, ok := os.LookupEnv("K6_BROWSER_DISABLE_RUN_MSG"); ok {
53-
msg = m
54-
}
55-
56-
k6common.Throw(vu.Runtime(), errors.New(msg))
57-
}
58-
5946
// promises and inner objects need the VU object to be
6047
// able to use k6-core specific functionality.
6148
ctx := k6ext.WithVU(vu.Context(), vu)

browser/module_test.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"testing"
66

77
"github.com/dop251/goja"
8-
"github.com/stretchr/testify/assert"
98
"github.com/stretchr/testify/require"
109

1110
k6common "go.k6.io/k6/js/common"
@@ -33,15 +32,3 @@ func TestModuleNew(t *testing.T) {
3332
require.NotNil(t, m.mod.Devices, "Devices should be set")
3433
require.Equal(t, version, m.mod.Version, "Incorrect version")
3534
}
36-
37-
func TestModuleNewDisabled(t *testing.T) {
38-
t.Setenv("K6_BROWSER_DISABLE_RUN", "")
39-
40-
vu := &k6modulestest.VU{
41-
RuntimeField: goja.New(),
42-
InitEnvField: &k6common.InitEnvironment{
43-
Registry: k6metrics.NewRegistry(),
44-
},
45-
}
46-
assert.Panics(t, func() { New().NewModuleInstance(vu) })
47-
}

0 commit comments

Comments
 (0)