Skip to content

Add command to upgrade tests to comply with profile 24.2 validation #278

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

Merged
merged 22 commits into from
Apr 12, 2025

Conversation

davelopez
Copy link
Collaborator

@davelopez davelopez commented Apr 9, 2025

Closes #277

This pull request adds a new command (by default, the keybinding is ctrl+alt+u) to update test cases to the new validation requirement for tool tests introduced in Galaxy 24.2 and planemo.

A bit of context

Suppose we have a tool whose inputs section looks as follows:

<inputs>
    <conditional name="c1">
        <param name="c1_action" type="select">
            <option value="a1" selected="True">A 1</option>
            <option value="a2">A 2</option>
        </param>
        <when value="a1">
            <param name="c1_a1_p1" type="text"/>
            <repeat name="rep1" title="Sample repeat">
                <param name="rep1_p1" type="text"/>
            </repeat>
        </when>
        <when value="a2">
            <param name="c1_a2_p1" type="text"/>
            <section name="int" title="Integer Section" expanded="true">
                <param name="int_test" value="1" type="integer"/>
            </section>
        </when>
    </conditional>
</inputs>

And then we have a test in out tests section declaring params in the following way:

<test>
    <param name="c1_action" value="a1"/>
    <param name="c1_a1_p1" value="A 1"/>
    <param name="rep1_p1" value="r"/>
    <output name="out1">
        <assert_contents>
            <has_text text="a1"/>
        </assert_contents>
    </output>
</test>

In this case, the tool linting will complain with the following warnings:

Test 1: failed to validate test parameters against inputs - tests won't run on a modern Galaxy tool profile version. Validation errors are [Invalid parameter name found c1_action]

How it works

You can now run the extension command using the default key shortcut ctrl+alt+u, or search for it in the command palette as shown in the following video:

UpdateToolTests.mp4

The command will try to rewrite the params in the test cases to comply with the 24.2 validation profile.

@davelopez davelopez added enhancement New feature or request language server Related to the language server labels Apr 9, 2025
@davelopez davelopez marked this pull request as draft April 9, 2025 15:54
@davelopez davelopez marked this pull request as ready for review April 11, 2025 18:12
@davelopez davelopez added this to the v0.14.0 milestone Apr 11, 2025
@davelopez davelopez merged commit 5773b3a into main Apr 12, 2025
7 checks passed
@davelopez davelopez deleted the upgrade_tests_profile_command branch April 12, 2025 08:02
@davelopez davelopez changed the title Add command to upgrade tests to profile 24.2 Add command to upgrade tests to comply with profile 24.2 validation Apr 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request language server Related to the language server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-Restructure test cases to comply with 24.2
1 participant