Commit Graph
82 Commits
Author SHA1 Message Date
John Chilton 46f2679e9d Tool Tests - Only set library import dir if it exists.
Fixes planemo #41 (https://github.com/galaxyproject/planemo/issues/41).
2015-01-11 21:32:50 -05:00
John Chilton b0e43e567e Allow specification of multiple data manager configuration files...
... use this to create API functional tests for data managers.
2014-12-15 00:20:35 -05:00
John Chilton 33463efe13 Allow multiple tool data table config files...
... use this functionality to implement tests for tool data API.
2014-12-15 00:20:35 -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 b7ddf97561 Reduce some duplication related to nose running. 2014-12-08 00:21:47 -05:00
John Chilton e9ed914f80 Remove redundant lines in scripts/functional_tests.py.
This stuff is already imported at the top of the file - my guess is the need to import it later is not longer needed.
2014-12-08 00:21:47 -05:00
John Chilton 4194c80669 Drop psu_production stuff from scripts/functional_tests.py.
These tests need to runnable against running servers but should be more general and updated.
2014-12-08 00:21:47 -05:00
John Chilton f5d1f77a4f Make functional tests to respect GALAXY_CONFIG_ environment variables.
Functional tests don't work without the tweak to imports in cloudlaunch - not sure if that has always been a problem and I am just running the tests in a different Galaxy instance or if the earlier import of util caused the problem.

Regardless I guess we shoud update to a version of bioblend that doesn't require simplejson.
2014-10-06 20:56:58 -04:00
John Chilton 8c7c1b64be Fix run_tests.sh --with_framework_test_tools for 9a05d1e.
Now appends test tools to sample tools instead of to default tools Galaxy would other wise load (config/tool_conf.xml or tool_conf.xml if these exist instead of sample) - so this is different behavior but I am unsure if it is worse. --with_framework_test_tools was added for API tests and these should probably target the distribution and not random tools someone might have configured so perhaps this new behavior is superior.
2014-09-23 13:38:25 -04:00
Nate Coraor 41bbe96791 Functional test fix for config file moves. 2014-09-23 10:09:17 -04:00
Nate Coraor 8fadc6392b Rename universe_wsgi.ini -> galaxy.ini everywhere. 2014-09-15 16:43:51 -04:00
Dannon Baker 038f6dc6d5 Switch to_json_string/from_json_string in galaxy/scripts. 2014-09-09 10:04:28 -04:00
John Chilton 3ac17e09f1 Rework test framework testing and tools.
-framework will still cause just a small set of non-default, non-user facing tools to be tested and exerise various aspects of the tool and test frameworks, but now an argument can be passed in -with_framework_test_tools to allow these tools to be used as part of the normal test framework (i.e. when not using -framework). This serves two purposes - to ensure the feature coverage of existing tests remains high as the tests are migrated out of the distribution and to allow a set of tests to be available for functional (e.g. API tests) that users don't need to see.
2014-04-28 11:48:51 -05:00
John Chilton 17e935528d Add example tool with task splitting to tool functional framework tests.
Enable task splitting in functional tests to test this. Specify tool_dir in samples tool_conf.xml so it doesn't need to be explicitly set in scripts/functional_tests.py.
2014-01-28 14:34:26 -06:00
Dave Bouvier d1114a1b0f Fix deletion of test methods after tests have been run. 2014-01-16 11:30:25 -05:00
John Chilton fb0f7e6fde Rework workflow functional testing so isn't tested by default...
Meant to be used with a specific workflow, but nose is picking it up by default when no workflow has been specified.
2014-01-11 22:40:18 -06:00
John Chilton e62b2ccb56 Implement framework for testing API...
... if you can call 1 new class a framework. Includes a few test cases to exercise/drive it. These examples include a histories API test (a typical API test) and a general test of the API framework itself (mostly just the run_as functionality).

This includes changes to interactor.py to make it more useful outside the context of tool/workflow testing as well as a tweak to test Galaxy that gets started to allow testing of the run_as feature.
2014-01-10 08:45:36 -06:00
John Chilton 02aeedeef7 Rework key injection logic in test framework.
Pull logic for how master and user API keys are determinined for testing out of functional_tests.py for reuse elsewhere.

This refactoring will help the creation of an API test framework.
2014-01-10 08:45:36 -06:00
Dave Bouvier 871c301e35 Allow specifying the functional tests' install_database_connection with an environment variable. 2014-01-08 14:50:19 -05:00
Greg Von Kuster d26d527bc6 Order imports per database_contexts requirements to fix the tool shed's install and test framework. 2014-01-03 10:02:19 -05:00
Daniel Blankenberg 3db7688a56 Add Functional Testing support for locally and ToolShed installed Data Managers. 2013-12-10 12:59:29 -05:00
Daniel Blankenberg 20e478f210 Allow ftp for GALAXY_TEST_DB_TEMPLATE and stricter check for protocol URL prefixes. 2013-12-10 11:08:13 -05:00
Daniel Blankenberg f370e990e0 Fix for using GALAXY_TEST_DB_TEMPLATE with htTp not specified in all lower case. 2013-12-10 10:54:51 -05:00
Dave Bouvier 048e4af5d7 Use walltime configured in job_conf.xml instead of maxseconds for determining whether a test tool run is stuck. 2013-12-05 13:52:22 -05: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
Greg Von Kuster 340762bbf1 Correctly use the initialized test_environment dict when running the tool shed's install and test framework and additional code cleanup for the framework. 2013-12-04 15:07:39 -05:00
John Chilton c28260faf7 Functional testing of workflows (for Galaxy).
... tool shed integration will be more challenging, but this can be used for directly configured Galaxy tools and outlines a syntax that could be shared with a tool shed driven approach.

