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

fix: when run from web with -f a_file_folder/ caused page title is None as locustfile argument is None #2175

Merged
merged 2 commits into from
Sep 11, 2022

Conversation

alterhu2020
Copy link
Contributor

@alterhu2020 alterhu2020 commented Aug 28, 2022

Steps:

  1. run the locust with command -f a_file_folder/ the locustfile argument is a folder, so in the main.py it will return locustfile as None
  2. When start the test, then the web page title Locust for None shows, we need to correct the locustfile variable at this situation

@cyberw
Copy link
Collaborator

cyberw commented Aug 28, 2022

Wouldnt this cause issues on repeated runs? I mean wouldnt the second run show the same users as the first even if the user had changed the selection?

@alterhu2020
Copy link
Contributor Author

alterhu2020 commented Aug 28, 2022

Wouldnt this cause issues on repeated runs? I mean wouldnt the second run show the same users as the first even if the user had changed the selection?

Hi @cyberw the above code can show the changed user when we switch to another selected user. But here comes another issue, we need to refresh the page to make the changes take affect.
So we need to change the locustfile variable in this function: locust.web.WebUI.update_template_args as well.

please take consider this issue should we change the code in above location as well ? thanks

image

@cyberw
Copy link
Collaborator

cyberw commented Aug 28, 2022

I dont have many opinions on the UI, and never use it myself :) So whatever works and doesnt show incorrect info…

@cyberw
Copy link
Collaborator

cyberw commented Aug 31, 2022

Need to fix the code formatting though...

@cyberw
Copy link
Collaborator

cyberw commented Sep 7, 2022

@alterhu2020 This is probably a good fix, you just need to run Black to format your code..

@cyberw cyberw added the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Sep 7, 2022
@cyberw cyberw merged commit ea7c81c into locustio:master Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants