Skip to content

search: Parameterize tests against individual tasks

The for_each_task helper used in test_dag_structure.py was a bit tedious. If one task failed that failed the whole test, other tasks would not be checked for problems. That meant the fixture rendering would only generate one new fixture per run and other tests could fail, the programmer fixes it, then the next task fails.

Adjust the way we manage those by loading the dags up front to get a full list of tasks during the collection phase of pytest. Once we have the full list we can use pytest.mark.parameterize as usual.

This required a small change to search.config.dag_config. It was using module level values that meant that the specific environment vars available when the module was first loaded are used throughout the remainder of execution. To facilitate using the current environment vars default_args were wrapped into a method that can be invoked from each dag file to get the config it needs.

Merge request reports