-
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
Directly embed lib.TestPreInitState
in js/common.InitEnvironment
#2999
Conversation
lib.TestPreInitState
in js/common.InitEnvironment
74faa3c
to
ed32098
Compare
lib.TestPreInitState
in js/common.InitEnvironment
lib.TestPreInitState
in js/common.InitEnvironment
Codecov Report
@@ Coverage Diff @@
## master #2999 +/- ##
==========================================
+ Coverage 76.99% 77.02% +0.02%
==========================================
Files 228 228
Lines 17050 17050
==========================================
+ Hits 13128 13132 +4
+ Misses 3079 3076 -3
+ Partials 843 842 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
An incompatibility was detected with k6 after grafana/k6#2999. This commit fixes this incompatibility, which mainly affected structures defined in k6 browser tests.
An incompatibility was detected with k6 after grafana/k6#2999. This commit updates k6 dependency to latest version and fixes the present incompatibility, which mainly affects structures defined in k6 browser tests.
An incompatibility was detected with k6 after grafana/k6#2999. This commit updates k6 dependency to latest version and fixes the present incompatibility, which mainly affects structures defined in k6 browser tests.
Instead of manually including most of its constituent parts, we can just embed the whole
*lib.TestPreInitState
in the struct. This will make any future changes much easier.I also tried to move
FileSystems
andCWD
inlib.TestPreInitState
, so we can get rid of them in bothcmd.loadedTest
andcommon.InitEnvironment
(at that point, we could basically replace it withlib.TestPreInitState
directly):k6/cmd/test_load.go
Lines 31 to 39 in c09919b
Unfortunately,
FileSystems
is complicated, since when we are running .js files, its elements contain the "cache-on-read" overlay filesystems on top of the real FS (and on HTTPs), while for .tar archives we substitute them with the filesystems in the archive:k6/js/bundle.go
Lines 134 to 137 in c09919b
So, I decided to leave this for a future PR. With some further refactoring of the js test loading, it should be possible to handle in a nicer way than it currently is. Potentially before #2975 🤔