diff --git a/tests/subworkflows/install.py b/tests/subworkflows/install.py index dfe71686fb..f872b1f7fb 100644 --- a/tests/subworkflows/install.py +++ b/tests/subworkflows/install.py @@ -6,7 +6,9 @@ from nf_core.subworkflows.install import SubworkflowInstall from ..utils import ( + CROSS_ORGANIZATION_URL, GITLAB_BRANCH_TEST_BRANCH, + GITLAB_DEFAULT_BRANCH, GITLAB_REPO, GITLAB_SUBWORKFLOWS_BRANCH, GITLAB_SUBWORKFLOWS_ORG_PATH_BRANCH, @@ -79,6 +81,19 @@ def test_subworkflows_install_different_branch_fail(self): assert install_obj.install("bam_stats_samtools") is False +def test_subworkflows_install_across_organizations(self): + """Test installing a subworkflow with modules from different organizations""" + install_obj = SubworkflowInstall(self.pipeline_dir, remote_url=CROSS_ORGANIZATION_URL, branch=GITLAB_DEFAULT_BRANCH) + # The hic_bwamem2 subworkflow contains modules from different organizations + install_obj.install("get_genome_annotation") + # Verify that the installed_by entry was added correctly + modules_json = ModulesJson(self.pipeline_dir) + mod_json = modules_json.get_modules_json() + assert mod_json["repos"][CROSS_ORGANIZATION_URL]["modules"]["jvfe"]["prokka"]["installed_by"] == [ + "get_genome_annotation" + ] + + def test_subworkflows_install_tracking(self): """Test installing a subworkflow and finding the correct entries in installed_by section of modules.json""" self.subworkflow_install.install("bam_sort_stats_samtools") diff --git a/tests/test_subworkflows.py b/tests/test_subworkflows.py index 0a9224002a..eeee62bda1 100644 --- a/tests/test_subworkflows.py +++ b/tests/test_subworkflows.py @@ -120,6 +120,7 @@ def tearDown(self): ) from .subworkflows.install import ( # type: ignore[misc] test_subworkflow_install_nopipeline, + test_subworkflows_install_across_organizations, test_subworkflows_install_alternate_remote, test_subworkflows_install_bam_sort_stats_samtools, test_subworkflows_install_bam_sort_stats_samtools_twice, diff --git a/tests/utils.py b/tests/utils.py index 89c1328818..34c899ccf3 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -15,6 +15,7 @@ OLD_TRIMGALORE_SHA = "9b7a3bdefeaad5d42324aa7dd50f87bea1b04386" OLD_TRIMGALORE_BRANCH = "mimic-old-trimgalore" GITLAB_URL = "https://gitlab.com/nf-core/modules-test.git" +CROSS_ORGANIZATION_URL = "https://github.com/jvfe/test-subworkflow-remote.git" GITLAB_REPO = "nf-core-test" GITLAB_DEFAULT_BRANCH = "main" GITLAB_SUBWORKFLOWS_BRANCH = "subworkflows"