From 609049fd2b57b8f816db926023c2ccb5b68f0267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Rahn?= <1529364+rrahn@users.noreply.github.com> Date: Mon, 3 Nov 2025 12:25:18 +0100 Subject: [PATCH 1/4] Make bump version snapshot test more stable Uses the pipeline slug from the created pipeline rather than using hard coded org and name inside of the test. --- tests/pipelines/test_bump_version.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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.""" From 6deac081834e13c5384af95a4822591aa3be16be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Rahn?= <1529364+rrahn@users.noreply.github.com> Date: Mon, 3 Nov 2025 13:49:49 +0100 Subject: [PATCH 2/4] Make test params file more stable Use the pipeline slug from the prefix and name of the pipeline object to check for valid output. --- tests/pipelines/test_params_file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 8db0c7be77d37878be2d654a2d4ff45a55fd1bb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Rahn?= <1529364+rrahn@users.noreply.github.com> Date: Mon, 3 Nov 2025 13:56:18 +0100 Subject: [PATCH 3/4] Make test rocrate more stable by using pipeline slug from pipeline object. --- tests/pipelines/test_rocrate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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"}]) From a5c66412f23f6bcb05cdf49f04f2b6cc65b8346c Mon Sep 17 00:00:00 2001 From: nf-core-bot Date: Wed, 5 Nov 2025 12:37:08 +0000 Subject: [PATCH 4/4] [automated] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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