Commit Graph
41 Commits
Author SHA1 Message Date
John Chilton 44f7317fa5 Allow tools to output collections with static or determinable structure.
By "static" I mean tools such as a FASTQ de-interlacer that would produce a "paired" collection with two datasets everytime. By "determinable" I mean tools that perform N->N operations within the same job - such as a tool that needs to normalize a bunch of datasets all at once and not in separate jobs. (For N->N collection operations that should or can be done in N separate jobs tool authors should just write tools that operate over a dataset and produce a dataset and let the end-user 'map over' that operation.)

There are still large classes of operations where the structure of the output collection cannot be pre-determined - such as splitting files (e.g. bam files by read group) - that are not implemented in this commit.

Model:

The models have been updated to do a more thorough job of tracking collection outputs. Jobs just producing HistoryDatasetCollectionAssociations works fine for simple jobs producing collections - but you don't want to map a list over a tool that produces a pair and produce a bunch of pairs HDCAs and a list:pair HDCA- you just want a bunch of pieces and the one list:pair at that the top.

Workflow:

Workflows containing such operations can be executed - but the workflow editor has not been updated to handle this complexity (and it will require a significant overhaul) so such tools are not available in the workflow editor.

Tool Testing:

This commit also introduces a new tool XML syntax for describing tests on output collections. See files test/functional/tools/collection_creates_list.xml and test/functional/tools/collection_creates_pair.xml for examples.

Tests:

Includes two tools to test this - one that uses explicit pair output names and one that iterates over the structure of input list to produce an output list.

Includes several new tools API tests that test the tools described above via the API and implicit mapping over such tools. Includes two new workflow API tests - one that verifies a simple workflow with output collections works and one that verifies mapping over workflow steps in collections works.
2015-01-15 09:30:00 -05:00
John Chilton ec24396140 Refactoring: Start abstracting XML processing out of Tool and param classes.
Long term this could allow Galaxy to support - multiple tooling formats (Galaxy-like YAML, CWL http://bit.ly/cwltooldesc, etc...). But I think it is also important from a purely design perspective - this is a core logic class integrating different components - they should not also be doing XML parsing.

To verify the interface for parsing tools is expressive enough to allow multiple useful implementations, I built a test YAML tool description that implements many of the same features as Galaxy but smooths out rough edges (uses exit codes for job failure by default for instance). Loading these tools is disabled by default and it is not documented how to enable them because they are not intended to be part of Galaxy's public API.
2014-12-11 00:26:13 -05:00
John Chilton 887bc44a41 Implement structured tool test data.
Rather than relying solely on exceptions back to nose/test framework - add option (--structured_data_report_file) to run_tests.sh that causes a bunch of detailed data to be dumped to the specified file in a very structured way. Includes full to_dict of the job from the API which in turn includes job metrics, command-line, job's standard error and outputs (instead of the test frameworks), as well as the tool inputs, and exceptions broken out for tool execution versus output checking.

Its all indexed in the file by the test id (without the actual test toolbox depending on knowing the test id) - so one could pair this information with the XUnit output to produce much more detailed breakdowns of the tests.
2014-12-08 00:21:47 -05:00
John Chilton 76b534f438 Slightly improved error message for tool tests if job submission fails. 2014-12-08 00:21:47 -05:00
John Chilton 3d779623b7 Twill interactor for tests is broken - so I am deleting.
It wasn't long for this world with a JavaScript tool form anyway - would be nice to implement a casperjs driven interactor though so the UI could be exercised for tests.
2014-12-05 23:35:44 -05:00
John Chilton 02fb0bae3b Break up a couple test methods for reuse downstream.
Remove duplication related to verifying a single dataset in tests - allows reuse in downstream when verifying the content of explicitly defined tool output collections.

Refactor out waiting for jobs - seems wrong place to put that logic this should allow easier moving.
2014-12-01 21:18:56 -05:00
John Chilton 421ee93140 Rearrange verify method to make duplication more obvious. 2014-12-01 21:18:56 -05:00
John Chilton 4cdbd53a5a Rename variable for clarity.
This method does not just return datasets.
2014-12-01 21:18:56 -05:00
John Chilton 8bdcab103e Remove unused code. 2014-11-19 12:46:56 -05:00
John Chilton c97fd47654 Bug fix for 21e3d69. 2014-11-19 12:42:17 -05:00
John Chilton 08a93fe039 Remove unused code. 2014-11-19 12:42:17 -05:00
Dave Bouvier 4e9850b3d2 Fix getting job streams in functional tests. 2014-10-24 16:23:18 -04:00
Dave Bouvier bb3c895e51 Add optional display of stdout/stderr to the jobs API return value, defaulting to not displayed. Rework the test API interactor to wait for jobs instead of histories and get the stdout and stderr from the API. 2014-10-23 10:34:17 -04:00
John Chilton d36ab8e22a Add ability to disable asynchronous data uploads in tool tests.
Honestly - need to find a way to make this the default if sqlite is the target.
2014-10-14 15:25:55 -04:00
John Chilton e58d1d9c8a Remove abstraction around requests now that it is a required dependency. 2014-09-04 20:34:52 -04:00
John Chilton c1ee4c9b31 Add functional test tool demonstrating output filters.
Add new 'expect_num_outputs' attribute to 'test' element in tool XML to verify the produced number - needed to test output filtering.
2014-09-03 08:43:25 -04:00
John Chilton 22819d88ce API tests for authenticate and some of users endpoints. 2014-08-04 21:45:02 -04:00
John Chilton 0af30153ee Fix API test interactor to use unique usernames.
Should fixes API tests broken when validation of these changed recently.
2014-07-25 08:42:36 -05:00
Dave Bouvier 2e893a17eb Fix display of job stdio when using the twill interactor. 2014-07-15 16:30:35 -04:00
Dave Bouvier 670d73bdea Revert change that ended up breaking display of job stdio in functional tests. 2014-06-12 13:40:04 -04:00
Dave Bouvier 8dbc18a56f Fix for retrieving job streams with the twill interactor. 2014-05-12 16:27:49 -04:00
Dave Bouvier f4386d60ab Clean up twilltestcase.py, fix functional tests for tools with spaces in the tool ID. 2014-05-09 09:57:26 -04:00
John Chilton f42d97fef3 Dataset collections - tool parameters - allow tool tests.
With example tool tests demonstrating some basic features available to cheetah for data_collection parameters.
2014-05-06 08:54:30 -05:00
John Chilton ddcad1582c Merged in jmchilton/galaxy-central-fork-1 (pull request #356)
Enhancements for Runtime Discovered (Collected Primary) Datasets
2014-05-06 08:13:29 -05:00
John Chilton 2bda90ec6c Add option test system environment option GALAXY_TEST_VERBOSE_ERRORS to report on dataset errors.
Implemented a while ago to aid debugging but disabled by default because it can cause sqlite locking errors. It can now be enabled as needed using GALAXY_TEST_VERBOSE_ERRORS.
2014-04-18 08:41:59 -05:00
John Chilton 2782a29fdc Allow tools to test runtime discovered datasets. 2014-03-29 17:11:17 -05:00
John Chilton c02c19011a Force use of requests in API tests, eliminate hacked together compatibility layer. 2014-03-20 10:43:57 -05:00
John Chilton 8d1b6a8c74 Check ftype attribute (if defined) on test output datasets.
Only works for newer API driven tests.
2014-03-14 10:12:41 -05:00
John Chilton a18dbc0a07 Initial work on test cases for history contents API. 2014-02-27 18:06:36 -06:00
John Chilton 9a06cdd454 Fix mock-requests PUT action.
Should fix failing history import/export test on buildbot server that doesn't have requests dependency available.
2014-02-20 15:28:06 -06:00
John Chilton b42e2c1e2c Improved jobs testing.
Fix bug in buildbot related to differences between local handling of list/tuple parameters and requests handling (I mostly use requests locally, but buildbot doesn't have it available). Add test that fails without @kellrott's pull request #314 (and in turn verifies it fixes a problem).
2014-01-30 22:44:10 -06:00
John Chilton 2ac58018d5 Eliminate interactor dependency on deprecated global variable.
Lessens the need to import things in a specific order - as long as database context is run before interactor methods everything should be fine now. TODO: Eliminate rest of dependencies on this variable.
2014-01-10 08:45:36 -06:00
John Chilton 22963027d9 Flush out API interactor...
... this will enable functional testing of API.
2014-01-10 08:45:36 -06:00
Dannon Baker 559ecb4ec8 Remove dependency on simplejson; convert everything over to using the json module in the python standard library. 2014-01-10 07:29:05 -05:00
John Chilton 4ae032181a Disable extra verbose logging with API interactor on test errors.
It is useful but seems to cause sqlite locking errors.
2013-12-07 08:38:30 -06:00
John Chilton 79c8f59341 Models: Introduce real class for app.model (ModelMapping).
Shared across Tool Shed and Galaxy to reduce code duplication. Previously this was just a bunch, making it a real class allows placing some shared logic in there.

This refactoring also eliminates some global variables galaxy.model.mapping.Session, galaxy.model.mapping.context, and same for tool shed. This may break things, but these are things that should probably be fixed anyway.

In particular small changes to db_shell.py and a unit test that depended on these global variables have been updated. The functional test frameworks likewise needed to be updated to not depend on these - these changes were more substantial.

To fix these functional tests, I essentially replace old references to global variables in Galaxy with references to global variables just defined in the test framework in test/functional/database_contexts.py (a slight improvement).
2013-12-05 00:20:54 -06:00
John Chilton 9e8a32c460 Extend tools API to allow use of data params with multiple='true' with multiple values.
Likewise extend API driven tool testing framework to support these, add sample test cases.

Also fixup english on a log warning.
2013-11-22 02:09:28 -06:00
John Chilton 150b5aa49e API Driven Tests: Option for very detailed per dataset error messages for when histories error out. 2013-11-21 19:17:13 -06:00
John Chilton 9dc1c1d3bc Fix for using API driver with tool outputs that change their name.
E.g. composite data types. API should probably return the original output name since that is the purpose of the parameter but I am not sure how much work that would be.
2013-11-21 19:17:13 -06:00
John Chilton 79458d0d0b Further refactoring for iteractors for reuse. 2013-11-21 19:17:13 -06:00
John Chilton edc88f8aaf Refactor interactors out of test_toolbox into base.
For potential reuse in other tests.
2013-11-21 19:17:13 -06:00