-
Notifications
You must be signed in to change notification settings - Fork 4
Validate rose meta #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Validate rose meta #105
Conversation
""" | ||
|
||
print("\n\n[INFO] - Validating rose-stem apps\n\n") | ||
failed = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
failed = False |
if errors: | ||
print(f"[FAIL] - {app} failed to validate") | ||
print(f"Failure validating app {app}:\n{errors}", file=sys.stderr) | ||
failed = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
failed = True | |
return False |
else: | ||
print(f"[PASS] - {app} validated") | ||
|
||
return failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return failed | |
return True |
""" | ||
|
||
print("\n\n[INFO] - Checking rose metadata sections\n\n") | ||
failed = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
failed = False |
f"Failure running rose metata-check on {section}:\n{result.stderr}", | ||
file=sys.stderr, | ||
) | ||
failed = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
failed = True | |
return False |
else: | ||
print(f"[PASS] - {section} validated") | ||
|
||
return failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return failed | |
return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some suggestions for the return values, I found returning a variable named failures
with boolean confusing so suggestions should just return True
or False
.
Other than that all looks good.
Co-authored-by: Cameron Bateman <[email protected]>
Thanks Cameron, I've committed the bottom suggestion which is a good shout. I've not done the other ones. The reason for storing the state in the variable is it lets us run the test for all apps before raising an error, so we find all the issues immediately rather than fixing one and running again |
Description
Summary
Refactor validate_rose_meta.py and move it to SimSys_Scripts. The script will now automatically find metadata sections and apps to validate (ignoring a list of exceptions) rather than only testing based on a hardcoded list. This was done previously and meant that new metadata sections were regularly not tested.
Coordinated merge
This ticket needs to be committed before:
LFRic Apps #954
LFRic Core #4666
Checklist