Skip to content

Commit

Permalink
Merge pull request #64 from ewels/master
Browse files Browse the repository at this point in the history
Release tests.. third time's a charm?
  • Loading branch information
ewels authored Jun 12, 2018
2 parents 3661dc3 + c4d8c3d commit 8216ffc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion nf_core/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def check_version_consistency(self):
versions['process.container'] = self.config['process.container'].strip(' \'"').split(':')[-1]

# Get version from the TRAVIS_TAG env var
if os.environ.get('TRAVIS_TAG'):
if os.environ.get('TRAVIS_TAG') and os.environ.get('TRAVIS_REPO_SLUG', '') != 'nf-core/tools':
versions['TRAVIS_TAG'] = os.environ.get('TRAVIS_TAG').strip(' \'"')

# Check if they are all numeric
Expand Down
14 changes: 4 additions & 10 deletions tests/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ def test_call_lint_pipeline_fail(self):

def test_call_lint_pipeline_release(self):
"""Test the main execution function of PipelineLint when running with --release"""
# Ignore nf-core/tools releases
try:
del os.environ['TRAVIS_REPO_SLUG']
except KeyError:
pass
lint_obj = nf_core.lint.PipelineLint(PATH_WORKING_EXAMPLE)
lint_obj.lint_pipeline(release=True)
expectations = {"failed": 0, "warned": 0, "passed": MAX_PASS_CHECKS + ADD_PASS_RELEASE}
Expand Down Expand Up @@ -204,11 +199,6 @@ def test_dockerfile_pass(self):

def test_version_consistency_pass(self):
"""Tests the workflow version and container version sucessfully"""
# Ignore nf-core/tools releases
try:
del os.environ['TRAVIS_REPO_SLUG']
except KeyError:
pass
lint_obj = nf_core.lint.PipelineLint(PATH_WORKING_EXAMPLE)
lint_obj.config["params.version"] = "0.4"
lint_obj.config["params.container"] = "nfcore/tools:0.4"
Expand All @@ -220,6 +210,7 @@ def test_version_consistency_with_env_fail(self):
"""Tests the behaviour, when a git activity is a release
and simulate wrong release tag"""
os.environ["TRAVIS_TAG"] = "0.5"
os.environ["TRAVIS_REPO_SLUG"] = "nf-core/testpipeline"
lint_obj = nf_core.lint.PipelineLint(PATH_WORKING_EXAMPLE)
lint_obj.config["params.version"] = "0.4"
lint_obj.config["params.container"] = "nfcore/tools:0.4"
Expand All @@ -232,6 +223,7 @@ def test_version_consistency_with_numeric_fail(self):
"""Tests the behaviour, when a git activity is a release
and simulate wrong release tag"""
os.environ["TRAVIS_TAG"] = "0.5dev"
os.environ["TRAVIS_REPO_SLUG"] = "nf-core/testpipeline"
lint_obj = nf_core.lint.PipelineLint(PATH_WORKING_EXAMPLE)
lint_obj.config["params.version"] = "0.4"
lint_obj.config["params.container"] = "nfcore/tools:0.4"
Expand All @@ -243,6 +235,7 @@ def test_version_consistency_with_no_docker_version_fail(self):
"""Tests the behaviour, when a git activity is a release
and simulate wrong missing docker version tag"""
os.environ["TRAVIS_TAG"] = "0.4"
os.environ["TRAVIS_REPO_SLUG"] = "nf-core/testpipeline"
lint_obj = nf_core.lint.PipelineLint(PATH_WORKING_EXAMPLE)
lint_obj.config["params.version"] = "0.4"
lint_obj.config["params.container"] = "nfcore/tools"
Expand All @@ -254,6 +247,7 @@ def test_version_consistency_with_env_pass(self):
"""Tests the behaviour, when a git activity is a release
and simulate correct release tag"""
os.environ["TRAVIS_TAG"] = "0.4"
os.environ["TRAVIS_REPO_SLUG"] = "nf-core/testpipeline"
lint_obj = nf_core.lint.PipelineLint(PATH_WORKING_EXAMPLE)
lint_obj.config["params.version"] = "0.4"
lint_obj.config["params.container"] = "nfcore/tools:0.4"
Expand Down

0 comments on commit 8216ffc

Please sign in to comment.