Skip to content

Commit

Permalink
update snippet to account for PWDK
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed Sep 26, 2024
1 parent 98a0e2e commit 358df09
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
15 changes: 14 additions & 1 deletion faqs/gtn/gtn_workflow_testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 %})
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ 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}

> <question-title></question-title>
Expand Down

0 comments on commit 358df09

Please sign in to comment.