Skip to content
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

Add JS scenario options #3036

Merged
merged 1 commit into from
Apr 28, 2023
Merged

Add JS scenario options #3036

merged 1 commit into from
Apr 28, 2023

Conversation

imiric
Copy link
Contributor

@imiric imiric commented Apr 26, 2023

This is a quick and possibly naive change to support browser options per scenario (#3022). These options will be parsed and validated by the browser module.

It doesn't try to enable generic options for any JS module as #3000 did, but it seems Ned abandoned this idea. We can open this discussion again once #883 is resolved.

I tested it with k6 archive, and it does serialize and deserialize from metadata.json properly. Should I add a test for this? An archive unit test would be a bit convoluted to add because of the ExecutorConfig interface, but maybe an integration test would be simpler.

@codecov-commenter
Copy link

codecov-commenter commented Apr 26, 2023

Codecov Report

Merging #3036 (537ef1c) into master (ec094ce) will decrease coverage by 0.02%.
The diff coverage is n/a.

❗ Current head 537ef1c differs from pull request most recent head 3069173. Consider uploading reports for the commit 3069173 to get more accurate results

@@            Coverage Diff             @@
##           master    #3036      +/-   ##
==========================================
- Coverage   77.04%   77.02%   -0.02%     
==========================================
  Files         229      229              
  Lines       17065    17065              
==========================================
- Hits        13147    13144       -3     
- Misses       3077     3079       +2     
- Partials      841      842       +1     
Flag Coverage Δ
ubuntu 77.02% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/executor/base_config.go 86.48% <ø> (ø)

... and 4 files with indirect coverage changes

mstoykov
mstoykov previously approved these changes Apr 28, 2023
Copy link
Contributor

@mstoykov mstoykov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! but I would prefer to hear that this will actually be sufficient for the @grafana/k6-browser team.

This is a quick and possibly naive change to support browser options per
scenario (#3022).

It doesn't try to enable generic options for any JS module as #3000 did,
but it seems Ned abandoned this idea. We can open this discussion again
once #883 is resolved.
Copy link
Contributor

@codebien codebien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, let's wait for the browser team's feedback.

Copy link
Member

@inancgumus inancgumus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Thanks for this 🙇

@imiric imiric merged commit 948587b into master Apr 28, 2023
@imiric imiric deleted the feat/3022-browser-options branch April 28, 2023 13:52
imiric pushed a commit that referenced this pull request May 5, 2023
Previously, the new scenario `options` field added in #3036 was being
serialized to JSON by default, which made it an incompatible change with
some of our internal Cloud services that validate the existing
configuration structure.

This change makes the object optional, and it will only be
(de)serialized if it's included in the data.
imiric pushed a commit that referenced this pull request May 5, 2023
Previously, the new scenario `options` field added in #3036 was being
serialized to JSON by default, which made it an incompatible change with
some of our internal Cloud services that validate the existing
configuration structure.

This change makes the object optional, and it will only be serialized if
it's included in the data.
imiric pushed a commit that referenced this pull request May 5, 2023
Previously, the new scenario `options` field added in #3036 was being
serialized to JSON by default, which made it an incompatible change with
some of our internal Cloud services that validate the existing
configuration structure.

This change makes the object optional, and it will only be serialized if
it's included in the data.
imiric pushed a commit that referenced this pull request May 5, 2023
Previously, the new scenario `options` field added in #3036 was being
serialized to JSON by default, which made it an incompatible change with
some of our internal Cloud services that validate the existing
configuration structure.

This change makes the object optional, and it will only be serialized if
it's included in the data.
imiric pushed a commit that referenced this pull request May 9, 2023
Previously, the new scenario `options` field added in #3036 was being
serialized to JSON by default, which made it an incompatible change with
some of our internal Cloud services that validate the existing
configuration structure.

This change makes the object optional, and it will only be serialized if
it's included in the data.
imiric pushed a commit that referenced this pull request May 9, 2023
Previously, the new scenario `options` field added in #3036 was being
serialized to JSON by default, which made it an incompatible change with
some of our internal Cloud services that validate the existing
configuration structure.

This change makes the object optional, and it will only be serialized if
it's included in the data.
@mstoykov mstoykov added this to the v0.45.0 milestone Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose a new browser specific option in scenarios
5 participants