From 6c075d236ccf0fd6bcdddc8a1a2a0fefd2205c47 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Mon, 24 Oct 2022 12:57:21 +0200 Subject: [PATCH 1/2] add vestions.yml to create-test-yml but not md5sim --- nf_core/modules/test_yml_builder.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nf_core/modules/test_yml_builder.py b/nf_core/modules/test_yml_builder.py index c6ba65f161..23d7cc0e31 100644 --- a/nf_core/modules/test_yml_builder.py +++ b/nf_core/modules/test_yml_builder.py @@ -232,9 +232,6 @@ def create_test_file_dict(self, results_dir, is_repeat=False): test_files = [] for root, _, files in os.walk(results_dir, followlinks=True): for filename in files: - # Check that the file is not versions.yml - if filename == "versions.yml": - continue file_path = os.path.join(root, filename) # add the key here so that it comes first in the dict test_file = {"path": file_path} @@ -245,8 +242,10 @@ def create_test_file_dict(self, results_dir, is_repeat=False): # Add the md5 anyway, linting should fail later and can be manually removed if needed. # Originally we skipped this if empty, but then it's too easy to miss the warning. # Equally, if a file is legitimately empty we don't want to prevent this from working. - file_md5 = self._md5(file_path) - test_file["md5sum"] = file_md5 + if filename != "versions.yml": + # Only add md5sum if the file is not versions.yml + file_md5 = self._md5(file_path) + test_file["md5sum"] = file_md5 # Switch out the results directory path with the expected 'output' directory test_file["path"] = file_path.replace(results_dir, "output") test_files.append(test_file) From cbaecc2e89a3a87cfaf40be837e047adc2593c7c Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Mon, 24 Oct 2022 13:26:09 +0200 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7e1afb421..89ffec54be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - Improve test coverage of sync.py - `check_up_to_date()` function from `modules_json` also checks for subworkflows. - The default branch can now be specified when creating a new pipeline repo [#1959](https://github.com/nf-core/tools/pull/1959). +- Add file `versions.yml` when generating `test.yml` with `nf-core modules create-test-yml` but don't check for md5sum [#1963](https://github.com/nf-core/tools/pull/1963) ### Modules