forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request galaxyproject#18884 from jmchilton/test_format
Implement Pydantic model for workflow test format.
- Loading branch information
Showing
20 changed files
with
1,076 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env python | ||
|
||
import argparse | ||
import sys | ||
|
||
import yaml | ||
|
||
from galaxy.tool_util.models import Tests | ||
|
||
DESCRIPTION = """ | ||
A small utility to verify the Planemo test format. | ||
This script doesn't use semantic information about tools or workflows so only | ||
the structure of the file is checked and things like inputs matching up is not | ||
included. | ||
""" | ||
|
||
|
||
def validate_test_file(test_file: str) -> None: | ||
with open(test_file) as f: | ||
json = yaml.safe_load(f) | ||
Tests.model_validate(json) | ||
|
||
|
||
def arg_parser() -> argparse.ArgumentParser: | ||
parser = argparse.ArgumentParser(description=DESCRIPTION) | ||
parser.add_argument("test_file") | ||
return parser | ||
|
||
|
||
def main(argv=None) -> None: | ||
if argv is None: | ||
argv = sys.argv[1:] | ||
|
||
args = arg_parser().parse_args(argv) | ||
validate_test_file(args.test_file) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.