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

Rename locust to user #1314

Merged
merged 43 commits into from
Apr 23, 2020
Merged

Conversation

anuj-ssharma
Copy link
Contributor

@codecov
Copy link

codecov bot commented Apr 6, 2020

Codecov Report

Merging #1314 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5aca141...5aca141. Read the comment docs.

@cyberw
Copy link
Collaborator

cyberw commented Apr 6, 2020

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.

@heyman
Copy link
Member

heyman commented Apr 6, 2020

We should also discuss whether things like LocustRunner should be renamed UserRunner? I'm in favour of that.

Hmm, maybe just Runner ( andLocalRunner, MasterRunner and WorkerRunner)?

locust/core.py Show resolved Hide resolved
@heyman heyman linked an issue Apr 6, 2020 that may be closed by this pull request
@cyberw
Copy link
Collaborator

cyberw commented Apr 9, 2020

@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!

@@ -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):
Copy link
Collaborator

Choose a reason for hiding this comment

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

AbstractUser maybe?

@@ -391,7 +391,7 @@ def on_start(self):
else:
self.interrupt(reschedule=False)

class MyLocust(Locust):
class MyLocust(User):
Copy link
Collaborator

Choose a reason for hiding this comment

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

MyUser...

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)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

...

@heyman
Copy link
Member

heyman commented Apr 16, 2020

👍

All of the documentation stills needs updating as well

I currently get an exception when I run locust --help with this PR.

@anuj-ssharma
Copy link
Contributor Author

Still working through this sorry !

@anuj-ssharma
Copy link
Contributor Author

I think I've messed up with merge conflicts

@anuj-ssharma
Copy link
Contributor Author

Still need to update the documentation

@@ -31,7 +31,7 @@ def wrapper(*args, **kwargs):
return wrapper


class XmlRpcLocust(Locust):
class XmlRpcLocust(User):
Copy link
Collaborator

Choose a reason for hiding this comment

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

XmlRpcUser

@@ -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):
Copy link
Collaborator

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):
Copy link
Collaborator

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
Copy link
Collaborator

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):
Copy link
Collaborator

Choose a reason for hiding this comment

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

HttpUser

@anuj-ssharma
Copy link
Contributor Author

@cyberw @heyman
What are your opinions on renaming the option locust_classes to user_classes ?

@cyberw
Copy link
Collaborator

cyberw commented Apr 21, 2020

The last commit broke the build (seems some tests need updating), but if you fix that then I then I am +1 to merge!

@heyman
Copy link
Member

heyman commented Apr 21, 2020

Great work!

The last commit broke the build (seems some tests need updating), but if you fix that then I then I am +1 to merge!

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.

@anuj-ssharma
Copy link
Contributor Author

My last commit (which is a merge) will break tests. Will analyse and fix them.

@anuj-ssharma
Copy link
Contributor Author

My last commit (which is a merge) will break tests. Will analyse and fix them.

and fixed now !

@heyman heyman merged commit cac9add into locustio:master Apr 23, 2020
@heyman
Copy link
Member

heyman commented Apr 23, 2020

Merged!

@anuj-ssharma anuj-ssharma deleted the rename_locust_to_user branch April 23, 2020 20:36
@heyman heyman added this to the 1.0 milestone Apr 29, 2020
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.

Rename Locust to User/LocustUser
3 participants