From ab9c91e8bab1f2bbfc310835c7d4c3624b27fb30 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):