-
Notifications
You must be signed in to change notification settings - Fork 39
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
Remove profile_diagnostic
from diagnostic settings and increase test coverage of _task.py
#1404
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1404 +/- ##
==========================================
+ Coverage 89.85% 90.70% +0.84%
==========================================
Files 197 197
Lines 10489 10499 +10
==========================================
+ Hits 9425 9523 +98
+ Misses 1064 976 -88
Continue to review full report at Codecov.
|
It looks like If you increase the test coverage I'll buy you a 🍺 next time we meet 😉 |
yesh man, on it today! I'll have a look at the NCL hiccup too 👍 |
OK @bouweandela I fixed the NCL bit, and now we are testing for |
@bouweandela I don't understand why codecov is complaining - those lines are nice and green (checked for) in my copy of the tests coverage (local run) - apart from that, this is RFR 🍺 |
agh nevermind! I figured it out - we're running a very low number of |
OK am converting this to a Draft until I get to the bottom of the issue of running a Python diagnostic in a test env on Circle - that's a bit disconcerting at the mo, we should be able to test the full top to bottom task infrastructure via a Py diag |
This fails with a
now. @valeriupredoi I agree with @bouweandela here that it might make sense remove your changes here to files that the tests that are not relevant for this PR. You think we can include this in the first release candidate (tomorrow morning)? |
…ng'"" This reverts commit 694bab6.
…ithub.com/ESMValGroup/ESMValCore into remove_profile_diagnostic_as_diag_setting
no, the tests are very much relevant to the second main scope of this PR - first is to get rid of that profile settings arg, and second is to increase the coverage for tasking which was poor previously. After a relatively major kerfuffle with git (I was sound asleep when I merged only God knows what I merged in here, took me an hour to fix it) I finally fixed the test to be more secure than previously (and fixed the issue with the NCL setting key too, cheers Manu!). If you don't run the Python mock test you don't test the tasking proper, and Bouwe made sure that he wrote the test in a rather "scratch your left ear with your right hand" way, so my hand were tied and couldn't go around it too much - why do you need a |
profile_diagnostic
from diagnostic settingsprofile_diagnostic
from diagnostic settings and increase test coverage of _task.py
Makes sense, thanks V.! I will have a another look at this once #1480 is fixed 👍 |
thanky much, Manu! 🍺 |
Could you also have a look at codecov? Cheers! 🍻 |
yes, I knew it'll complain - the bugger is now complaining that the increase in coverage dropped from 19% to 18% 🤣 But that's an extra 18%, ya codecov dummer! The problem is that I would have to write another test case for when the |
It's not complaining about the drop in the increase, but that not all new lines are hit. You need a test case that satisfies |
cheers, Manu! That's only for the NCL case and it's not immediately straightforward to me how to do that without running another mock diagnostic (which I don't see the need for, it just slows down the test) - any ideas? You speak NCL much better than me 😁 |
You don't need to run a mock diag for that. I think you can really just copy the test you added to def test_write_ncl_settings(tmp_path):
"""Test minimally write_ncl_settings()."""
settings = {
'run_dir': str(tmp_path / 'run_dir'),
'profile_diagnostic': False,
'var_name': 'tas',
}
file_name = tmp_path / "settings"
write_ncl_settings(settings, file_name)
with open(file_name, 'r') as file:
lines = file.readlines()
assert 'var_name = "tas"\n' in lines
assert 'profile_diagnostic' not in lines |
Manu you're a genius! I totally forgot about the unit test, which was indeed changed by me too, even in this PR 😆 Maybe I should call it quits today 🤦♂️ |
Haha, please don't quit just yet, I need your review for a fix for #1480 in a couple of minutes 😄 |
am still in, dude 🖖 |
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 tested everything again, works fine now! Thanks V!!
thoughts and prayers for my hero Manu 🇺🇸 🦅 Cheers much dude!! |
Description
Closes #1392
Link to documentation:
Before you get started
Checklist
It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.
To help with the number pull requests: