Skip to content

Commit

Permalink
Merge pull request #6 from sanger-tol/cross-org-test
Browse files Browse the repository at this point in the history
tests: Add test case for cross-organization subwf
  • Loading branch information
jvfe authored Jul 8, 2024
2 parents 930ece5 + 423517e commit 6816cc1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/subworkflows/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions tests/test_subworkflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6816cc1

Please sign in to comment.