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

WebUI Edit running load test not carried user_classes when enabled --class-picker #2170

Closed
alterhu2020 opened this issue Aug 23, 2022 · 5 comments
Labels

Comments

@alterhu2020
Copy link
Contributor

alterhu2020 commented Aug 23, 2022

Describe the bug

  1. Run the web ui with option --class-picker, and it contains two userclass scripts(locustfile1.py,locustfile2.py), here we only pickup the locustfile1.py as the locust userclass
  2. When the script is running, from the top right click the Edit running load test and it only show custom the concurrent user, spawn rate and host, no options of UserClasses and ShapeClass
  3. Then click the Start swarming button

Expected behavior

It should only run locustfile1.py user class

Actual behavior

It had run all the userclasses, including locustfile1.py and locustfile2.py

Steps to reproduce

See above description

Environment

  • OS:
  • Python version: 3.10.2
  • Locust version: (please dont file issues for anything but the most recent release or prerelease builds) 2.11.0
  • Locust command line that you ran: locust -f /scripts --class-picker
  • Locust file contents (anonymized if necessary):
@cyberw
Copy link
Collaborator

cyberw commented Aug 23, 2022

@mikenester Can you maybe take a look at this?

Might be hard to do, but at the very least we should grey out the User & LoadShape options in the "edit running test dialog" to indicate that they cannot be changed.

@alterhu2020
Copy link
Contributor Author

alterhu2020 commented Aug 23, 2022

the code happened here is web.pyLine: 160

                # Updating UserClasses
                if form_data_user_class_names:
                    user_classes = {}
                    for user_class_name, user_class_object in self.environment.available_user_classes.items():
                        if user_class_name in form_data_user_class_names:
                            user_classes[user_class_name] = user_class_object

                else:
                    user_classes = self.environment.available_user_classes
                self._update_user_classes(user_classes)

                # Updating ShapeClass if specified in WebUI Form
                form_data_shape_class_name = request.form.get("shape_class", "Default")
                if form_data_shape_class_name == "Default":
                    self._update_shape_class(None)
                else:
                    self._update_shape_class(form_data_shape_class_name)

when the form_data_user_class_names is empty, it will use all the available userclasses.

thanks team, please help for it.

@mikenester
Copy link
Contributor

@mikenester Can you maybe take a look at this?

Might be hard to do, but at the very least we should grey out the User & LoadShape options in the "edit running test dialog" to indicate that they cannot be changed.

Yeah i can take a look a little later today

@alterhu2020
Copy link
Contributor Author

@mikenester
I create a PR for this, please have a look at it: #2171 thanks

@alterhu2020
Copy link
Contributor Author

close it as #2171 merged into the project now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants