Closed markshowalter closed 5 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 75.44%. Comparing base (
5f1fbd0
) to head (0d6b097
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This completes the changeover of all
oops/hosts
unit tests totests/hosts
. I needed it so that I could more clearly identify the code coverage of various modules once you exclude the test code itself. Summary of changes...In
oops/hosts
, I removed unit tests from every module. This includesgold_master.py
andstandard_obs.py
wherever they appeared.Previously,
tests/hosts
was just a copy ofoops/hosts
, because that's where I had left things when I moved all the other unit tests. Now, each file just contains the unit tests. This is also where you find all filesgold_master.py,
standard_obs.py
, andunittester.py
. Conceptually, things are set up so thattests/hosts/mission/instrument/unittester.py
tests the given instrument,tests/hosts/mission/unittester.py
tests all the instruments on the mission, andtests/hosts/unittester.py
tests all hosts.For my own convenience, I added
tests/unittester_with_hosts.py
, which runs all the OOPS unit tests including hosts.Where there were random files or unused bits of code in
oops/hosts
that had once been used for testing but are now unused, I moved them totests/hosts
but they are still unused.In
scripts/automated_tests/oops_main_test.sh
, I changed the location for the hosts tests fromoops/hosts/unittester.py
totests/hosts/unittester.py
.In
tests/*.py
, I made sure eachsetUp()
function loaded the kernels that are needed for that test. The philosophy is that each test is responsible for its own kernels to be present (and must-be-excluded kernels to be absent). If a test does not do that, outcomes could be unpredictable. For the most part,tearDown()
functions are not implemented (or I left them in there with "pass"), but I use them to undo anything especially pathological I did in thesetUp()
.I added
_undefine_solar_system()
toBody
, which wipes the internal cache; it's needed for debugging.Similarly, I added
_unload_all()
tospicedb.py
, which unloads all kernels. Again, needed for debugging.Bugfix: the reference to
AliasFrame
inbody.py
didn't work quite as expected. I changed it toFrame.as_frame()
.Bugfix:
hosts/galileo/__init__.py
was not loading the Galileo Frames kernel, which means I don't quite know how it worked before--apparently a leftover kernel load from somewhere else was hiding this bug.There's a small discrepancy between some gold-master calculations on Windows vs. Mac/Linux. We have seen it before and it remains unexplained. Nevertheless, I needed to update the error threshold on some Galileo Europa tests to get this to pass for Windows. Several angles (center phase, orbital longitude) had discrepancies of 0.0012-0.0014 degrees, whereas the default error threshold was 0.001.