Wizard Tool

wft4galaxy supports users on the creation of their workflow test cases by means of a “wizard” functionality which can be called by typing wft4galaxy-wizard after installation (see Installation) or using Docker (see Dockerized wft4galaxy).

It provides users with two main features:

  1. a test suite template generator, which simply creates a template of workflow test suite definition file (see Test Definition File Reference) within a directory reasonable structured for containing a test suite (see TestSuite Directory Structure below);
  2. a test suite generator, which automatically generates a test suite from an existing Galaxy history.

Type wft4galaxy-wizard --help to see its main options and arguments:

wft4galaxy-wizard help
 usage: wft4galaxy-wizard [-h] [--debug] [--server GALAXY_URL]
                          [--api-key GALAXY_API_KEY] [-o OUTPUT_FOLDER]
                          [-f FILE]
                          {generate-test,generate-template} ...

 optional arguments:
   -h, --help            show this help message and exit
   --debug               Enable debug mode
   --server GALAXY_URL   Galaxy server URL (default $GALAXY_URL)
   --api-key GALAXY_API_KEY
                         Galaxy server API KEY (default $GALAXY_API_KEY)
   -o OUTPUT_FOLDER, --output OUTPUT_FOLDER
                         absolute path of the output folder (default is "test-
                         config")
   -f FILE, --file FILE  YAML configuration file of workflow tests (default is
                         "workflow-test-suite.yml")

 command:

   {generate-test,generate-template}
                         Wizard tool command: [generate-test | generate-
                         template]
     generate-test       Generate a test definition file from a history
     generate-template   Generate a test definition template

As with other wft4galaxy features, the options --server and --api-key override the two environment variable which define the Galaxy instance to use, respectively GALAXY_URL and GALAXY_API_KEY.

Generate Template

A test suite template directory can be generate by typing:

 wft4galaxy-wizard generate-template [-f <TEST_SUITE_FILE>] [-o <OUTPUT_FOLDER>]

The former option -f <TEST_SUITE_FILE> allows you to customize the filename containing the test suite definition (the default filename is workflow-test-suite.yml), while the later overrides the default name of the output folder, which is test-config. A part from the actual files (workflow definition .ga file and datasets), its structure looks like shown in TestSuite Directory Structure.

Generate TestSuite from a history

The main purpose is to allow users to automatically generate a workflow test case from a history. Given a history name, the wizard tool collects all history info which are useful to generate a test case.

In particular, it extracts the workflow executed to generate the history and produces its definition file, i.e., the .ga definition file. Then, it downloads all history datasets to generate the test case:

  • datasets uploaded by users are mapped to test case inputs ;
  • datasets generated by the workflow execution are mapped to test case expected-outputs.

Finally, a workflow test definition file is generated.

The typical directory structure of the resulting test case is:

TestSuite Directory Structure
 \ <TEST_CASE_OUTPUT_FOLDER>
 | -- workflow-test-suite.yml
 | -- workflow.ga
 + -- inputs
 |      | -- <input-dataset>.<dataset-type>
 |     ...
 + -- expected
 |      | -- <output-dataset>.<dataset-type>
 |     ...

To generate a test case from your Galaxy history, type:

wft4galaxy-wizard -o <TEST_CASE_OUTPUT_FOLDER> generate-test <HISTORY_NAME>

Note

The mandatory parameter HISTORY_NAME selects the history to be used for generating the test case. If more than one history matches that name, the wizard asks for choosing one of them, displaying their creation time.