-
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
Rename locust to user #1314
Rename locust to user #1314
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1314 +/- ##
=======================================
Coverage 80.67% 80.67%
=======================================
Files 24 24
Lines 2251 2251
Branches 345 345
=======================================
Hits 1816 1816
Misses 343 343
Partials 92 92 Continue to review full report at Codecov.
|
Thanks! But there are lots of places where "User" are still called "Locust", so there is more work to be done. Can you introduce a hidden parameter -c/--client that throws an error? Thanks! We should also discuss whether things like LocustRunner should be renamed UserRunner? I'm in favour of that. |
Hmm, maybe just |
@anuj-ssharma Any chance you'll have time to look at the suggested changes & fix the conflicts soon? It would be great to be able to release 1.0 soon! |
locust/test/test_locust_class.py
Outdated
@@ -90,7 +90,7 @@ def t2(self): | |||
self.assertEqual(3, len([t for t in l.tasks if t.__name__ == MyLocust.t2.__name__])) | |||
|
|||
def test_tasks_on_abstract_locust(self): | |||
class AbstractLocust(Locust): | |||
class AbstractLocust(User): |
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.
AbstractUser maybe?
locust/test/test_locust_class.py
Outdated
@@ -391,7 +391,7 @@ def on_start(self): | |||
else: | |||
self.interrupt(reschedule=False) | |||
|
|||
class MyLocust(Locust): | |||
class MyLocust(User): |
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.
MyUser...
locust/test/test_main.py
Outdated
from .testcases import LocustTestCase | ||
from .mock_locustfile import mock_locustfile | ||
|
||
|
||
class TestLoadLocustfile(LocustTestCase): | ||
def test_is_locust(self): | ||
self.assertFalse(main.is_locust(("Locust", Locust))) | ||
self.assertFalse(main.is_locust(("Locust", User))) |
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.
...
👍 All of the documentation stills needs updating as well I currently get an exception when I run |
Still working through this sorry ! |
I think I've messed up with merge conflicts |
Still need to update the documentation |
@@ -31,7 +31,7 @@ def wrapper(*args, **kwargs): | |||
return wrapper | |||
|
|||
|
|||
class XmlRpcLocust(Locust): | |||
class XmlRpcLocust(User): |
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.
XmlRpcUser
locust/contrib/fasthttp.py
Outdated
@@ -47,7 +47,7 @@ def _construct_basic_auth_str(username, password): | |||
return 'Basic ' + b64encode(b':'.join((username, password))).strip().decode("ascii") | |||
|
|||
|
|||
class FastHttpLocust(Locust): | |||
class FastHttpLocust(User): |
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.
FastHttpUser
locust/core.py
Outdated
@@ -511,7 +511,7 @@ def start(self, gevent_group): | |||
def run_locust(user): |
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.
run_user
locust/core.py
Outdated
@@ -511,7 +511,7 @@ def start(self, gevent_group): | |||
def run_locust(user): | |||
""" | |||
Main function for Locust user greenlet. It's important that this function takes the locust |
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.
user instance
locust/core.py
Outdated
@@ -538,12 +538,12 @@ def stop(self, gevent_group, force=False): | |||
return False | |||
|
|||
|
|||
class HttpLocust(Locust): | |||
class HttpLocust(User): |
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.
HttpUser
The last commit broke the build (seems some tests need updating), but if you fix that then I then I am +1 to merge! |
Fix a broken test.
Great work!
I've fixed the broken tests, but I'd like some time to go through the changes a bit more thoroughly before be merge. Hopefully I'll be able to do that later today/tonight. |
My last commit (which is a merge) will break tests. Will analyse and fix them. |
and fixed now ! |
Merged! |
#1283