-
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
Adding no cookies reset option #729
Conversation
Codecov Report
@@ Coverage Diff @@
## master #729 +/- ##
==========================================
- Coverage 64.38% 64.36% -0.02%
==========================================
Files 101 101
Lines 8333 8341 +8
==========================================
+ Hits 5365 5369 +4
- Misses 2618 2620 +2
- Partials 350 352 +2
Continue to review full report at Codecov.
|
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.
Besides the CLI flag, LGTM
cmd/options.go
Outdated
@@ -67,6 +67,7 @@ func optionFlagSet() *pflag.FlagSet { | |||
flags.String("summary-time-unit", "", "define the time unit used to display the trend stats. Possible units are: 's', 'ms' and 'us'") | |||
flags.StringSlice("system-tags", lib.DefaultSystemTagList, "only include these system tags in metrics") | |||
flags.StringSlice("tag", nil, "add a `tag` to be applied to all samples, as `[name]=[value]`") | |||
flags.Bool("no-cookies-reset", false, "don't reset cookies after a VU iteration") |
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.
Looking at this again, I'm not sure this functionality deserves its own CLI flag. Maybe leave it just as JS/evn. var option for now? We can always add the CLI flag later if users request it.
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.
Good point, I guess we should discuss someday what worth or not a CLI flag. I'll wipe this out for now.
Hi guys, I have question @luizbafilho. Am I able to run k6 with this new option --no-cookies-reset now ? I'm trying build k6 from sources. But I got ERRO[0000] unknown flag: --no-cookies-reset. |
Hey @mercs600, we didn't add a command-line option for the new setting because we didn't want to overcrowd the CLI interface with an option that probably won't be used very often. If there's enough user demand we can always enable it later, but for now you can still enable the "no cookies reset" functionality it by setting the environment variable
or by using the in-script option export let options = {
noCookiesReset: true
}; Sorry for the confusion, I've expanded the upcoming release notes to mention this and later I'll also update the readme.io docs with information about it. |
@na-- thank you. Could you tell me something more ? I'm trying setup cookies in setup() lifecycle. For example I make login action in setup() and there after submitForm with login credentials server returns cookies. I would like to use this cookies in default cycle when tests are executing. Is it possible ? Because right now when I setup it manually by export options I can't do this. |
Hmm not sure if I correctly understand what you're trying to do, but keep in mind that In any case, these types of questions and discussions are more suited to the |
I resolved my issue by getting cookie from previous response in setup() cycle. |
closes #622