Commit Graph
23 Commits
Author SHA1 Message Date
John Chilton d590921b6f Add unit test for extra primary dataset collection.
Tests overridding various output properties (ext, dbkey, name, visible) with file name and galaxy.json, collecting from new_file_path versus job_working_directory, setting job output associations, and logic related to adding outputs to copied histories.
2014-03-28 18:33:03 -05:00
John Chilton ccafc2de5a Drop unit incorrect unit tests added in 410a13e and 01933aa.
Workflow run template was causing these methods to be called wrong (and has been for a LONG time), this in turn caused me to misunderstand what the spec for how other_values in tool parameters should operate when writing the tests.

The real underlying bug should be fixed with 55cf8bb.
2014-03-20 16:12:52 -05:00
John Chilton be13bd26a7 Test cases for filtering tool parameters on other parameter values.
Includes test case that is broken without JJ's contributions in pull request #343.
2014-02-28 14:49:46 -06:00
John Chilton fb9d65f76e Add test cases for need_late_validation of select parameters.
Two of these fail without JJ's work in pull request 336, additionally these verify 336 doesn't break GATK support for instance.
2014-02-28 12:42:30 -06:00
John Chilton 4f2e94251c Introduce DatasetMatcher to simplify DatasetToolParameter...
This reduces code duplication related dataset_collectors now and abstracts out important functionality I reuse further to collect dataset collections downstream.

Was originally added in 28d43f4 as DatasetParamContext and backed out of right away. I have reworked it so that it no longer breaks implicit conversion, the relevant classes and methods have less generic names, and it has a healthy set of test cases.

In addition to basic tests on matching datasets to parameters, selections, and implicit conversions - these tests include testing of dataset security inconjuction with data_destination tools as well as filtering data parameters on other data parameters.
2014-02-21 22:09:57 -06:00
John Chilton f661553201 Rearrange unit tests.
Move tests that were in tests/unit but could logically be placed into tests/unit/tools or tests/unit/jobs into these directory.
2014-02-21 22:09:57 -06:00
John Chilton ec849c3741 Unit tests for various data tool parameter handling.
Test optional datasets can be used in tool evaluation (in test_evaluation.py).

Add test_data_parameters.py which test many random DataToolParameter behaviors. Test various paths to DataToolParameter.to_python - including recently enhanced ability to use optional dataset with 'multiple=True' data parameters. Test filtering on datatypes, implicit conversion options (both existing conversions and new ones) both when building HTML forms and picking intial values for workflows. Test special handling of hidden datasets. Tests picking intial datasets when optional and without repeats when used in subsequent calls.
2014-02-21 22:09:57 -06:00
John Chilton 11eb55edff Fix Python 2.7ism in test_evaluation.py. 2014-02-21 14:57:09 -06:00
John Chilton 05d885b53f Allow ComputeEnvironment to rewrite 'arbitrary' paths.
Previous changes enabled targetted rewriting of specific kinds of paths - working directory, inputs, outputs, extra files, version path, etc.... This change allows rewriting remaining 'unstructured' paths - namely data indices.

Right now tool evaluation framework uses this capability only for SelectParameter values and fields - which is where these paths will be for data indices. Changeset lays out the recipe for doing this and the functionality could easily be extended for arbitrary parameters or other specific kinds of inputs.

The default ComputeEnvironment does not rewrite any paths obviously, but the abstract base class docstring lays out how to extend a ComputeEnvironment to do this:

    def unstructured_path_rewriter( self ):
        """ Return a function that takes in a value, determines if it is path
        to be rewritten (will be passed non-path values as well - onus is on
        this function to determine both if its input is a path and if it should
        be rewritten.)
        """

The LwrComputeEnviroment has been updated to provide such a rewriter - it will rewrite such paths, and create a dict of paths that need to be transferred, etc.... The LWR server and client side infrastructure that enables this can be found in this changeset - https://bitbucket.org/jmchilton/lwr/commits/63981e79696337399edb42be5614bc7218cdf95f.

