Limiting the datasets that are tested on a given stack
It may be that a dataset has not yet been published on every stack and so you only want to test it on a subset.
The most general way to limit the stacks a dataset is tested on is to define either a variable called "stacks
" or "exclude_stacks
" at the main level of the test_<dataset>.py
module. Each should be set to a list of stack names. In the first case, this dataset will only be tested on stacks whose names appear in the list. In the second case, it will only be tested on stacks whose names do not appear, e.g.
# Not yet published on c3sprod exclude_stacks = ['c3sprod'] def test_one(): return { ...}
Alternatively, if you only want it to take effect in the ecFlow suite, you can define a list of stacks to exclude for a given stack in the suite_config.yaml
file as follows...
stack_config: c3sprod: exclude_datasets: - 'satellite-ob-product'
A third method would be to move the test modules down into sub-directories named after the stacks you want them tested on, as described in the next section.
Defining different tests for different stacks
It may be that some new data or request parameters have been added to some some stacks but have not been published on others, and so you want different tests applied to different stacks. To define a different set of tests for a given stack create a sub-directory with the stack's name under the usual <system>/
tests directory. Test modules in this sub-directory will be used in place of any in the parent directory for the named stack.
So, for example, if you have a two test modules for a dataset called c3s/test_mydataset.py
and c3s/c3sprod/test_mydataset.py
then all stacks will take tests from the first file apart from c3sprod which will take it from the second.