-
Notifications
You must be signed in to change notification settings - Fork 2
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
refactor: Simplify testing with ScopedTritonServer instead of pytest fixtures #68
Conversation
tests/utils.py
Outdated
self.timeout = timeout | ||
|
||
def __enter__(self): | ||
run(["remove", "-m", "all"]) |
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.
Can you make the following tweaks for use of clear()
?
- move the
_clear()
helper intoutils.py
and use it here? - Add a
if repo:
clause to the_clear()
helper, I just realized it's missing. Will look like this. - Update the other calls to do
utils.clear()
instead ofself._clear()
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.
Would it make sense to move all the helper functions into utils.py
? It will reduce the replication of helper functions between test_cli.py
and test_e2e.py
.
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.
Sounds good if being replicated
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.
Nice changes! Left some minor comments. CC @krishung5 for comments too.
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.
Just some minor comments. Great work!
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.
Nice refactoring!
This PR has been raised to address Jira Ticket [DLIS-6803]
Replaces the existing (pytest.fixture and generator) approach with
ScopedTritonServer
, a context manager, that starts and kills the server.Specific features being added/addressed in this PR:
ScopedTritonServer
) abstracts away process id logic from the test functionsScopedTritonServer
Functions:__enter__()
: Sends start up command and polls until server is ready__exit__()
: Kills the server