Update shape class' runner when Web UI picker is used - #2534
Conversation
|
Can you add a test case that fails without this change? |
|
There you go :) |
|
I see the need for the change, but |
|
I believe that we should avoid code repetition. Also I think that the action should be encapsulated by a method, as it wouldn't be clean to modify |
|
How about doing it here: https://github.com/locustio/locust/pull/2534/files#diff-498b8c363e788cc0210ac8600bce7660c60d210cad41af086886b79055c717beR636 Something like environment-runner separation is very messy, and while I dont like duplication, I like methods with unclear meaning even less :) |
|
your code, your rules ;) |
|
Thx! |
a shape class'
.runnermember is set by_create_runnermethod ofEnvironmentclass. However, when the UI picker is used, theshape_classmember of anEnvironmentinstance is not initialized yet, hence, there's noRunnerassignment on initialization. Therefore, if you'd like to refer toself.runnerin your custom test shape (for instance to get the number of users running), you receive an error saying thatself.runnerisNone.Hence, I added the shape class
runnerinitialization also when the shape class is selected with UI picker.