galaxy icon indicating copy to clipboard operation
galaxy copied to clipboard

add test case verifying misread issue #11291

Open bernt-matthias opened this issue 4 years ago • 0 comments

I misread https://github.com/galaxyproject/galaxy/issues/11291 .. actually missing the point that its about empty collections .. and tried to add a test case that submits a tool with a mandatory data parameter without specifying a dataset for this parameter in the test.

What is happening is that Galaxy selects input data sets automatically. Certainly this can be an advantage if only one fitting data set is available for an input (and it is the data set that the user wants to submit .. ). But in other instances it may be annoying. An example is if you start a number of uploads then the input is updated with each finished upload that fits.

Main question is, if this is a bug.

The PR so far adds two tests https://github.com/galaxyproject/galaxy/issues/11291

  • multi_data_mandatory
    • the test shows that it works in principle
  • multi_data_param
    • the 4th test shows that the problem occurs if there is any dataset in the history (debugging shows that f2 is automatically filled with the last added history element)
    • uncommenting the f2 line in the 4th test also shows that f2 is submitted with a zip file of the test data folder which is odd / undocumented
    • the 5th test actually checks the max attribute of f1 .. at least this may be useful

The trace leading to the observed behavior is:

  • Tool.handle_input https://github.com/galaxyproject/galaxy/blob/41ed9d5c28f4d385edf6dfed570759818fde13ad/lib/galaxy/tools/init.py#L1666
  • Tool.expand_incoming https://github.com/galaxyproject/galaxy/blob/41ed9d5c28f4d385edf6dfed570759818fde13ad/lib/galaxy/tools/init.py#L1613
  • populate_state -> _populate_state_legacy https://github.com/galaxyproject/galaxy/blob/41ed9d5c28f4d385edf6dfed570759818fde13ad/lib/galaxy/tools/parameters/init.py#L405 gets an initial value for each parameter via
  • BaseDataToolParameter.get_initial_value https://github.com/galaxyproject/galaxy/blob/41ed9d5c28f4d385edf6dfed570759818fde13ad/lib/galaxy/tools/parameters/basic.py#L1719

the last function sets a default value for each non optional parameter.

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.
  • [ ] Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • [x] I agree to license these contributions under Galaxy's current license.
  • [x] I agree to allow the Galaxy committers to license these and all my past contributions to the core galaxy codebase under the MIT license. If this condition is an issue, uncheck and just let us know why with an e-mail to [email protected].

bernt-matthias avatar Sep 02 '21 14:09 bernt-matthias