-
Notifications
You must be signed in to change notification settings - Fork 99
Add acceptance tests for SAMOS CLIs where nothing should be returned #2219
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
Conversation
…lues due to having insufficient input data.
…thing should be returned. Improve doc-string.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2219 +/- ##
==========================================
- Coverage 98.39% 95.10% -3.30%
==========================================
Files 124 147 +23
Lines 12212 14867 +2655
==========================================
+ Hits 12016 14139 +2123
- Misses 196 728 +532 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
maxwhitemet
left a comment
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 am happy the tests cover the required tests cases, but I have made some very minor suggestions to enhance clarity.
improver_tests/acceptance/test_estimate_samos_coefficients_from_table.py
Outdated
Show resolved
Hide resolved
improver_tests/acceptance/test_estimate_samos_gams_from_table.py
Outdated
Show resolved
Hide resolved
improver_tests/acceptance/test_estimate_samos_gams_from_table.py
Outdated
Show resolved
Hide resolved
improver_tests/acceptance/test_estimate_samos_gams_from_table.py
Outdated
Show resolved
Hide resolved
ef99f71 to
687db70
Compare
|
Thanks for your review @maxwhitemet. I've modified most of the doc-strings as you've suggested to more explicitly say 'returns None' where appropriate. Some of your comments suggest explaining why we want certain outcomes in the test. I've not added these as I believe they should be described in the plugins/CLIs themselves rather than associated tests. |
maxwhitemet
left a comment
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.
Happy with the changes made. Approved 👍
bayliffe
left a comment
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.
There is a problem with all of these tests, in that they don't test anything. The run_cli call will assert as None for all of your valid tests that don't return None as well (have a play). The call to run_cli executes the CLI call which leads to a file being written, but you don't get anything else back in most (all?) cases.
improver/improver/cli/__init__.py
Line 582 in b25dd40
| result = exec_cmd( |
Trying to follow this through is not very fun, so it's easier just to test working tests that don't return None and see that you always get None as a result of the run_cli call.
You will need to check that there is no output as a result of the tests you've added, something like:
assert not output_path.exists()
@maxwhitemet have another look at this and play around so you get a better understanding, and think about how you might test this in future.
Thanks @bayliffe. I've changed all instances of |
bayliffe
left a comment
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 Ben.
Various paths now exist within the estimate_samos* CLIs where nothing should be returned due to missing inputs. This PR adds acceptance tests for those situations.
Depends on: #2218
Testing: