Contributing to ProTest
ProTest comprises a number of libraries that are intended to facilitate the development of product tests. The libraries are located at src/ska-pss-protest and each is repsonsible for a different piece of functionality that may be required by a test. Examples include
The handling of test vectors - how they are provisioned from a remote server, and stored/accessed in the local cache.
The preparation and execution of cheetah with all of its required input
The extraction of header parameters from filterbank files
The verification of candidate filterbanks
The verification of candidate metadata
As ProTest (and cheetah) grows, more and more libraries will be required to verify PSS data products. New libraries can be added to ProTest by simply adding them to src/ska-pss-protest. New libraries and the classes within them should be added to init.py as follows
from ska_pss_protest.<new_library> import <new_class_a>, <new_class_b>
There are no specific naming conventions currently required of new libraries but they should at least succinctly describe what the library does. Each library must naturally be accompanied by a test of unit tests and these should be placed in tests/. Like product tests, unit test are tagged with markers which describe the library that they are testing. This allows the developer to execute their own new tests during development of their library. New markers for unit tests should be declared in pytest.ini. To execute unit tests of a specific library, one can run
pytest -m <marker> tests/
or to run all tests
make python-test
Adding/changing command line options
ProTest is pytest with specific functionality for testing cheetah pipelines. As such, it is possible to pass any pytest command line options to the ProTest executable protest.py. To ensure that ProTest behaves as the user intends, it is important when adding new command line arguments to ProTest that they do not also correspond to command line arguments that pytest will accept. If ProTest and pytest were to share common command line arguments, pytest will override what is otherwise intended to be an instruction to ProTest. The list of available command line arguments for pytest can be inspected by running
protest -P