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

Allow setting run time from the web UI / http api #2202

Merged
merged 24 commits into from
Sep 19, 2022

Conversation

ajt89
Copy link
Contributor

@ajt89 ajt89 commented Sep 15, 2022

#2198

Implemented only the rest portion of the above issue. Should I have a separate PR for the ui component or make another commit to this PR?

@cyberw
Copy link
Collaborator

cyberw commented Sep 15, 2022

All in one PR is best!

locust/test/test_web.py Outdated Show resolved Hide resolved
self.environment.user_classes = [MyUser]
self.environment.web_ui.parsed_options = parse_options()
response = requests.post(
"http://127.0.0.1:%i/swarm" % self.web_port,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice test!!

@ajt89
Copy link
Contributor Author

ajt89 commented Sep 16, 2022

Screenshot from 2022-09-15 23-22-01
Should we have this as a flag on startup or a default option?

@cyberw
Copy link
Collaborator

cyberw commented Sep 16, 2022

Can I bother you to make some kind of "Advanced" button that hides/exposes this field? There are several other options that the user might want to set, but we dont want to show it all the time.

cyberw and others added 3 commits September 16, 2022 22:26
* Use Python 3.10 type hint syntax for Union types

* Use Python 3.10 type hint syntax for Union types (in more places)

* Use Python 3.10 type hint syntax for Union types (fix)

* Use Python 3.10 type hint syntax for Union types (fix)

* Use Python 3.10 type hint syntax for Union types (fix)

* one more try on web.py

* clients.py maybe maybe maybe

* fix users.py

* more types

* Remove unnecessary type hint
@ajt89
Copy link
Contributor Author

ajt89 commented Sep 16, 2022

Added a flag (similar to class-picker) to pass to the master.

@cyberw
Copy link
Collaborator

cyberw commented Sep 18, 2022

Maybe you could have a look at the "advanced" button I suggested? We already have too many command line options for enabling stuff in the UI :) (e.g. --class-picker, but we should also add --tags/--exclude-tags selection to this "advanced" part of the UI)

@ajt89
Copy link
Contributor Author

ajt89 commented Sep 19, 2022

Screenshot from 2022-09-18 22-48-28
Screenshot from 2022-09-18 22-48-41
Screenshot from 2022-09-18 22-49-03
Screenshot from 2022-09-18 22-49-13
Added an anchor element to toggle the "advancedOptions" div in "swarm_form"

@cyberw
Copy link
Collaborator

cyberw commented Sep 19, 2022

Very nice, thanks! Something broke with the tests though...

@ajt89
Copy link
Contributor Author

ajt89 commented Sep 19, 2022

Looking into it, for some reason the tests pass on my local. I do see there was a recent merge to master. Should I try a rebase?

@ajt89
Copy link
Contributor Author

ajt89 commented Sep 19, 2022

Looks like the rebase fixed the tests

@cyberw cyberw changed the title Add parameter for run_time to swarm endpoint Allow setting run time from the web UI / http api Sep 19, 2022
@cyberw
Copy link
Collaborator

cyberw commented Sep 19, 2022

The diff looks really bad, but I think it is just git messing with us :)

LGTM!

@cyberw cyberw merged commit dd08f3f into locustio:master Sep 19, 2022
@ajt89 ajt89 deleted the run-time-input-web branch September 19, 2022 17:55
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.

3 participants