Repository: nf-core/tools

Issue:
Template for test yaml is incorrect when using "contains"
### Description of the bug

"contains" in `test_yml_builder.py` in both `subworklows` and `modules` is currently outputting a string in the yml but it needs to be an array of strings.

See https://github.com/nf-core/modules/pull/2204



### Command used and terminal output

_No response_

### System information

Tools version 2.7


Discussion:

Resolving patch:
diff --git a/nf_core/modules/modules_repo.py b/nf_core/modules/modules_repo.py
--- a/nf_core/modules/modules_repo.py
+++ b/nf_core/modules/modules_repo.py
@@ -381,6 +381,10 @@ def install_subworkflow(self, subworkflow_name, install_dir, commit):
 
         # Copy the files from the repo to the install folder
         shutil.copytree(self.get_subworkflow_dir(subworkflow_name), Path(install_dir, subworkflow_name))
+        if Path(install_dir, subworkflow_name, "nextflow.config").is_file():
+            log.info(
+                f"Subworkflow config include statement: includeConfig '{Path(install_dir, subworkflow_name, 'nextflow.config')}'"
+            )
 
         # Switch back to the tip of the branch
         self.checkout_branch()


Test patch:
diff --git a/nf_core/modules/test_yml_builder.py b/nf_core/modules/test_yml_builder.py
--- a/nf_core/modules/test_yml_builder.py
+++ b/nf_core/modules/test_yml_builder.py
@@ -287,9 +287,9 @@ def get_md5_sums(self, entry_point, command, results_dir=None, results_dir_repea
             for i in range(len(test_files)):
                 if test_files[i].get("md5sum") and not test_files[i].get("md5sum") == test_files_repeat[i]["md5sum"]:
                     test_files[i].pop("md5sum")
-                    test_files[i][
-                        "contains"
-                    ] = "[ # TODO nf-core: file md5sum was variable, please replace this text with a string found in the file instead ]"
+                    test_files[i]["contains"] = [
+                        "# TODO nf-core: file md5sum was variable, please replace this text with a string found in the file instead "
+                    ]
 
         if len(test_files) == 0:
             raise UserWarning(f"Could not find any test result files in '{results_dir}'")
diff --git a/nf_core/subworkflows/test_yml_builder.py b/nf_core/subworkflows/test_yml_builder.py
--- a/nf_core/subworkflows/test_yml_builder.py
+++ b/nf_core/subworkflows/test_yml_builder.py
@@ -305,9 +305,9 @@ def get_md5_sums(self, entry_point, command, results_dir=None, results_dir_repea
             for i in range(len(test_files)):
                 if test_files[i].get("md5sum") and not test_files[i].get("md5sum") == test_files_repeat[i]["md5sum"]:
                     test_files[i].pop("md5sum")
-                    test_files[i][
-                        "contains"
-                    ] = "[ # TODO nf-core: file md5sum was variable, please replace this text with a string found in the file instead ]"
+                    test_files[i]["contains"] = [
+                        " # TODO nf-core: file md5sum was variable, please replace this text with a string found in the file instead "
+                    ]
 
         if len(test_files) == 0:
             raise UserWarning(f"Could not find any test result files in '{results_dir}'")