CI: add -m <module> shortcut to test individual modules

This commit is contained in:
Adriaan de Groot 2021-03-14 16:36:00 +01:00
parent cc310a04b8
commit f62bb70b28

View File

@ -13,6 +13,7 @@ JSON-representable, anyway.
Usage:
configvalidator.py <schema> <file> ...
configvalidator.py -m <module>
configvalidator.py -x
Exits with value 0 on success, otherwise:
@ -22,6 +23,8 @@ Exits with value 0 on success, otherwise:
4 if files have invalid syntax
5 if files fail to validate
Use -x as only command-line argument to check the imports only.
Use -m <module> as shorthand for standard paths in src/modules/<module>/
"""
# The schemata originally lived outside the Calamares repository,
@ -65,6 +68,11 @@ if len(sys.argv) < 3:
print(usage)
exit(ERR_USAGE)
if len(sys.argv) == 3 and sys.argv[1] == "-m":
module = sys.argv[2]
schema_file_name = f"src/modules/{module}/{module}.schema.yaml"
config_file_names = [ f"src/modules/{module}/{module}.conf" ]
else:
schema_file_name = sys.argv[1]
config_file_names = sys.argv[2:]