This changeset includes tests for changes to wrappers and the tool evaluation module to enable this.
2014-02-10 21:34:42 -06:00
John Chilton b7c191cd48 Allow 'false_path' style replacing of extra files paths.
Updates DatasetFilenameWrapper and DatasetPath to allow this.
2014-02-10 21:34:42 -06:00
John Chilton 0954372f72 Move false_path logic out of tool evaluation code and into cheetah wrapper.
This should ease replacing extra_files_path in subsequent commits.
2014-02-10 21:34:42 -06:00
John Chilton 292be5b364 Rework interface between jobs and tools.
Pull code out of job wrapper and tool for building and evaluating against template environments and move them into a new ToolEvaluator class (in galaxy/tools/evalution.py). Introduce an abstraction (ComputeEnvironment) for various paths that get evaluated that may be different on a remote server (inputs, outputs, working directory, tools and config directory) and evaluate the template against an instance of this class. Created a default instance of this class (SharedComputeEnvironment). The idea will be that the LWR should be able to an LwrComputeEnvironment and send this to the JobWrapper when building up job inputs - nothing in this commit is LWR specific though so other runners should be able to remotely stage jobs using other mechanisms as well.

This commit adds extensive unit tests of this tool evaluation - testing many different branches through the code, with and without path rewriting, testing job hooks, config files, testing the cheetah evaluation of simple parameters, conditionals, repeats, and non-job stuff like $__app__ and $__root_dir__. As well as a new test case class for JobWrapper and TaskWrapper - though this just tests the relevant portions of that class - namely prepare and version handling.
2014-02-10 21:34:42 -06:00
John Chilton c87a0d7f4b Move cheetah wrappers into own module...
For clarity - more work toward reduces tools/__init__.py to a more managable size. This also includes an initial suite of test cases for these wrappers - testing simple select wrapper, select wrapper with file options, select wrapper with drilldown widget, raw object wrapper, input value wrapper, and the dataset file name wrapper with and without false paths.
2014-02-10 21:34:42 -06:00
John Chilton 20f91ee61d Hack to fix test_executions for 0951e07.
This whole concept I had of using these models in unit tests without a database connection present probably needs to be done away with.
2014-02-10 21:34:42 -06:00
John Chilton 2268302db9 Create unit test for some simple DefaultToolAction functionality.
Want to refactor some stuff around in DefaultToolAction so can be reused when dealing with dataset collections downstream in https://github.com/jmchilton/galaxy-central/tree/collections_1 - so creating unit tests to ensure functionality is not changing.

This changeset also reworks test_execution.py moving more stuff to test/unit/tools_support.py to share between test files.
2014-01-23 22:11:07 -06:00
John Chilton 7ad8845bb0 Refactor logic related to creating tools for unit tests.
So it can be reused by tool actions unit test.
2014-01-23 22:11:06 -06:00
John Chilton 548e66cd3d Slight improvement to test_execution.py 2014-01-23 22:11:06 -06:00
John Chilton 7e44ec4bb5 Add tool execution tests for various exceptional conditions.
Tool action raising exception, redirecting, and returning an error message.
2014-01-16 09:30:01 -06:00
John Chilton cddd727c05 Refactor tool so incoming dict isn't passed to __handle_tool_execute.
Slightly confusing that state params and raw incoming passed to that method, so pull out rerun_remap_job_id sooner and just pass that along (it was the only incoming was used for). Use the oppertunity to isolate potential errors with decoding rerun_remap_job_id and include more informative error message.

Add unit test to test invalid rerun_remap_job_ids.
2014-01-14 14:43:39 -06:00
John Chilton baac81143e Add tool execution unit test for rerun_remapping. 2014-01-14 14:43:39 -06:00
John Chilton 7bb726c80b Add data parameter tests to tool execution unit tests. 2014-01-14 08:00:57 -06:00
John Chilton b3fa048d97 Add more state handling tests...
... to tool execution unit tests.
2014-01-13 15:14:33 -06:00
John Chilton fbcf068e81 Initial work on tool execution unit tests.
Going to be doing some more work on tool state stuff so it will be good to have a way to test that. This also brings in test/unit/tools_support.py from Pull Request #287 (would be overkill for just these tests, but it is useful for future tests coming down the pipe.)
2014-01-13 08:58:22 -06:00