-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove K6_BROWSER_ENABLED
flag requirement
#3221
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3221 +/- ##
==========================================
- Coverage 72.68% 72.67% -0.02%
==========================================
Files 259 258 -1
Lines 19864 19849 -15
==========================================
- Hits 14439 14425 -14
Misses 4521 4521
+ Partials 904 903 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this 👍
I think we can remove the whole of the experimental/browser/rootmodule.go
directory and file. We should be able to directly work with the root module that we define in the browser module -- replace "github.com/grafana/xk6-browser/browser"
in jsmodules.go.
We created the RootModule
wrapper in the experimental/browser
pkg in k6 to enable us to work with the env var.
Right, thanks for the heads up, I think that makes sense, as I see there are other examples of using the external implementation directly. Let me address this. |
Currently (as of grafana/xk6-browser@a8ebe8c) the browser extension requires the definition of the browser type parameter inside the options element for every scenario that wants to use the browser module. Therefore the K6_BROWSER_ENABLED flag has become redundant, as both parameters have to be set, being the scenario one more restrictive. Because we no longer have to parse the environment variable, the module wrapper implementation can be removed completely and use the xk6-browser root module constructor directly instead.
15cb14f
to
162b827
Compare
Shouldn't this be merged after we update xk6-browser in k6? |
Right, I was assuming we will upgrade the current xk6-browser version, which release is planned for this Friday, at some point before the next k6 release. But yes, in practice we can wait for this to happen before merging this PR. |
Closing as superseded by #3235. |
What?
Removes the requirement for the
K6_BROWSER_ENABLED
environment variable in order to execute tests that use the experimental browser module.Why?
Currently (as of grafana/xk6-browser@a8ebe8c) the browser extension requires the definition of the browser type parameter inside the options element for every scenario that wants to use the browser module. Therefore the usage of
K6_BROWSER_ENABLED
flag as an explicit approval to use the browser module has become redundant, as both parameters have to be set, being the scenario one more restrictive.Checklist
make ci-like-lint
) and all checks pass.make tests
) and all tests pass.Related PR(s)/Issue(s)
Closes #3197