From 358df099b0224c92fe03690da44708ad2765ee45 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 26 Sep 2024 15:11:18 +0200 Subject: [PATCH 1/3] update snippet to account for PWDK --- faqs/gtn/gtn_workflow_testing.md | 15 ++++++++++++++- .../ro-crate-galaxy-best-practices/tutorial.md | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) 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 057b8ef82ddba0..65745c5f8a54ed 100644 --- a/topics/fair/tutorials/ro-crate-galaxy-best-practices/tutorial.md +++ b/topics/fair/tutorials/ro-crate-galaxy-best-practices/tutorial.md @@ -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} > From 495dbaad598d15b3a40a1630d0630eb0a8d3465f Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 26 Sep 2024 15:24:13 +0200 Subject: [PATCH 2/3] fix --- .../fair/tutorials/ro-crate-galaxy-best-practices/tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 65745c5f8a54ed..4fd8aa34190e33 100644 --- a/topics/fair/tutorials/ro-crate-galaxy-best-practices/tutorial.md +++ b/topics/fair/tutorials/ro-crate-galaxy-best-practices/tutorial.md @@ -35,7 +35,7 @@ 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. +> has created for workflows. > > 1. TOC > {:toc} From 6fe4453f56f7a9916c64b704d5572a6795b22158 Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Thu, 26 Sep 2024 16:25:24 +0200 Subject: [PATCH 3/3] sort out snippet --- .../fair/tutorials/ro-crate-galaxy-best-practices/tutorial.md | 2 ++ 1 file changed, 2 insertions(+) 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 4fd8aa34190e33..5f218a787b0441 100644 --- a/topics/fair/tutorials/ro-crate-galaxy-best-practices/tutorial.md +++ b/topics/fair/tutorials/ro-crate-galaxy-best-practices/tutorial.md @@ -125,7 +125,9 @@ As an example we will use this [simple workflow](https://github.com/crs4/life_mo > 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} >