-
Notifications
You must be signed in to change notification settings - Fork 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
Locustfile distribution from master to worker #2583
Conversation
…ng it present locally.
…for-locustfile-distribution
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'm kinda surprised that it works!
locust/argument_parser.py
Outdated
|
||
options, _ = parser.parse_known_args(args=args) | ||
|
||
if options.locustfile == "-": | ||
# having this in argument_parser module is a bit weird, but it needs to happen early on |
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.
Maybe i would have put this in a separate function just to prevent some bloat/make it more "digestible"
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.
better now?
elif msg.type == "locustfile": | ||
logging.debug("Worker requested locust file") | ||
assert self.environment.parsed_options | ||
filename = ( |
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.
is this just in case the user didn't put .py at the end? Feels like this maybe should be done in the argument parser if possible
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.
The default value for locust file is "locustfile" (but gets expanded to "locustfile.py" implictly) which is why I support this. I could change it to just "add .py if there is no .py at the end" which would support if someone says "locust -f module_name_without_py_at_the_end". Specifying a bare module name and then having the file transfered anyway, might be nice, but it is kinda weird, and exception logged later on (line 1048) might become confusing if locust just adds .py automatically. What do you think?
…locusfile. Test the warning.
…h "--worker" to stderr, instead of raising exception.
Make workers get locustfile directly from master when locustfile argument is set to
-