Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI testing for GitLab #1665

Merged
merged 14 commits into from
Jul 11, 2022
Merged
12 changes: 12 additions & 0 deletions .github/workflows/create-lint-wf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,18 @@ jobs:
- name: nf-core modules install
run: nf-core --log-file log.txt modules install fastqc --dir nf-core-testpipeline/ --force

- name: nf-core modules install gitlab
run: nf-core --log-file log.txt modules --git-remote https://gitlab.com/nf-core/modules-test.git install fastqc --dir nf-core-testpipeline/

- name: nf-core modules list local
run: nf-core --log-file log.txt modules list local --dir nf-core-testpipeline/

- name: nf-core modules list remote
run: nf-core --log-file log.txt modules list remote

- name: nf-core modules list remote gitlab
run: nf-core --log-file log.txt modules --git-remote https://gitlab.com/nf-core/modules-test.git list remote

- name: Upload log file artifact
if: ${{ always() }}
uses: actions/upload-artifact@v2
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- Fix and improve broken test for Singularity container download ([#1622](https://github.com/nf-core/tools/pull/1622))
- Use [`$XDG_CACHE_HOME`](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) or `~/.cache` instead of `$XDG_CONFIG_HOME` or `~/config/` as base directory for API cache
- Switch CI to use [setup-nextflow](https://github.com/nf-core/setup-nextflow) action to install Nextflow ([#1650](https://github.com/nf-core/tools/pull/1650))
- Add CI for GitLab remote [#1646](https://github.com/nf-core/tools/issues/1646)
- Add `CITATION.cff` [#361](https://github.com/nf-core/tools/issues/361)
- Allow customization of the `nf-core` pipeline template when using `nf-core create` ([#1548](https://github.com/nf-core/tools/issues/1548))

Expand Down
5 changes: 5 additions & 0 deletions tests/modules/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ def test_modules_install_trimgalore_twice(self):
assert self.mods_install.install("trimgalore") is True


def test_modules_install_from_gitlab(self):
"""Test installing a module from GitLab"""
assert self.mods_install_gitlab.install("fastqc") is True


# TODO Remove comments once external repository to have same structure as nf-core/modules
# def test_modules_install_trimgalore_alternative_source(self):
# """Test installing a module from a different source repository - TrimGalore!"""
Expand Down
21 changes: 21 additions & 0 deletions tests/modules/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ def test_modules_list_remote(self):
assert "fastqc" in output


def test_modules_list_remote_gitlab(self):
"""Test listing the modules in the remote gitlab repo"""
mods_list = nf_core.modules.ModuleList(None, remote=True, remote_url="https://gitlab.com/nf-core/modules-test.git")
listed_mods = mods_list.list_modules()
console = Console(record=True)
console.print(listed_mods)
output = console.export_text()
assert "fastqc" in output


def test_modules_list_pipeline(self):
"""Test listing locally installed modules"""
mods_list = nf_core.modules.ModuleList(self.pipeline_dir, remote=False)
Expand All @@ -33,3 +43,14 @@ def test_modules_install_and_list_pipeline(self):
console.print(listed_mods)
output = console.export_text()
assert "trimgalore" in output


def test_modules_install_gitlab_and_list_pipeline(self):
"""Test listing locally installed modules"""
self.mods_install_gitlab.install("fastqc")
mods_list = nf_core.modules.ModuleList(self.pipeline_dir, remote=False)
listed_mods = mods_list.list_modules()
console = Console(record=True)
console.print(listed_mods)
output = console.export_text()
assert "fastqc" in output
13 changes: 11 additions & 2 deletions tests/test_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@ def setUp(self):

# Set up install objects
print("Setting up install objects")
self.mods_install = nf_core.modules.ModuleInstall(self.pipeline_dir, prompt=False, force=True)
self.mods_install_alt = nf_core.modules.ModuleInstall(self.pipeline_dir, prompt=True, force=True)
self.mods_install = nf_core.modules.ModuleInstall(self.pipeline_dir, prompt=False, force=True, no_pull=True)
self.mods_install_alt = nf_core.modules.ModuleInstall(self.pipeline_dir, prompt=True, force=True, no_pull=True)
self.mods_install_gitlab = nf_core.modules.ModuleInstall(
self.pipeline_dir,
prompt=False,
force=True,
remote_url="https://gitlab.com/nf-core/modules-test.git",
)

# Set up remove objects
print("Setting up remove objects")
Expand Down Expand Up @@ -92,6 +98,7 @@ def test_modulesrepo_class(self):
)
from .modules.install import (
test_modules_install_emptypipeline,
test_modules_install_from_gitlab,
test_modules_install_nomodule,
test_modules_install_nopipeline,
test_modules_install_trimgalore,
Expand All @@ -104,8 +111,10 @@ def test_modulesrepo_class(self):
)
from .modules.list import (
test_modules_install_and_list_pipeline,
test_modules_install_gitlab_and_list_pipeline,
test_modules_list_pipeline,
test_modules_list_remote,
test_modules_list_remote_gitlab,
)
from .modules.module_test import (
test_modules_test_check_inputs,
Expand Down