diff --git a/faqs/gtn/gtn_workflow_testing.md b/faqs/gtn/gtn_workflow_testing.md index 716b2317fe9b33..1f70097fe0577e 100644 --- a/faqs/gtn/gtn_workflow_testing.md +++ b/faqs/gtn/gtn_workflow_testing.md @@ -6,6 +6,8 @@ box_type: tip contributors: [hexylena] --- +## Ensuring a Tutorial has a Workflow + 1. Find a tutorial that you're interested in, that **doesn't currently have tests.** This tutorial has a workflow (`.ga`) and a test, notice the `-test.yml` that has the same name as the workflow `.ga` file. @@ -21,6 +23,15 @@ contributors: [hexylena] 3. Follow the tutorial 4. Extract a workflow from the history 5. Run that workflow in a new history to test + +## Extract Tests (Online Version) + +If you are on UseGalaxy.org or another server running 24.2 or later, you can use [PWDK](https://pwdk.apps.galaxyproject.eu/), a version of planemo running online to generate the workflow tests. + +However if you are on an older version of Galaxy, or a private Galaxy server, then you'll need to do the following: + +## Extract Tests (Manual Version) + 6. Obtain the workflow invocation ID, and your API key (User → Preferences → Manage API Key) ![screenshot of the workflow invocation page. The user drop down shows where to find this page, and a red box circles a field named "Invocation ID"]({% link faqs/gtn/images/invocation.png %}) @@ -50,6 +61,8 @@ contributors: [hexylena] └── testing-openlayer-tests.yml ``` +## Adding Your Tests to the GTN + 9. You will need to check the `-tests.yml` file, it has some automatically generated comparisons. Namely it tests that output data matches the test-data exactly, however, you might want to replace that with assertions that check for e.g. correct file size, or specific text content you expect to see. 10. If the files in test-data are already uploaded to Zenodo, to save disk space, you should delete them from the `test-data` dir and use their URL in the `-tests.yml` file, as in this example: @@ -88,4 +101,4 @@ contributors: [hexylena] n: 2 ``` -12. Contribute all of those files to the GTN in a PR. +12. Contribute all of those files to the GTN in a PR, adding them to the `workflows/` folder of your tutorial. diff --git a/topics/fair/tutorials/ro-crate-galaxy-best-practices/tutorial.md b/topics/fair/tutorials/ro-crate-galaxy-best-practices/tutorial.md index 05345b949f0a9c..5f218a787b0441 100644 --- a/topics/fair/tutorials/ro-crate-galaxy-best-practices/tutorial.md +++ b/topics/fair/tutorials/ro-crate-galaxy-best-practices/tutorial.md @@ -34,7 +34,8 @@ Providing documentation is also important to help understand the workflow's purp > > -> In this tutorial, you will learn about the best practices that the Galaxy community has created for workflows. +> In this tutorial, you will learn about the best practices that the Galaxy community +> has created for workflows. > > 1. TOC > {:toc} @@ -122,6 +123,11 @@ As an example we will use this [simple workflow](https://github.com/crs4/life_mo > > 1. Run `planemo workflow_test_init --galaxy_url https://usegalaxy.eu --from_invocation INVOCATION_ID --galaxy_user_key API_KEY`, replacing `INVOCATION_ID` with the actual invocation ID and `API_KEY` with the actual API key. If you're not using the Galaxy Europe instance, also replace `https://usegalaxy.eu` with the URL of the instance you're using. > 1. Browse the files that have been created - `sort-and-change-case-tests.yml` and `test_data/` +> +> Optionally see this tip for more details: +> +> {% snippet faqs/gtn/gtn_workflow_testing.md %} +> {: .hands_on} >