diff --git a/CHANGELOG.md b/CHANGELOG.md index c9633bd0db..84ba83f17c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/tests/pipelines/test_bump_version.py b/tests/pipelines/test_bump_version.py index 8cee7dc095..ec5021f663 100644 --- a/tests/pipelines/test_bump_version.py +++ b/tests/pipelines/test_bump_version.py @@ -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.""" diff --git a/tests/pipelines/test_params_file.py b/tests/pipelines/test_params_file.py index 723a8a561e..a62b90f4ed 100644 --- a/tests/pipelines/test_params_file.py +++ b/tests/pipelines/test_params_file.py @@ -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""" @@ -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 diff --git a/tests/pipelines/test_rocrate.py b/tests/pipelines/test_rocrate.py index ac86e64bdf..a073beae31 100644 --- a/tests/pipelines/test_rocrate.py +++ b/tests/pipelines/test_rocrate.py @@ -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"}])