Skip to content

Commit

Permalink
Merge pull request #379 from openstack-k8s-operators/linter/split-aut…
Browse files Browse the repository at this point in the history
…omation

Ensure we have one scenario per automation file

This is in addition to a coming PR, #383. This change here is allowing
to ensure we follow those practices:

only one scenario per file
filename matches "scenario_name.yaml" pattern
  • Loading branch information
2 parents 2444537 + ab9c91e commit 07cc650
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .ci/automation-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .ci/validate-schema-paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 07cc650

Please sign in to comment.