-
Notifications
You must be signed in to change notification settings - Fork 1
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
[MB-10361] Use custom parameters to configure User Class Weights #83
Conversation
locustfiles/all.py
Outdated
class_options = request.form.getlist("user_classes_option") | ||
new_classes = [original_user_classes[n] for n in class_options] | ||
setattr(environment, "user_classes", new_classes) | ||
environment._remove_user_classes_with_weight_zero() |
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.
This errors out for me, because it's an internal method I'm guessing? Since you're setting the user_classes above to what was selected, we wouldn't need to set the unselected classes to a weight of zero I'm assuming.
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.
I think this might be in a different version of locust. It doesn't error out for me, so hopefully the pipenv changes will make it work for you, too
I think there is a way to add custom arguments to appear on the initial screen but I have a feeling that is in version 2 and we are still on Locust version 1. Have there been any discussions on upgrading by chance? On first glance I don't see major breaking changes (famous last words). locustio/locust#1881 |
THAT IS IT! THANK YOU |
* Also update the task definition to override the locustfile if necessary
@ahobson, we've pulled this story into our current sprint, but I've just done a diff with master and I think at this point all the relevant changes might have been merged in other branches. Am I correct in that? Or am I missing something? |
@felipe-lee You are right! I forgot we had this as a separate story and I accidentally sneaked it into another PR. Sorry about that |
Awesome, no problem. I'll close this and the ticket out then! |
Description
This is an example of how we could use custom weights to allow us to control which tests are run. Setting a user weight to 0 would remove them.
I tested this locally with locust 2.5.0 and it worked for me. I could run a test and then stop it and run with another set of user weights and it worked.