From 241ba4cd710726ba86088755693a9aa2e8264fd0 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Wed, 26 Jul 2023 12:23:59 +0200 Subject: [PATCH] lint all components recursively in test.yml tags --- nf_core/subworkflows/lint/subworkflow_tests.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nf_core/subworkflows/lint/subworkflow_tests.py b/nf_core/subworkflows/lint/subworkflow_tests.py index 9c07b122e3..c6708f5804 100644 --- a/nf_core/subworkflows/lint/subworkflow_tests.py +++ b/nf_core/subworkflows/lint/subworkflow_tests.py @@ -3,6 +3,7 @@ """ import logging import os +from pathlib import Path import yaml @@ -53,7 +54,7 @@ def subworkflow_tests(_, subworkflow): with open(subworkflow.test_yml, "r") as fh: test_yml = yaml.safe_load(fh) - # Verify that tags are correct + # Verify that tags are correct. All included components in test main.nf should be specified in test.yml so pytests run for all of them included_components = nf_core.subworkflows.SubworkflowTestYmlBuilder.parse_module_tags( subworkflow, subworkflow.component_dir ) @@ -75,6 +76,12 @@ def subworkflow_tests(_, subworkflow): subworkflow.test_yml, ) ) + if component.startswith("subworkflows/"): + included_components += nf_core.subworkflows.SubworkflowTestYmlBuilder.parse_module_tags( + _, + Path(subworkflow.component_dir).parent.joinpath(component.replace("subworkflows/", "")), + ) + included_components = list(set(included_components)) # Look for md5sums of empty files for tfile in test.get("files", []):