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

[22.01] Fix UnboundLocalError in sort collection tool #13429

Merged

Conversation

davelopez
Copy link
Contributor

Should fix #13302

I tried to add a test to the Sort Collection tool like:

<test expect_failure="true">
    <!-- test invalid sort_type-->
    <param name="input">
        <collection type="list">
            <element name="element_1" value="simple_line_alternative.txt"/>
            <element name="element_2" value="simple_line.txt"/>
        </collection>
    </param>
    <param name="sort_type" value="unknown"/>
</test>

But for some reason, the test fails with Expected job to fail but Galaxy indicated the job successfully completed. Probably this is not the correct way of testing the wrong parameter?

Bonus Points

Also fixes an error message text with swapped placeholders.

How to test the changes?

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

License

@github-actions github-actions bot added this to the 22.05 milestone Feb 22, 2022
@davelopez davelopez linked an issue Feb 22, 2022 that may be closed by this pull request
Copy link
Member

@jdavcs jdavcs left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@jmchilton jmchilton left a comment

Choose a reason for hiding this comment

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

Presumably the API is picking a default for the sort type in this testing situation that it doesn't in some other invocation of the tool. There is a bunch of testing specific magic in there unfortunately.

@davelopez
Copy link
Contributor Author

Ohh I see, that makes sense then, thank you @jmchilton and @ic4f for the review and the explanation!

@bgruening bgruening merged commit c060fd4 into galaxyproject:release_22.01 Feb 22, 2022
@davelopez davelopez deleted the fix_sort_collection_tool branch February 23, 2022 09:29
@mvdbeek mvdbeek modified the milestones: 22.05, 22.01 Mar 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crash in sorting collection with UnboundLocalError
5 participants