diff --git a/pixi.toml b/pixi.toml index 75b0e9d..a714ae0 100644 --- a/pixi.toml +++ b/pixi.toml @@ -7,6 +7,7 @@ platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"] [tasks] workflow = "python workflow.py" +workflow_test = "python workflow.py --config pypsa_validation_processing/configs/config.country-timeseries.yaml && python workflow.py --config pypsa_validation_processing/configs/config.country-year.yaml && python workflow.py --config pypsa_validation_processing/configs/config.region-timeseries.yaml && python workflow.py --config pypsa_validation_processing/configs/config.region-year.yaml && pytest tests/ -v" test = "pytest tests/ -v" [dependencies] @@ -24,4 +25,3 @@ pandas = ">=1.0.0" pyam-iamc = ">=2.0.0" nomenclature-iamc = ">=0.29" pypsa-validation-processing = { path = ".", editable = true } - diff --git a/tests/test_pixi_tasks.py b/tests/test_pixi_tasks.py new file mode 100644 index 0000000..092fe36 --- /dev/null +++ b/tests/test_pixi_tasks.py @@ -0,0 +1,18 @@ +from pathlib import Path +import tomllib + + +def test_workflow_test_task_runs_all_required_commands_in_order(): + pixi_toml_path = Path(__file__).resolve().parent.parent / "pixi.toml" + pixi_config = tomllib.loads(pixi_toml_path.read_text()) + + task_command = pixi_config["tasks"]["workflow_test"] + parts = task_command.split(" && ") + + assert parts == [ + "python workflow.py --config pypsa_validation_processing/configs/config.country-timeseries.yaml", + "python workflow.py --config pypsa_validation_processing/configs/config.country-year.yaml", + "python workflow.py --config pypsa_validation_processing/configs/config.region-timeseries.yaml", + "python workflow.py --config pypsa_validation_processing/configs/config.region-year.yaml", + "pytest tests/ -v", + ]