-
Notifications
You must be signed in to change notification settings - Fork 192
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
fix verdi computer show tab completion #4962
Conversation
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.
Thanks @unkcpz . The change of DbComputer.name
to DbComputer.label
was done in #4882 . It should have updated all other places in the code that still used name
but this one was clearly missed and it is not tested. It would be great if you could add a quick test for it. Note that I think therefore we should also project on label
instead of the hostname, because that is essentially what was being projected originally.
Codecov Report
@@ Coverage Diff @@
## develop #4962 +/- ##
===========================================
+ Coverage 80.05% 80.06% +0.01%
===========================================
Files 515 515
Lines 36611 36611
===========================================
+ Hits 29307 29308 +1
+ Misses 7304 7303 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
55e319b
to
145302c
Compare
Thanks @sphuber. The test added and also refactoring the unit test to use pytest. |
Well, seems run into pre-commit pylint warnings. Do we need to exclude |
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.
Thanks a lot for the test and refactoring @unkcpz . The tests should also be linted so it should not be added to the exclude list. The errors are easy to address though. I made three suggestions that show how to do it. Just the one of unused variables you should apply to the other locations in the code that pylint mentioned
@@ -8,88 +8,110 @@ | |||
# For further information please visit http://www.aiida.net # | |||
########################################################################### | |||
"""Tests for the `ComputerParamType`.""" |
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.
pylint: disable=redefined-outer-name
|
||
|
||
@pytest.fixture | ||
def setup_computers(clear_database_before_test): |
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.
def setup_computers(clear_database_before_test): | |
@pytest.mark.usefixtures('clear_database_before_test') | |
def setup_computers(): |
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.
Ah~oh, mark.usefixtures
does not work on fixtures ;-) pytest-dev/pytest#977
""" | ||
Verify that using the ID will retrieve the correct entity | ||
""" | ||
entity_01, entity_02, entity_03 = setup_computers |
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.
entity_01, entity_02, entity_03 = setup_computers | |
entity_01, _, _ = setup_computers |
145302c
to
2198872
Compare
@sphuber thanks! It should be all right this time. |
2198872
to
16943c4
Compare
restructure the tests.
16943c4
to
d6638b7
Compare
Got the following error when doing
verdi computer show <tab>
. This is a quick fix but just thinking when this change made inDbComputer
, maybe other places also need to be take care of?