-
Notifications
You must be signed in to change notification settings - Fork 43
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
Full test coverage for GRIB1 #583
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #583 +/- ##
==========================================
+ Coverage 89.60% 89.80% +0.20%
==========================================
Files 8 8
Lines 2473 2473
Branches 420 420
==========================================
+ Hits 2216 2221 +5
+ Misses 159 155 -4
+ Partials 98 97 -1 ☔ View full report in Codecov by Sentry. |
I have discovered some of the iris-grib/src/iris_grib/__init__.py Lines 302 to 307 in 11169cf
How to calculate
Our codebase has handling for the following: 1, 2, 3, 4, 5, 10, 51, 113, 114, 115, 116, 117, 118, 123, 124, 125. Of these, Eccodes errors for the below codes, which are precisely those not present in
I will therefore not attempt test coverage for loading these types of files. I will remove them from the original list. |
Found some more unreachable code. iris-grib/src/iris_grib/__init__.py Lines 56 to 74 in 11169cf
So my new tests can never exercise the code for the other |
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.
OK I'm pretty convinced that this addresses the right areas, and I've run my own coverage check to confirm it does what you say. Good enough I think !
Closes #488
We need coverage to be file-based - we can't just mock the
GribWrapper
since we're planning to change toGribMessage
. Probably can't mock eccodes either given how it manages a file cursor.The files we have offer almost full coverage of our GRIB1 code (
GribWrapper
and_grib1_load_rules.py
), but I will need to generate some artificial files (maybe by on-the-fly modification?) to fill the remaining gaps:iris-grib/src/iris_grib/__init__.py
Line 446 in 11169cf
iris-grib/src/iris_grib/_grib1_load_rules.py
Line 46 in 11169cf
iris-grib/src/iris_grib/_grib1_load_rules.py
Line 143 in 11169cf
iris-grib/src/iris_grib/_grib1_load_rules.py
Line 147 in 11169cf
iris-grib/src/iris_grib/_grib1_load_rules.py
Line 213 in 11169cf
iris-grib/src/iris_grib/_grib1_load_rules.py
Line 224 in 11169cf
iris-grib/src/iris_grib/_grib1_load_rules.py
Line 232 in 11169cf
iris-grib/src/iris_grib/_grib1_load_rules.py
Line 252 in 11169cf
iris-grib/src/iris_grib/_grib1_load_rules.py
Line 256 in 11169cf
iris-grib/src/iris_grib/_grib1_load_rules.py
Line 260 in 11169cf
iris-grib/src/iris_grib/_grib1_load_rules.py
Line 299 in 11169cf