Skip to content

Commit

Permalink
Merge pull request #1963 from mirpedrol/test-versions
Browse files Browse the repository at this point in the history
add versions.yml to create-test-yml but not md5sum
  • Loading branch information
mirpedrol authored Oct 24, 2022
2 parents 5b8ed27 + cbaecc2 commit 263122a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 4 additions & 5 deletions nf_core/modules/test_yml_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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)
Expand Down

0 comments on commit 263122a

Please sign in to comment.