-
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
Adjust k6/execution
JS API and make it more predictable from JS perspective
#2574
Comments
FWIW, I quite liked this suggestion from @codebien, though with some minor modifications:
@olegbespalov mentioned that in the first init context we haven't processed all of the option values yet. So if the user specified WDYT? |
Hi As this is not being assigned to anyone, starting to work on this issue. |
Hmm @vanshaj, feel free to go ahead, just be prepared that it might not be a simple issue to implement. I didn't notice that it was tagged as a |
Hello @na-- cc: @codebien |
@vanshaj, you'd need to understand both k6 executors and goja in order to implement this task. If the As I said, it's complicated and definitely not a beginner-friendly issue. We also won't be able to help you very well, since implementing this will probably involve quite a lot of experimentation and trial-and-error even from us - we wont be able to just chime in and offer good suggestions when you are stuck, sorry... If you can't work this out on your own, I suggest you pick something else that's easier, for now. |
What?
Currently, if you're trying to use the
k6/execution
JS API and try to access some of the properties it's possible to get an error.From the JS idiomatic site, it's not expected and probably should result as the
undefined
, not an error since thescenario.name
is a property, not the method likescenario.getName()
Ideally, the behavior should be like this:
it should just print the execution properties that were available in each context, something like this:
However, the error here is a nice signal to a user that using
scenario.name
in the init context is not the right way. So it's a nice UX and ideally, we need to keep it.Think to consider:
--throw
approach, but keep in mind init contextget*()
methodsWhy?
Consistent and predictable APIs are useful for any user,
The text was updated successfully, but these errors were encountered: