Tests
The pipeline comes with a suite of tests: They ensure the code is doing what it’s supposed to and enable developers to change code confidently.
Test Classes
Section titled “Test Classes”There are four test classes (using pytest marks):
integration: Test whether the pipeline is correctly set up on your system (testing config validity, connection to metadata, etc.)quick: Test static type hints and small utility functionsci: Test whether the pipeline is doing what it shouldcomplete: Test whether the retrieval is doing what it should
The ci and complete tests download a sample dataset of three days (from two systems) and run all retrieval algorithms (Proffast 1 with GGG2014, Proffast 2.X with GGG2014 and GGG2020). The ci does everything that complete does (spawning containers, moving files, etc.) but does not run the retrieval code itself. These two classes exist because the complete tests take 10-15 minutes on our 10-Core VM, whereas the ci tests can be run within 2-3 minutes in the GitHub CI environment on a 2-Core machine.
You can run the different test classes with:
# one classpytest -m 'quick'
# multiple classespytest -m 'quick or integration'Order of the Tests
Section titled “Order of the Tests”The tests are ordered the following way - the fast tests should run first to get a quick feedback loop. Add the --exitfirst flag to stop the tests after the first failure.
- Static types (
quick) - Config template/documentation (
quick) and local config (integration) - Utility functions (
quick) and metadata/profiles connection (integration) - Run mock retrieval (
ci) - Run full retrieval (
complete)
Retrieval Tests
Section titled “Retrieval Tests”The ci and complete tests use the sample interferograms, pressure data, and atmospheric profiles under example/data/inputs. Generated retrieval results are written to data/testing/outputs/individual-results.