-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add partially auto-generated test file schema
To generate dataclasses in generated/galaxy from xsd: ``` pip install 'xsdata[cli]' cd lib/galaxy/tool_util/schemas xsdata ../xsd/galaxy.xsd --unnest-classes --kw-only --docstring-style Accessible --ignore-patterns --max-line-length 10000 ``` Fix up tool test schema for workflow particularities (and xsdata odditites) ``` python postprocess_schema.py ``` To generate json schema (requires pydantic 2.0 to deal with recursive data classes): ``` python test_file_from_xsd.py > test_file_schema.json ``` To validate a workflow test file with check-jsonschema ``` check-jsonschema --traceback-mode full --schemafile test_file_schema.json sra-manifest-to-concatenated-fastqs-tests.yml ``` TODO: - jobs is not modeled - element / element_tests needs work - special handling for primitive workflow parameter output values - de-RST-ify description fields
- Loading branch information
Showing
7 changed files
with
9,785 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Config xmlns="http://pypi.org/project/xsdata" version="23.6"> | ||
<Extensions> | ||
<Extension type="class" class=".*" import=".config.BaseSetting" prepend="false" applyIfDerived="true"/> | ||
</Extensions> | ||
</Config> |
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,305 @@ | ||
from generated.galaxy import ( | ||
Action, | ||
Actions, | ||
ActionsConditional, | ||
ActionsConditionalFilter, | ||
ActionsConditionalFilterType, | ||
ActionsConditionalWhen, | ||
ActionsOption, | ||
ActionsOptionType, | ||
ActionType, | ||
AssertAttributeIs, | ||
AssertAttributeMatches, | ||
AssertElementText, | ||
AssertElementTextIs, | ||
AssertElementTextMatches, | ||
AssertHasArchiveMember, | ||
AssertHasElementWithPath, | ||
AssertHasH5Attribute, | ||
AssertHasH5Keys, | ||
AssertHasJsonPropertyWithText, | ||
AssertHasJsonPropertyWithValue, | ||
AssertHasLine, | ||
AssertHasLineMatching, | ||
AssertHasNcolumns, | ||
AssertHasNelementsWithPath, | ||
AssertHasNlines, | ||
AssertHasSize, | ||
AssertHasText, | ||
AssertHasTextMatching, | ||
AssertIsValidXml, | ||
AssertNotHasText, | ||
AssertXmlelement, | ||
ChangeFormat, | ||
ChangeFormatWhen, | ||
Citation, | ||
Citations, | ||
CitationType, | ||
Code, | ||
CodeHook, | ||
Column, | ||
Command, | ||
CompareType, | ||
Conditional, | ||
ConditionalWhen, | ||
ConfigFile, | ||
ConfigFiles, | ||
ConfigFileSources, | ||
ConfigInputs, | ||
Container, | ||
ContainerType, | ||
Creator, | ||
DetectErrorType, | ||
DisplayType, | ||
EdamOperations, | ||
EdamTopics, | ||
EntryPoint, | ||
EntryPointPort, | ||
EntryPoints, | ||
EntryPointUrl, | ||
EnvironmentVariable, | ||
EnvironmentVariableInject, | ||
EnvironmentVariables, | ||
ExitCode, | ||
Expression, | ||
ExpressionType, | ||
Filter, | ||
FilterType, | ||
HierarchyType, | ||
Inputs, | ||
InputType, | ||
LevelType, | ||
Macros, | ||
MethodType, | ||
Options, | ||
Organization, | ||
Output, | ||
OutputCollection, | ||
OutputCollectionDiscoverDatasets, | ||
OutputData, | ||
OutputDiscoverDatasets, | ||
Outputs, | ||
Parallelism, | ||
Param, | ||
ParamConversion, | ||
ParamDefault, | ||
ParamDefaultCollection, | ||
ParamDefaultElement, | ||
ParamDrillDownOption, | ||
ParamOptions, | ||
ParamSelectOption, | ||
ParamType, | ||
PermissiveBooleanValue, | ||
Person, | ||
Regex, | ||
Repeat, | ||
RequestParameter, | ||
RequestParameterAppend, | ||
RequestParameterAppendValue, | ||
RequestParameterGalaxyNameType, | ||
RequestParameterTranslation, | ||
RequestParameterValueTranslation, | ||
RequestParameterValueTranslationValue, | ||
RequiredFileExclude, | ||
RequiredFileInclude, | ||
RequiredFileReferenceType, | ||
RequiredFiles, | ||
Requirement, | ||
Requirements, | ||
RequirementType, | ||
Resource, | ||
ResourceType, | ||
Sanitizer, | ||
SanitizerMapping, | ||
SanitizerMappingAdd, | ||
SanitizerMappingRemove, | ||
SanitizerValid, | ||
SanitizerValidAdd, | ||
SanitizerValidRemove, | ||
Section, | ||
SourceType, | ||
Stdio, | ||
TargetType, | ||
Test, | ||
TestAssertions, | ||
TestCollection, | ||
TestCompositeData, | ||
TestConditional, | ||
TestDiscoveredDataset, | ||
TestExtraFile, | ||
TestOutput, | ||
TestOutputCollection, | ||
TestOutputCompareType, | ||
TestOutputMetadata, | ||
TestParam, | ||
TestParamMetadata, | ||
TestRepeat, | ||
Tests, | ||
TestSection, | ||
Tool, | ||
ToolAction, | ||
ToolTypeType, | ||
TracksterAction, | ||
TracksterConf, | ||
Uihints, | ||
UrlmethodType, | ||
Validator, | ||
ValidatorType, | ||
VersionCommand, | ||
Xref, | ||
Xrefs, | ||
XrefType, | ||
) | ||
|
||
__all__ = [ | ||
"Action", | ||
"ActionType", | ||
"Actions", | ||
"ActionsConditional", | ||
"ActionsConditionalFilter", | ||
"ActionsConditionalFilterType", | ||
"ActionsConditionalWhen", | ||
"ActionsOption", | ||
"ActionsOptionType", | ||
"AssertAttributeIs", | ||
"AssertAttributeMatches", | ||
"AssertElementText", | ||
"AssertElementTextIs", | ||
"AssertElementTextMatches", | ||
"AssertHasArchiveMember", | ||
"AssertHasElementWithPath", | ||
"AssertHasH5Attribute", | ||
"AssertHasH5Keys", | ||
"AssertHasJsonPropertyWithText", | ||
"AssertHasJsonPropertyWithValue", | ||
"AssertHasLine", | ||
"AssertHasLineMatching", | ||
"AssertHasNcolumns", | ||
"AssertHasNelementsWithPath", | ||
"AssertHasNlines", | ||
"AssertHasSize", | ||
"AssertHasText", | ||
"AssertHasTextMatching", | ||
"AssertIsValidXml", | ||
"AssertNotHasText", | ||
"AssertXmlelement", | ||
"ChangeFormat", | ||
"ChangeFormatWhen", | ||
"Citation", | ||
"CitationType", | ||
"Citations", | ||
"Code", | ||
"CodeHook", | ||
"Column", | ||
"Command", | ||
"CompareType", | ||
"Conditional", | ||
"ConditionalWhen", | ||
"ConfigFile", | ||
"ConfigFileSources", | ||
"ConfigFiles", | ||
"ConfigInputs", | ||
"Container", | ||
"ContainerType", | ||
"Creator", | ||
"DetectErrorType", | ||
"DisplayType", | ||
"EdamOperations", | ||
"EdamTopics", | ||
"EntryPoint", | ||
"EntryPointPort", | ||
"EntryPointUrl", | ||
"EntryPoints", | ||
"EnvironmentVariable", | ||
"EnvironmentVariableInject", | ||
"EnvironmentVariables", | ||
"ExitCode", | ||
"Expression", | ||
"ExpressionType", | ||
"Filter", | ||
"FilterType", | ||
"HierarchyType", | ||
"InputType", | ||
"Inputs", | ||
"LevelType", | ||
"Macros", | ||
"MethodType", | ||
"Options", | ||
"Organization", | ||
"Output", | ||
"OutputCollection", | ||
"OutputCollectionDiscoverDatasets", | ||
"OutputData", | ||
"OutputDiscoverDatasets", | ||
"Outputs", | ||
"Parallelism", | ||
"Param", | ||
"ParamConversion", | ||
"ParamDefault", | ||
"ParamDefaultCollection", | ||
"ParamDefaultElement", | ||
"ParamDrillDownOption", | ||
"ParamOptions", | ||
"ParamSelectOption", | ||
"ParamType", | ||
"PermissiveBooleanValue", | ||
"Person", | ||
"Regex", | ||
"Repeat", | ||
"RequestParameter", | ||
"RequestParameterAppend", | ||
"RequestParameterAppendValue", | ||
"RequestParameterGalaxyNameType", | ||
"RequestParameterTranslation", | ||
"RequestParameterValueTranslation", | ||
"RequestParameterValueTranslationValue", | ||
"RequiredFileExclude", | ||
"RequiredFileInclude", | ||
"RequiredFileReferenceType", | ||
"RequiredFiles", | ||
"Requirement", | ||
"RequirementType", | ||
"Requirements", | ||
"Resource", | ||
"ResourceType", | ||
"Sanitizer", | ||
"SanitizerMapping", | ||
"SanitizerMappingAdd", | ||
"SanitizerMappingRemove", | ||
"SanitizerValid", | ||
"SanitizerValidAdd", | ||
"SanitizerValidRemove", | ||
"Section", | ||
"SourceType", | ||
"Stdio", | ||
"TargetType", | ||
"Test", | ||
"TestAssertions", | ||
"TestCollection", | ||
"TestCompositeData", | ||
"TestConditional", | ||
"TestDiscoveredDataset", | ||
"TestExtraFile", | ||
"TestOutput", | ||
"TestOutputCollection", | ||
"TestOutputCompareType", | ||
"TestOutputMetadata", | ||
"TestParam", | ||
"TestParamMetadata", | ||
"TestRepeat", | ||
"TestSection", | ||
"Tests", | ||
"ToolAction", | ||
"ToolTypeType", | ||
"TracksterAction", | ||
"TracksterConf", | ||
"Uihints", | ||
"UrlmethodType", | ||
"Validator", | ||
"ValidatorType", | ||
"VersionCommand", | ||
"Tool", | ||
"Xref", | ||
"XrefType", | ||
"Xrefs", | ||
] |
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,12 @@ | ||
from pydantic import ConfigDict | ||
|
||
alias_lookup = { | ||
"assert_contents": "asserts", | ||
"element": "element_tests", | ||
} | ||
|
||
|
||
class BaseSetting: | ||
__pydantic_config__ = ConfigDict( | ||
extra="forbid", alias_generator=lambda field_name: alias_lookup.get(field_name, field_name) | ||
) |
Oops, something went wrong.