Skip to content
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

Improvements to parameter models for test case inputs #18743

Merged

Conversation

jmchilton
Copy link
Member

As I mentioned in the discussion on #18679, the inputs for the parameter models developed there for test case inputs were a bit arbitrary. While useful for validation in that context - when I went to go use them in developing the tool request API it was clear that aligning them with the tool request syntax would be useful and rather than adding another layer and another version of the models I just reworked the existing ones. I also mentioned there I wanted to develop a set of models for YAML test descriptions that could be used with tool APIs a lot more directly. So this PR translates the test case validation intermediate format to just be YAML format and adds more specific tests and models for that.

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@jmchilton jmchilton added kind/enhancement kind/refactoring cleanup or refactoring of existing code, no functional changes area/tool-framework labels Aug 27, 2024
@jmchilton jmchilton force-pushed the parameter_models_rework_test_case_xml branch 2 times, most recently from 8fead2b to 0d61d7d Compare August 27, 2024 17:16
@jmchilton jmchilton force-pushed the parameter_models_rework_test_case_xml branch from 0d61d7d to fd4b182 Compare August 27, 2024 23:02
@jmchilton jmchilton marked this pull request as ready for review August 28, 2024 14:20
@github-actions github-actions bot added this to the 24.2 milestone Aug 28, 2024
@jmchilton jmchilton requested a review from a team September 17, 2024 15:30
cast(XmlTestCollectionDefDict, test_input.get("attributes", {}).get("collection"))
).test_format_to_dict()
elif isinstance(tool_input, (DataParameterModel,)):
data_tool_input = cast(DataParameterModel, tool_input)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this cast necessary ? mypy has no problems with this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not know that - good to know. I think I've gotten in the habit of doing that with parameters because I so often am dispatching on the parameter_type string maybe. I think it kind of reads better this way but I will admit it is more code. I will defer to you and remove the casts in my working branch if you'd like.

@jmchilton jmchilton merged commit 0863221 into galaxyproject:dev Sep 19, 2024
51 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tool-framework kind/enhancement kind/refactoring cleanup or refactoring of existing code, no functional changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants