Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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
6 changes: 3 additions & 3 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NFT_VER: "0.9.3"
NFT_WORKDIR: "~"
NXF_ANSI_LOG: false
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity
Expand Down Expand Up @@ -49,13 +48,14 @@ jobs:
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3
with:
auto-update-conda: true
channels: conda-forge, bioconda
channel-priority: strict
conda-remove-defaults: true

- name: Clean workspace
run: make clean

- name: Set NFT_WORKDIR dynamically
run: echo "NFT_WORKDIR=$HOME" >> $GITHUB_ENV

- name: Build and validate plugin
run: make validate

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ release:
# Run E2E validation test
validate:
@$(MAKE) install
cd validation && nf-test test
cd validation && nf-test test --verbose --debug

update-snapshots:
@$(MAKE) install
cd validation && nf-test test --verbose --debug --update-snapshot --clean-snapshot
31 changes: 2 additions & 29 deletions validation/config-validation/error-test.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,8 @@ nextflow_pipeline {
then {
assert workflow.failed

// Should contain error message without color codes
assert workflow.stdout.any { it.contains("Pipeline is starting") }

// Check stdout for the actual error message (error appears in stdout in nf-test)
def errorMessage = workflow.stdout.join('\n')
assert errorMessage.contains("trailing comma")
assert errorMessage.contains("ERROR")
assert errorMessage.contains("HINT")

// Should NOT contain ANSI color codes
assert !errorMessage.contains('\033[')

// Snapshot monochrome error output
assert snapshot(
workflow.stdout.findAll { it.contains("ERROR") || it.contains("HINT") }
filterNextflowOutput(workflow.stdout + workflow.stderr, keepAnsi: true)
).match()
}
}
Expand All @@ -45,22 +32,8 @@ nextflow_pipeline {
then {
assert workflow.failed

// Should contain error message with color codes
assert workflow.stdout.any { it.contains("Pipeline is starting") }

// Check stdout for the actual error message (error appears in stdout in nf-test)
def errorMessage = workflow.stdout.join('\n')
assert errorMessage.contains("trailing comma")
assert errorMessage.contains("ERROR")
assert errorMessage.contains("HINT")

// Note: Color codes may not be visible in test output due to nf-test capturing
// The important thing is that the function accepts the parameter without errors
// In real usage, colors would be displayed based on terminal capabilities

// Snapshot color error output
assert snapshot(
workflow.stdout.findAll { it.contains("ERROR") || it.contains("HINT") }
filterNextflowOutput(workflow.stdout + workflow.stderr, keepAnsi: true)
).match()
}
}
Expand Down
36 changes: 28 additions & 8 deletions validation/config-validation/error-test.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,47 @@
"Error output - Monochrome": {
"content": [
[
"N E X T F L O W ~ version [VERSION]",
"Launching `[PATH]/config-validation/../config-validation/error-test.nf` [RUN_NAME] DSL2 - revision: [REVISION]",
"Pipeline is starting! \ud83d\ude80",
"==========================================",
"Color Formatting Error Test",
"==========================================",
"Testing profile with trailing comma (expected to fail)",
"Pipeline complete! \ud83d\udc4b",
"HINT: A common mistake is to provide multiple values separated by spaces e.g. `-profile test, [CONTAINER]`.",
" -- Check script '[PATH]/config-validation/error-test.nf' at line: 24 or see '[PATH]/tests/[NFT_HASH]/meta/nextflow.log' file for more details",
"ERROR ~ ERROR ~ The `-profile` option cannot end with a trailing comma, please remove it and re-run the pipeline!",
"HINT: A common mistake is to provide multiple values separated by spaces e.g. `-profile test, docker`."
"WARN: Graphviz is required to render the execution DAG in the given format -- See http://www.graphviz.org for more info."
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-09-01T18:53:13.431098377"
"timestamp": "2025-10-29T09:37:52.569185136"
},
"Error output - Color": {
"content": [
[
"N E X T F L O W ~ version [VERSION]",
"Launching `[PATH]/config-validation/../config-validation/error-test.nf` [RUN_NAME] DSL2 - revision: [REVISION]",
"Pipeline is starting! \ud83d\ude80",
"==========================================",
"Color Formatting Error Test",
"==========================================",
"Testing profile with trailing comma (expected to fail)",
"Pipeline complete! \ud83d\udc4b",
"HINT: A common mistake is to provide multiple values separated by spaces e.g. `-profile test, [CONTAINER]`.",
" -- Check script '[PATH]/config-validation/error-test.nf' at line: 24 or see '[PATH]/tests/[NFT_HASH]/meta/nextflow.log' file for more details",
"ERROR ~ ERROR ~ The `-profile` option cannot end with a trailing comma, please remove it and re-run the pipeline!",
"HINT: A common mistake is to provide multiple values separated by spaces e.g. `-profile test, docker`."
"WARN: Graphviz is required to render the execution DAG in the given format -- See http://www.graphviz.org for more info."
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-09-01T18:53:15.822989509"
"timestamp": "2025-10-29T09:37:55.704620501"
}
}
28 changes: 16 additions & 12 deletions validation/config-validation/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ nextflow_pipeline {
script "../config-validation/main.nf"
config "../config-validation/nextflow.config"

test("Validate configuration functions") {

then {
assert workflow.success
assert snapshot(
filterNextflowOutput(workflow.stdout + workflow.stderr, keepAnsi: true)
).match()
}
}

test("monochrome_logs params enabled") {

when {
Expand All @@ -14,12 +24,9 @@ nextflow_pipeline {

then {
assert workflow.success

// Should complete successfully (the detailed logs are not captured in workflow.stdout by nf-test)
assert workflow.stdout.any { it.contains("Pipeline is starting") }
assert workflow.stdout.any { it.contains("Pipeline complete") }

// Snapshot basic successful execution
assert snapshot(
filterNextflowOutput(workflow.stdout + workflow.stderr, keepAnsi: true)
).match()
}
}

Expand All @@ -33,12 +40,9 @@ nextflow_pipeline {

then {
assert workflow.success

// Should complete successfully
assert workflow.stdout.any { it.contains("Pipeline is starting") }
assert workflow.stdout.any { it.contains("Pipeline complete") }

// Snapshot integration scenario success
assert snapshot(
filterNextflowOutput(workflow.stdout + workflow.stderr, keepAnsi: true)
).match()
}
}
}
188 changes: 188 additions & 0 deletions validation/config-validation/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
{
"Validate configuration functions": {
"content": [
[
"N E X T F L O W ~ version [VERSION]",
"Launching `[PATH]/config-validation/../config-validation/main.nf` [RUN_NAME] DSL2 - revision: [REVISION]",
"Pipeline is starting! \ud83d\ude80",
"==========================================",
"Configuration Validation Test",
"==========================================",
"=== Testing checkConfigProvided() function ===",
"Configuration check result: false",
"\u2705 checkConfigProvided() executed successfully",
"=== Testing checkProfileProvided() function ===",
"Testing args 1: [[nextflow, run, main.nf, -profile, [CONTAINER]], [nextflow, run, main.nf, -profile, [CONTAINER]], [nextflow, run, main.nf, -profile, test,[CONTAINER]]]",
"\u2705 Profile check completed for case 1",
"Testing args 2: [[nextflow, run, main.nf], [nextflow, run, main.nf, -other-param]]",
"\u2705 Profile check completed for case 2",
"Testing args 3: [[nextflow, run, main.nf, -profile], [-profile, [CONTAINER]]]",
"\u2705 Profile check completed for case 3",
"=== Testing color formatting feature ===",
"Testing monochrome output (default)",
"\u2705 Monochrome mode test completed",
"Testing color-enabled output",
"\u2705 Color-enabled mode test completed",
"Testing color formatting feature with valid profiles only",
"\u2705 Color formatting tests completed successfully",
"=== Testing checkCondaChannels() function ===",
"Conda channels check result: true",
"\u2705 checkCondaChannels() executed successfully",
"\u2705 Conda channels are configured correctly",
"=== Testing integration scenario ===",
"Simulating fetchngs pipeline initialization sequence...",
"Conda channels status: OK",
"Configuration status: May need custom config",
"Profile validation: Completed for typical fetchngs usage with color setting: monochrome",
"\u2705 Integration scenario completed successfully",
"=== Testing edge cases ===",
"\u2705 Empty arguments handled correctly",
"==========================================",
"Configuration Validation Complete",
"==========================================",
"Configuration Validation Results",
"==========================================",
"\u2705 checkConfigProvided() - Pipeline configuration validation tested",
"\u2705 checkProfileProvided() - Execution profile validation tested",
"\u2705 Color formatting - Both monochrome and color modes tested",
"\u2705 Error messages - Color formatting in error conditions tested",
"\u2705 checkCondaChannels() - Conda channel validation tested",
"\u2705 Integration scenario - Typical pipeline initialization flow tested",
"\u2705 Edge cases - Error handling and boundary conditions tested",
"Configuration validation functions ready for fetchngs! \ud83d\ude80",
"==========================================",
"Pipeline complete! \ud83d\udc4b",
"WARN: Graphviz is required to render the execution DAG in the given format -- See http://www.graphviz.org for more info."
]
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-10-29T09:40:48.846081851"
},
"monochrome_logs params disabled": {
"content": [
[
"N E X T F L O W ~ version [VERSION]",
"Launching `[PATH]/config-validation/../config-validation/main.nf` [RUN_NAME] DSL2 - revision: [REVISION]",
"Pipeline is starting! \ud83d\ude80",
"==========================================",
"Configuration Validation Test",
"==========================================",
"=== Testing checkConfigProvided() function ===",
"Configuration check result: false",
"\u2705 checkConfigProvided() executed successfully",
"=== Testing checkProfileProvided() function ===",
"Testing args 1: [[nextflow, run, main.nf, -profile, [CONTAINER]], [nextflow, run, main.nf, -profile, [CONTAINER]], [nextflow, run, main.nf, -profile, test,[CONTAINER]]]",
"\u2705 Profile check completed for case 1",
"Testing args 2: [[nextflow, run, main.nf], [nextflow, run, main.nf, -other-param]]",
"\u2705 Profile check completed for case 2",
"Testing args 3: [[nextflow, run, main.nf, -profile], [-profile, [CONTAINER]]]",
"\u2705 Profile check completed for case 3",
"=== Testing color formatting feature ===",
"Testing monochrome output (default)",
"\u2705 Monochrome mode test completed",
"Testing color-enabled output",
"\u2705 Color-enabled mode test completed",
"Testing color formatting feature with valid profiles only",
"\u2705 Color formatting tests completed successfully",
"=== Testing checkCondaChannels() function ===",
"Conda channels check result: true",
"\u2705 checkCondaChannels() executed successfully",
"\u2705 Conda channels are configured correctly",
"=== Testing integration scenario ===",
"Simulating fetchngs pipeline initialization sequence...",
"Conda channels status: OK",
"Configuration status: May need custom config",
"Profile validation: Completed for typical fetchngs usage with color setting: monochrome",
"\u2705 Integration scenario completed successfully",
"=== Testing edge cases ===",
"\u2705 Empty arguments handled correctly",
"==========================================",
"Configuration Validation Complete",
"==========================================",
"Configuration Validation Results",
"==========================================",
"\u2705 checkConfigProvided() - Pipeline configuration validation tested",
"\u2705 checkProfileProvided() - Execution profile validation tested",
"\u2705 Color formatting - Both monochrome and color modes tested",
"\u2705 Error messages - Color formatting in error conditions tested",
"\u2705 checkCondaChannels() - Conda channel validation tested",
"\u2705 Integration scenario - Typical pipeline initialization flow tested",
"\u2705 Edge cases - Error handling and boundary conditions tested",
"Configuration validation functions ready for fetchngs! \ud83d\ude80",
"==========================================",
"Pipeline complete! \ud83d\udc4b",
"WARN: Graphviz is required to render the execution DAG in the given format -- See http://www.graphviz.org for more info."
]
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-10-29T09:40:56.018591664"
},
"monochrome_logs params enabled": {
"content": [
[
"N E X T F L O W ~ version [VERSION]",
"Launching `[PATH]/config-validation/../config-validation/main.nf` [RUN_NAME] DSL2 - revision: [REVISION]",
"Pipeline is starting! \ud83d\ude80",
"==========================================",
"Configuration Validation Test",
"==========================================",
"=== Testing checkConfigProvided() function ===",
"Configuration check result: false",
"\u2705 checkConfigProvided() executed successfully",
"=== Testing checkProfileProvided() function ===",
"Testing args 1: [[nextflow, run, main.nf, -profile, [CONTAINER]], [nextflow, run, main.nf, -profile, [CONTAINER]], [nextflow, run, main.nf, -profile, test,[CONTAINER]]]",
"\u2705 Profile check completed for case 1",
"Testing args 2: [[nextflow, run, main.nf], [nextflow, run, main.nf, -other-param]]",
"\u2705 Profile check completed for case 2",
"Testing args 3: [[nextflow, run, main.nf, -profile], [-profile, [CONTAINER]]]",
"\u2705 Profile check completed for case 3",
"=== Testing color formatting feature ===",
"Testing monochrome output (default)",
"\u2705 Monochrome mode test completed",
"Testing color-enabled output",
"\u2705 Color-enabled mode test completed",
"Testing color formatting feature with valid profiles only",
"\u2705 Color formatting tests completed successfully",
"=== Testing checkCondaChannels() function ===",
"Conda channels check result: true",
"\u2705 checkCondaChannels() executed successfully",
"\u2705 Conda channels are configured correctly",
"=== Testing integration scenario ===",
"Simulating fetchngs pipeline initialization sequence...",
"Conda channels status: OK",
"Configuration status: May need custom config",
"Profile validation: Completed for typical fetchngs usage with color setting: true",
"\u2705 Integration scenario completed successfully",
"=== Testing edge cases ===",
"\u2705 Empty arguments handled correctly",
"==========================================",
"Configuration Validation Complete",
"==========================================",
"Configuration Validation Results",
"==========================================",
"\u2705 checkConfigProvided() - Pipeline configuration validation tested",
"\u2705 checkProfileProvided() - Execution profile validation tested",
"\u2705 Color formatting - Both monochrome and color modes tested",
"\u2705 Error messages - Color formatting in error conditions tested",
"\u2705 checkCondaChannels() - Conda channel validation tested",
"\u2705 Integration scenario - Typical pipeline initialization flow tested",
"\u2705 Edge cases - Error handling and boundary conditions tested",
"Configuration validation functions ready for fetchngs! \ud83d\ude80",
"==========================================",
"Pipeline complete! \ud83d\udc4b",
"WARN: Graphviz is required to render the execution DAG in the given format -- See http://www.graphviz.org for more info."
]
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-10-29T09:40:52.50112494"
}
}
2 changes: 1 addition & 1 deletion validation/config-validation/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ params {
// Process configuration - simulate realistic setup
process {
// Use conda by default for testing conda channel validation
conda = "${projectDir}/environment.yml"
conda = "${projectDir}/mock-data/environment.yml"

// Resource limits
memory = '1 GB'
Expand Down
Loading
Loading