Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- update multiqc version to fix utils test ([#3853](https://github.com/nf-core/tools/pull/3853))
- Update dependency textual-dev to v1.8.0 ([#3860](https://github.com/nf-core/tools/pull/3860))
- Update pre-commit hook astral-sh/ruff-pre-commit to v0.14.3 ([#3861](https://github.com/nf-core/tools/pull/3861))
- Make bump-version snapshot test more stable ([#3865](https://github.com/nf-core/tools/pull/3865))

### Template

Expand Down
6 changes: 4 additions & 2 deletions tests/pipelines/test_bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,18 @@ def test_bump_pipeline_version_in_snapshot(self):
snapshot_dir.mkdir(parents=True, exist_ok=True)
snapshot_fn = snapshot_dir / "main.nf.test.snap"
snapshot_fn.touch()

pipeline_slug = f"{self.pipeline_obj.pipeline_prefix}/{self.pipeline_obj.pipeline_name}"
# write version number in snapshot
with open(snapshot_fn, "w") as fh:
fh.write("nf-core/testpipeline=1.0.0dev")
fh.write(f"{pipeline_slug}=1.0.0dev")

# Bump the version number
nf_core.pipelines.bump_version.bump_pipeline_version(self.pipeline_obj, "1.1.0")

# Check the snapshot
with open(snapshot_fn) as fh:
assert fh.read().strip() == "nf-core/testpipeline=1.1.0"
assert fh.read().strip() == f"{pipeline_slug}=1.1.0"

def test_bump_pipeline_version_in_snapshot_no_version(self):
"""Test that bump version does not update versions in the snapshot if no version is given."""
Expand Down
4 changes: 2 additions & 2 deletions tests/pipelines/test_params_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_build_template(self):
with open(self.outfile) as fh:
out = fh.read()

assert "nf-core/testpipeline" in out
assert f"{self.pipeline_obj.pipeline_prefix}/{self.pipeline_obj.pipeline_name}" in out

def test_build_template_invalid_schema(self):
"""Build a schema from a template"""
Expand Down Expand Up @@ -63,5 +63,5 @@ def test_build_template_content(self):
with open(self.outfile) as fh:
out = fh.read()

assert "nf-core/testpipeline" in out
assert f"{self.pipeline_obj.pipeline_prefix}/{self.pipeline_obj.pipeline_name}" in out
assert "# input: null" in out
4 changes: 3 additions & 1 deletion tests/pipelines/test_rocrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ def test_rocrate_creation(self):
for entity in entities:
entity_json = entity.as_jsonld()
if entity_json["@id"] == "./":
self.assertEqual(entity_json.get("name"), "nf-core/testpipeline")
self.assertEqual(
entity_json.get("name"), f"{self.pipeline_obj.pipeline_prefix}/{self.pipeline_obj.pipeline_name}"
)
self.assertEqual(entity_json["mainEntity"], {"@id": "main.nf"})
elif entity_json["@id"] == "#main.nf":
self.assertEqual(entity_json["programmingLanguage"], [{"@id": "#nextflow"}])
Expand Down