Externally Executable Tool Tests#5545
Conversation
ebea680 to
b565834
Compare
d5d63b4 to
d603baf
Compare
|
|
||
| # If a tool shed tool, try to find where the repository was installed. Is there a cleaner way | ||
| # to do this @mvdbeek? | ||
| if hasattr(self, 'tool_shed') and self.tool_shed: |
There was a problem hiding this comment.
@mvdbeek Does this piece of code to find a shed tool's test-data directory from inside of Galaxy make sense to you? In particular is there a better way to recover what I am calling repository_dir here - the test-data stuff a little bit lower is Greg code from the test framework so I assume that is right.
There was a problem hiding this comment.
Hmm, I'm probably missing something here, but shouldn't the test-data dir live always next to self.tool_dir ?
I'm not sure why we need to walk up to the repository_dir to descend down again to find test-data ?
There was a problem hiding this comment.
So this is code stolen from the previous method of resolving tool shed test data - https://github.com/galaxyproject/galaxy/blob/dev/test/base/tool_shed_util.py#L25. I guess there is descended from the repository directory in case the test-data was found next to a tool installed below the repository top of the repository:
repo/
- mytools/
- tool1_1.xml
- tool1_2.xml
- test-data/
In that case though you are right the test-data would still live next to the tool. My thought was that it would be good to move to the top of the directory in case tools are stored in directories below the top-level but the test-data is stored at the top-level. Repositories like this:
repo/
- README.txt
- test-data/
- mytools1/
- tool1_1.xml
- tool1_2.xml
- mytools2/
- tool2_1.xml
That seems like a reasonable repository layout for a repository with a lot of tools - I don't know though. What do you think? I'm perfectly willing to just let IUC declare that test-data needs to be right next to the tool in the repository bundle for this to work - that is fine to me.
There was a problem hiding this comment.
I see, does this alternative layout work with planemo ? If it doesn't I'd assume it's not a very common layout, in which case we could perhaps first check if filename exists in self.tool_dir before doing something more complicated.
wrt repository_dir we've got this:
galaxy/lib/galaxy/model/tool_shed_install/__init__.py
Lines 294 to 301 in a2b8e44
I'm not sure the logic of relying on
self.installed_changeset_revision will work in all cases (Could perhaps explain a subset of help images missing every now and then?!)
There was a problem hiding this comment.
https://github.com/galaxyproject/planemo/blob/master/planemo/galaxy/config.py#L999
Planemo would allow use of both the pwd and the tool directory if they are different. So I think I imagined it working this way previously. Also --test-data is configurable on the command-line for testing and can be placed where ever in the suite using .shed.yml. Happy to call it unnecessary complex though.
There was a problem hiding this comment.
Alright, that makes sense. I don't think it's too complex, this offers some nice flexibility.
d603baf to
628a90b
Compare
|
Will test tomorrow against freiburg. This is exciting. Will help validate all the tools we installed via https://github.com/usegalaxy-eu/usegalaxy-eu-tools/ after starting jenkins jobs for that yesterday. |
|
@erasche That script doesn't produce xunit or anything yet - just runs one test and produces an exit code (and Python exception if the test fails) - I hope to build the reporting and aggregation half of the puzzle into Planemo I think which does produce nice XUnit and HTML reports already. You may want to wait for that before putting this into production - up to you. |
|
No xunit is fine for now, just happy to have some evidence that all the tools we've installed are functional (and happy to be able to provide some more testing of this.) |
lib/galaxy/tools/__init__.py
Outdated
| # Eventually we should find a directory named self.changeset_revision | ||
| # but just in case we don't (differences between self.installed_changeset and self.changeset_revision) | ||
| # check for repository name also. | ||
| if repository_dir_name == self.changeset_revision or repository_dir_name == self.repository_name: |
There was a problem hiding this comment.
The directory named self.repository_name should come first, judging by my disk layout: ~/src/shed_tools/toolshed.g2.bx.psu.edu/repos/iuc/minimap2/4070f129540a/minimap2
If that's good enough I wouldn't bother checking for self.changeset_revision(and adjust the comment).
There was a problem hiding this comment.
Okay - I'll make this revision. Thanks!
0177eb4 to
35eb206
Compare
This work is focused on "test" and "run" commands for Galaxy tools and workflows, though it should enable other combinations of artifacts and commands such as serving workflows and various CWL artifact operations against that fork of Galaxy. The tool piece of this requires an unreleased version of galaxy-lib (galaxyproject/galaxy-lib#91) and unmerged Galaxy modifications to expose a APIs for external tool testing (galaxyproject/galaxy#5545). Workflows are oddly enough likely closer to working with this WIP. Implements galaxyproject#592. Implements galaxyproject#508.
Can be shared between tests and TDTs. A step toward not requiring one to load the tool to test the tool (important for external testing of tools).
Should enable greater reuse from outside the test framework (e.g. standalone scripts and Planemo).
Working toward making interactor stand-alone and independent of the test framework.
This gets us a lot closer to being able to construct a ToolTestBuilder from simple dictionaries generated from the API for instance or from any tool really.
Use this is in tool testing. Prevents needing to load / have tools in memory to run tool tests - should allow external tool testing.
Previously this was set in the test framework but that doesn't help running Galaxies.
Based on conversations with @mvdbeek on https://github.com/galaxyproject/galaxy/pull/5545/files.
Capture more information about the test.
35eb206 to
bb075a6
Compare
bb075a6 to
dbfde96
Compare
This work is focused on "test" and "run" commands for Galaxy tools and workflows, though it should enable other combinations of artifacts and commands such as serving workflows and various CWL artifact operations against that fork of Galaxy. The tool piece of this requires an unreleased version of galaxy-lib (galaxyproject/galaxy-lib#91) and unmerged Galaxy modifications to expose a APIs for external tool testing (galaxyproject/galaxy#5545). Workflows are oddly enough likely closer to working with this WIP. Implements galaxyproject#592. Implements galaxyproject#508.
This work is focused on "test" and "run" commands for Galaxy tools and workflows, though it should enable other combinations of artifacts and commands such as serving workflows and various CWL artifact operations against that fork of Galaxy. The tool piece of this requires an unreleased version of galaxy-lib (galaxyproject/galaxy-lib#91) and unmerged Galaxy modifications to expose a APIs for external tool testing (galaxyproject/galaxy#5545). Workflows are oddly enough likely closer to working with this WIP. Implements galaxyproject#592. Implements galaxyproject#508.
At a high-level this PR adds API and library (galaxy-lib) functionality to allow tool tests to be executed from outside the test framework. A wrapper around the galaxy-lib script has been placed in
scripts/for easy usage from Galaxy's git directory.Many years ago and prior to the tool shed and the API,
GALAXY_TEST_EXTERNALcould be used to replicate this and run tool tests against a running Galaxy but it would require the tool test framework to load the same toolbox in memory as running on the remote server. While I believe this modality should be fixed (GALAXY_TEST_EXTERNALworks for various other tests and should work for tool tests again now) this new approach is API driven and does not require the tool testing client to load Galaxy tools or toolbox into memory. This allows tests to be driven from outside of Galaxy's test framework and outside of Galaxy all together (from galaxy-lib for example - and hopefully eventually Planemo for the added goodies it provides).More details about this PR:
Adds a new internal abstraction and API for determining test data paths for tools. This is now used by the TDT and for tool testing functionality. This should fix bugs in the TDT webhook related to how it finds test data - in particular the tool shed code to find test-data directories is now unified across approaches and correct for the TDT.
This API also allows eliminating various conditional paths through the test framework that used to hold onto tool shed data that is now resolved at runtime by Galaxy.
Adds a tool API endpoint to provide summary information for all tools. This is used to generate test cases in the test framework.
Adds an API endpoint for fetch descriptions of test data for particular tools. This is marked as experimental because I'm not super happy with how the internal data structures mapped to JSON.
Add a test case for installing a tool from the tool shed and then executing a tool test against it (huge thanks to @mvdbeek for taking care of the basics of setting up this integration - I've refactored his data manager test code to implement 96% this test).
xref galaxyproject/ephemeris#76
xref #5474