From 4a5a7496d361d30957b4369e511348e43c23329c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Jeanneret?= Date: Thu, 29 Aug 2024 13:17:08 +0200 Subject: [PATCH] Ensure we have one scenario per automation file This is in addition to a coming PR, #375. This change here is allowing to ensure we follow those practices: - only one scenario per file - filename matches "scenario_name.yaml" pattern --- .ci/automation-schema.yaml | 2 +- .ci/validate-schema-paths.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.ci/automation-schema.yaml b/.ci/automation-schema.yaml index 415e12a3c..e47fc0cfb 100644 --- a/.ci/automation-schema.yaml +++ b/.ci/automation-schema.yaml @@ -4,7 +4,7 @@ # We are using yamale to validate files # https://github.com/23andMe/Yamale --- -vas: map(include('_architecture'), key=str()) +vas: map(include('_architecture'), key=str(), min=1, max=1) --- # Define various nested types diff --git a/.ci/validate-schema-paths.py b/.ci/validate-schema-paths.py index 94b18c31b..a2836156a 100644 --- a/.ci/validate-schema-paths.py +++ b/.ci/validate-schema-paths.py @@ -24,6 +24,8 @@ def __run_file(self, f): content = yaml.safe_load(fh) for scenario in content['vas']: print(f' Checking scenario: {scenario}') + assert (rel.name == f'{scenario}.yaml'), \ + f'!! {rel.name} does not match {scenario}.yaml' self.__validate(content['vas'][scenario]) def __validate(self, scenario):