Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
- Update pre-commit hook astral-sh/ruff-pre-commit to v0.15.11 ([#4195](https://github.com/nf-core/tools/pull/4195))
- Update nf-core/setup-nextflow action to v3 ([#4199](https://github.com/nf-core/tools/pull/4199))
- Update python:3.14-slim Docker digest to bc389f7 ([#4200](https://github.com/nf-core/tools/pull/4200))
- trigger full nf-test run if CI changes ([#4203](https://github.com/nf-core/tools/pull/4203))

### Download

Expand Down
26 changes: 20 additions & 6 deletions nf_core/pipeline-template/nf-test.config
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
config {
// location for all nf-test tests
testsDir "."
testsDir = "."

// nf-test directory including temporary files for each test
workDir System.getenv("NFT_WORKDIR") ?: ".nf-test"
workDir = System.getenv("NFT_WORKDIR") ?: ".nf-test"

// location of an optional nextflow.config file specific for executing tests
configFile "tests/nextflow.config"
configFile = "tests/nextflow.config"

// ignore tests coming from the nf-core/modules repo
ignore 'modules/nf-core/**/tests/*', 'subworkflows/nf-core/**/tests/*'
ignore = [
'modules/nf-core/**/tests/*',
'subworkflows/nf-core/**/tests/*',
]

// run all test with defined profile(s) from the main nextflow.config
profile "test"
profile = "test"

// list of filenames or patterns that should be trigger a full test run
triggers 'nextflow.config', 'nf-test.config', 'conf/test.config', 'tests/nextflow.config', 'tests/.nftignore', 'bin/*', 'assets/schema_input.json', 'nextflow_schema.json'
triggers = [
'.github/actions/nf-test/action.yml',
'.github/workflows/nf-test.yml',
'assets/schema_input.json',
'bin/*',
'conf/test.config',
'nextflow.config',
'nextflow_schema.json',
'nf-test.config',
'tests/.nftignore',
'tests/nextflow.config',
]

// load the necessary plugins
plugins {
Expand Down
12 changes: 6 additions & 6 deletions nf_core/pipelines/lint/nf_test_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,19 @@ def nf_test_content(self) -> dict[str, list[str]]:
nf_test_conf_fn = Path(self.wf_path, "nf-test.config")
nf_test_checks: dict[str, dict[str, str]] = {
"testsDir": {
"pattern": r'testsDir "\."',
"pattern": r'testsDir\s*=?\s*"\."',
"description": "sets a `testsDir`",
"failure_msg": 'does not set a `testsDir`, it should contain `testsDir "."`',
"failure_msg": 'does not set a `testsDir`, it should contain `testsDir = "."`.',
},
"workDir": {
"pattern": r'workDir System\.getenv\("NFT_WORKDIR"\) \?: "\.nf-test"',
"pattern": r'workDir\s*=?\s*System\.getenv\("NFT_WORKDIR"\) \?: "\.nf-test"',
"description": "sets a `workDir`",
"failure_msg": 'does not set a `workDir`, it should contain `workDir System.getenv("NFT_WORKDIR") ?: ".nf-test"`',
"failure_msg": 'does not set a `workDir`, it should contain `workDir = System.getenv("NFT_WORKDIR") ?: ".nf-test"`.',
},
"configFile": {
"pattern": r'configFile "tests/nextflow\.config"',
"pattern": r'configFile\s*=?\s*"tests/nextflow\.config"',
"description": "sets a `configFile`",
"failure_msg": 'does not set a `configFile`, it should contain `configFile "tests/nextflow.config"`',
"failure_msg": 'does not set a `configFile`, it should contain `configFile = "tests/nextflow.config"`.',
},
}

Expand Down
7 changes: 3 additions & 4 deletions tests/pipelines/lint/test_nf_test_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ def test_nf_test_content_missing_nf_test_config_file(self):
lint_obj = nf_core.pipelines.lint.PipelineLint(self.new_pipeline)
result = lint_obj.nf_test_content()
assert len(result["failed"]) > 0
assert "'nf-test.config' does not set a `testsDir`, it should contain `testsDir \".\"`" in result["failed"]
assert "'nf-test.config' does not set a `testsDir`, it should contain `testsDir = \".\"`." in result["failed"]
assert (
'\'nf-test.config\' does not set a `workDir`, it should contain `workDir System.getenv("NFT_WORKDIR") ?: ".nf-test"`'
'\'nf-test.config\' does not set a `workDir`, it should contain `workDir = System.getenv("NFT_WORKDIR") ?: ".nf-test"`.'
in result["failed"]
)
assert (
"'nf-test.config' does not set a `configFile`, it should contain `configFile \"tests/nextflow.config\"`"
"'nf-test.config' does not set a `configFile`, it should contain `configFile = \"tests/nextflow.config\"`."
in result["failed"]
)

Expand All @@ -73,7 +73,6 @@ def test_nf_test_content_ignored(self):
lint_obj = nf_core.pipelines.lint.PipelineLint(self.new_pipeline)
lint_obj._load()
result = lint_obj.nf_test_content()
print(result)
assert len(result["ignored"]) == 3
assert "'tests/default.nf.test' checking ignored" in result["ignored"]
assert "'tests/nextflow.config' checking ignored" in result["ignored"]
Expand Down
Loading