The one tricky part is how to match workflow outputs to things to check. Right now it is based on the index of the output across the workflow. This is both difficult to determine and very brittle to workflow modifications - how to proceed - require annontation string to be setup? Modify workflow data model to all assigning names to outputs the way inputs havenames? At any rate this current syntax should be considered beta and may change - if it does Galaxy will not continue to support this syntax.

To run the sample test execute the following test command:

sh run_functional_tests.sh -workflow test-data/workflows/1.xml
2013-11-21 19:17:13 -06:00
John Chilton bf18bea107 Small clean up of argument processing in functional_tests.py 2013-11-21 19:17:13 -06:00
John Chilton 569c5db221 Add new option, tools, and data to functional test framework to test/demonstrate tool framework itself.
Add smaple repeat tool demonstrating some weaknesses of twill-based current framework.
2013-11-21 19:17:12 -06:00
John Chilton 79f645eabc Twill-less tool tests - allow tests with GALAXY_TEST_EXTERNAL...
... if GALAXY_TEST_EXTERNAL is ever fixed.
2013-11-21 19:17:12 -06:00
John Chilton 0e31d6c113 Inject master API key into functional test Galaxy.
Override or set external key with GALAXY_TEST_MASTER_API_KEY.
2013-11-21 19:17:12 -06:00
John Chilton 4ecaf654ea Refactor shared code in functional_tests.py into a method. 2013-11-21 19:17:12 -06:00
John Chilton 6ef8fc7181 Do not reference values before use when GALAXY_TEST_EXTERNAL used.
GALAXY_TEST_EXTERNAL still quite broken.
2013-11-17 00:47:26 -06:00
John Chilton 43a17b3d9b Implement functional test env. variable GALAXY_TEST_DB_TEMPLATE.
Middle ground between recreating a completely new database and pointing at existing database with GALAXY_TEST_DBURI. The former requires a lot of setup time, the latter results in test failures in certain cases (namely tool shed tests expecting clean database).

GALAXY_TEST_DB_TEMPLATE can be either a file path (absolute) or URL.

In order to facilitate this, a new Galaxy config option (database_auto_migrate) has been added. If this option is enabled, when Galaxy starts up and points at an existing database, if that database is not at the newest version it will be automatically migrated. This option defaults to False, but is enabled in testing if GALAXY_TEST_DB_TEMPLATE is set.

I think we should go a step further and make this (database_auto_migrate) default to True if database_connection references an sqlite database - unless we believe there are Galaxy instances out there based on sqlite that are REALLY old or that are production enough to warrent requiring admins to do that database migration in a separate step (presumably encouraging them to make a backup pre-migration). Thoughts?
2013-10-30 00:01:15 -05:00
John Chilton b1e173d214 PEP-8 fixes for scripts/functional_tests.py.
Still contains some unused imports. Perhaps these are reimported elsewhere?
2013-10-30 00:01:15 -05:00
John Chilton 0f63caaff0 Bug fix in scripts/functional_tests.py.
A tempdir is referenced before it is created in certain cases.
2013-10-14 21:50:12 -05:00
Ross Lazarus 8c4f96ed81 backout -r 10808 2013-10-08 10:55:24 +11:00
Ross Lazarus 7938d1fc81 local changes 2013-10-05 09:51:18 +10:00
Carl Eberhard 89c8698169 Functional tests: fix sqlite db_path var; fix api test for hda update with nonsense key 2013-08-21 10:00:09 -07:00
Dave Bouvier 7adc736e16 Fix for case where running functional tests might overwrite certain files in database/files. 2013-08-19 13:06:17 -04:00
Nate Coraor 86f25f3bcf GCC2013 Advanced Tool and Data Source Configuration workshop: "The test framework uses tool_conf.xml.sample for reasons unknown and lost to time."
Use tool_conf.xml for running functional tests, rather than tool_conf.xml.sample.
2013-06-30 10:04:58 -04:00
Dave Bouvier aa0c5c86eb Fix for setting metadata externally when running functional tests. 2013-05-08 15:48:16 -04:00
Dannon Baker ae36520d56 Metadata setting: Always set externally. 2013-05-06 12:50:06 -04:00
Dannon Baker 57c89d742e Functional test setup fix for sqlite -- pool_size is an invalid option in sqlalchemy7+. 2013-04-30 23:24:55 -04:00
Dave Bouvier 8d2655503b Improved documentation for automated repository installation and testing. Handle cases where a repository is missing test data. Limit the list of repositories to test to those that have tools. Update the parse_tool_panel_config method to return a flag specifying whether test data was found for the specified tool panel entry. 2013-03-01 15:13:20 -05:00
Carl Eberhard 2337695990 fix server_env saved output dir name; clean up prev. debugging statements 2013-03-01 12:49:08 -05:00
Dave Bouvier 9b30f6c839 Attempt to resolve issue with tool shed registry when running buildbot functional tests. 2013-02-27 14:12:07 -05:00
Dave Bouvier 36ea9db697 Extension of framework to automate the installation of a list of tool shed repositories to also run any functional tests in the tools contained within each repository. 2013-02-20 14:27:36 -05:00
Carl Eberhard c2898ec7f9 More reporting for buildbot corrections 2013-02-19 20:00:27 -05:00