-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: [SYNC-3835] pydocstyle implementation #585
Conversation
477fb7d
to
1dc9ed8
Compare
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.
Added a few more descriptive titles for things. That way the titles aren't just "title" spaceholders.
f775454
to
5aed9e3
Compare
tests/load/locustfiles/load.py
Outdated
------- | ||
TickTuple | None | ||
|
||
Distribution Parameters |
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've not heard of the term 'Distribution Parameters' before. For clarity user_count
spawn_rate
and user_classes
are the fields in the return type TickTuple
, having them defined at the same indentation as None
, the alternative return type to TickTuple I think may be confusing in future.
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 will take it out, even though it was there before??? Let me know if the change to just enumerate the contained parameters is clearer.
def tick(self) -> TickTuple | None:
"""Override defining the desired distribution for Autopush load testing.
Returns:
TickTuple | None
TickTuple Contained Parameters
user_count: Total user count
spawn_rate: Number of users to start/stop per second when changing
number of users
user_classes: None or a List of user classes to be spawned
None: Instruction to stop the load test
"""
tests/load/locustfiles/locustfile.py
Outdated
return self.environment.autopush_wait_time(self) | ||
|
||
def on_start(self) -> Any: | ||
"""Called when a User starts running.""" | ||
"""Call when a websocket starts running.""" |
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 'Callback' maybe a better word for the nature of these lifecycle methods?
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 had actually tried that, but pydocstyle didn't like it since it's not in imperative mood. Now the linter is bossing us around 😆
D401: First line should be in imperative mood; try rephrasing (found 'Callback')
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.
D451: Developer muttered about "burn it all to the ground" which hurt linters feelings; try therapy.
tests/load/locustfiles/locustfile.py
Outdated
return self.environment.autopush_wait_time(self) | ||
|
||
def on_start(self) -> Any: | ||
"""Called when a User starts running.""" | ||
"""Call when a websocket starts running.""" |
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.
It is User here, not websocket.
"""Call when a websocket starts running.""" | |
"""Call when a User starts running.""" |
tests/load/locustfiles/locustfile.py
Outdated
self.ws_greenlet = gevent.spawn(self.connect) | ||
|
||
def on_stop(self) -> Any: | ||
"""Called when a User stops running.""" | ||
"""Call when a websocket stops running.""" |
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.
"""Call when a websocket stops running.""" | |
"""Call when a User stops running.""" |
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.
Looks good!
I took the liberty of suggesting some improved docstrings for some of the tests that actually explain what the test is attempting. I figure that might help both QA and dev define some of the requirements that Autopush has.
I also tried to make sure that we refer to VAPID in upper case in doc strings, because it's technically an acronym and not just something that's lacking taste and dull.
…command for pydocstyle
8716f81
to
dbee993
Compare
References
JIRA: SYNC-3835
Description
Addition of pydocstyle to python testing section of autopush.
Acceptance Criteria
The following has been implemented:
pydocstyle
to thelint
command and also implemented amake pydocstyle
command that can be called on its own for a richer output on recommendations..install.stamp
to manage poetry dependency installation whenever commands invoked. This was then added to.gitignore
and.dockerignore
PR Review Checklist
Put an
x
in the boxes that apply[SYNC-####]
, and has the same title (if applicable)