diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 15ba43a..1ab8742 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -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 @@ -56,6 +55,9 @@ jobs: - 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 00fb345..5cff87a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Simplify and improve validation tests by using nft-utils for snapshots - Enhanced `softwareVersionsToYAML()` to support mixed input sources including YAML strings, file paths, topic tuples, and maps ([#24](https://github.com/nf-core/nf-core-utils/pull/24)) - Improved Nextflow version detection in `workflowVersionToYAML()` with fallback to `NXF_VER` environment variable diff --git a/Makefile b/Makefile index 2474dea..26efbc8 100644 --- a/Makefile +++ b/Makefile @@ -31,4 +31,8 @@ release: # Run E2E validation test validate: @$(MAKE) install - cd validation && nf-test test + cd validation && nf-test test --verbose + +update-snapshots: + @$(MAKE) install + cd validation && nf-test test --verbose --update-snapshot --clean-snapshot diff --git a/validation/config-validation/error-test.nf.test b/validation/config-validation/error-test.nf.test index 20f0148..9a051f9 100644 --- a/validation/config-validation/error-test.nf.test +++ b/validation/config-validation/error-test.nf.test @@ -1,8 +1,8 @@ nextflow_pipeline { name "Test nf-core-utils color formatting error messages" - script "../config-validation/error-test.nf" - config "../config-validation/nextflow.config" + script "./error-test.nf" + config "./nextflow.config" test("Error output - Monochrome") { @@ -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() } } @@ -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() } } diff --git a/validation/config-validation/error-test.nf.test.snap b/validation/config-validation/error-test.nf.test.snap index a972acf..4722de6 100644 --- a/validation/config-validation/error-test.nf.test.snap +++ b/validation/config-validation/error-test.nf.test.snap @@ -2,27 +2,47 @@ "Error output - Monochrome": { "content": [ [ + "N E X T F L O W ~ version [VERSION]", + "Launching `[PATH]/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/./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" } } \ No newline at end of file diff --git a/validation/config-validation/main.nf.test b/validation/config-validation/main.nf.test index b22d0df..2411925 100644 --- a/validation/config-validation/main.nf.test +++ b/validation/config-validation/main.nf.test @@ -1,8 +1,18 @@ nextflow_pipeline { name "Test nf-core-utils config validation functions" - script "../config-validation/main.nf" - config "../config-validation/nextflow.config" + script "./main.nf" + config "./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") { @@ -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() } } @@ -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() } } } diff --git a/validation/config-validation/main.nf.test.snap b/validation/config-validation/main.nf.test.snap new file mode 100644 index 0000000..95382f1 --- /dev/null +++ b/validation/config-validation/main.nf.test.snap @@ -0,0 +1,188 @@ +{ + "Validate configuration functions": { + "content": [ + [ + "N E X T F L O W ~ version [VERSION]", + "Launching `[PATH]/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/./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/./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" + } +} \ No newline at end of file diff --git a/validation/config-validation/nextflow.config b/validation/config-validation/nextflow.config index 7edf672..5c290f9 100644 --- a/validation/config-validation/nextflow.config +++ b/validation/config-validation/nextflow.config @@ -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' diff --git a/validation/nf-test.config b/validation/nf-test.config index 89222d2..678ab5c 100644 --- a/validation/nf-test.config +++ b/validation/nf-test.config @@ -1,7 +1,7 @@ config { // Test directory configuration testsDir "." - workDir ".nf-test" + workDir System.getenv("NFT_WORKDIR") ?: ".nf-test" configFile "nextflow.config" // Test execution settings @@ -9,11 +9,10 @@ config { autoSort false // Global Nextflow options for validation tests - options "-plugins nf-core-utils@0.3.0 --validate_params false" + options "-plugins nf-core-utils@0.3.1 --validate_params false" // Include plugins plugins { - load "nft-utils@0.0.3" + load "nft-utils@0.0.7" } - } diff --git a/validation/notification-system/main.nf b/validation/notification-system/main.nf index 7221ceb..904e8a3 100644 --- a/validation/notification-system/main.nf +++ b/validation/notification-system/main.nf @@ -18,7 +18,6 @@ include { imNotification } from 'plugin/nf-core-utils' workflow { - log.info("Pipeline is starting! 🚀") log.info("==========================================") log.info("Notification System Validation Test") log.info("==========================================") @@ -33,7 +32,6 @@ workflow { log.info("Notification functions imported successfully") log.info("Pipeline execution complete - notification functions will be tested in completion handlers") - log.info("Pipeline complete! 👋") workflow.onComplete { log.info( """ diff --git a/validation/notification-system/main.nf.test b/validation/notification-system/main.nf.test index d8f9681..f88a846 100644 --- a/validation/notification-system/main.nf.test +++ b/validation/notification-system/main.nf.test @@ -1,25 +1,14 @@ nextflow_pipeline { name "Test nf-core-utils notification system" - script "../notification-system/main.nf" + script "./main.nf" test("Notification system") { - then { assert workflow.success - assert workflow.exitStatus == 0 - - // Verify basic pipeline execution markers - assert workflow.stdout.any { it.contains("Pipeline is starting") } - assert workflow.stdout.any { it.contains("Pipeline complete") } - - // Snapshot notification system outputs - testing successful execution - // The detailed function testing happens in onComplete handler which may not be fully captured in stdout assert snapshot( - // workflow.stdout, // No workflow.stdout before we can sanitize this with nft-utils - workflow.exitStatus, - workflow.success + filterNextflowOutput(workflow.stdout + workflow.stderr, keepAnsi: true) ).match() } } diff --git a/validation/notification-system/main.nf.test.snap b/validation/notification-system/main.nf.test.snap index ff99d61..635bd82 100644 --- a/validation/notification-system/main.nf.test.snap +++ b/validation/notification-system/main.nf.test.snap @@ -1,13 +1,35 @@ { "Notification system": { "content": [ - 0, - true + [ + "N E X T F L O W ~ version [VERSION]", + "Launching `[PATH]/notification-system/./main.nf` [RUN_NAME] DSL2 - revision: [REVISION]", + "Pipeline is starting! \ud83d\ude80", + "==========================================", + "Notification System Validation Test", + "==========================================", + "Testing notification functions import and availability...", + "\u2705 completionEmail function available: true", + "\u2705 completionSummary function available: true", + "\u2705 imNotification function available: true", + "Notification functions imported successfully", + "Pipeline execution complete - notification functions will be tested in completion handlers", + "===========================================", + "Testing notification functions in completion handler", + "===========================================", + "=== Testing completionSummary() function ===", + "\u2705 completionSummary(colored) completed successfully", + "\u2705 completionSummary(monochrome) completed successfully", + "=== Testing completionEmail() function ===", + " -- Check script '[PATH]/notification-system/main.nf' at line: 84 or see '[PATH]/tests/[NFT_HASH]/meta/nextflow.log' file for more details", + "Pipeline complete! \ud83d\udc4b", + "ERROR ~ Failed to invoke `workflow.onComplete` event handler" + ] ], "meta": { - "nf-test": "0.9.2", - "nextflow": "25.04.6" + "nf-test": "0.9.3", + "nextflow": "25.10.0" }, - "timestamp": "2025-09-01T18:53:43.06379336" + "timestamp": "2025-10-29T10:49:36.874294981" } } \ No newline at end of file diff --git a/validation/pipeline-utilities/main.nf.test b/validation/pipeline-utilities/main.nf.test index eb7b86d..63264a9 100644 --- a/validation/pipeline-utilities/main.nf.test +++ b/validation/pipeline-utilities/main.nf.test @@ -1,24 +1,15 @@ nextflow_pipeline { name "Test nf-core-utils pipeline utilities" - script "../pipeline-utilities/main.nf" - config "../pipeline-utilities/nextflow.config" + script "./main.nf" + config "./nextflow.config" test("Pipeline utilities") { then { assert workflow.success - assert workflow.exitStatus == 0 - - // Verify basic pipeline execution markers (stdout is a list) - assert workflow.stdout.any { it.contains("Pipeline is starting") } - assert workflow.stdout.any { it.contains("Pipeline complete") } - - // Snapshot core pipeline utilities outputs assert snapshot( - // workflow.stdout, // No workflow.stdout before we can sanitize this with nft-utils - workflow.exitStatus, - workflow.success + filterNextflowOutput(workflow.stdout + workflow.stderr, keepAnsi: true) ).match() } } diff --git a/validation/pipeline-utilities/main.nf.test.snap b/validation/pipeline-utilities/main.nf.test.snap index 2411d8d..2a2795e 100644 --- a/validation/pipeline-utilities/main.nf.test.snap +++ b/validation/pipeline-utilities/main.nf.test.snap @@ -1,13 +1,47 @@ { "Pipeline utilities": { "content": [ - 0, - true + [ + "N E X T F L O W ~ version [VERSION]", + "Launching `[PATH]/pipeline-utilities/./main.nf` [RUN_NAME] DSL2 - revision: [REVISION]", + "Pipeline is starting! \ud83d\ude80", + "==========================================", + "Pipeline Utilities Validation Test", + "==========================================", + "=== Testing getWorkflowVersion() function ===", + "Default workflow version: v1.12.0", + "Explicit version (2.1.0): v2.1.0", + "Version with commit (2.1.0, abc123): v2.1.0-gabc123d", + "Version with v prefix (v3.0.0): v3.0.0", + "Null version with commit: v1.12.0-gxyz789a", + "=== Testing dumpParametersToJSON() function ===", + "Dumping parameters to JSON in: [PATH]/tests/[NFT_HASH]/work/validation_output", + "\u2705 Parameters dumped successfully", + "=== Testing edge cases ===", + "\u2705 Null output directory handled correctly", + "=== Validating outputs ===", + "=== Validating version strings ===", + "\u2705 All version string validations passed", + "==========================================", + "Pipeline Utilities Validation Complete", + "==========================================", + "Pipeline Utilities Validation Results", + "==========================================", + "\u2705 getWorkflowVersion() function tested successfully", + "\u2705 dumpParametersToJSON() function tested successfully", + "\u2705 Edge cases handled properly", + "\u2705 Output validation completed", + "Functions ready for use in fetchngs pipeline! \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.", + "WARN: JSON file not found at: [PATH]/tests/[NFT_HASH]/work/validation_output/params.json" + ] ], "meta": { "nf-test": "0.9.2", "nextflow": "25.04.6" }, - "timestamp": "2025-09-01T18:53:47.192116437" + "timestamp": "2025-09-08T18:18:56.487587663" } } \ No newline at end of file diff --git a/validation/topic-channel-citations/main.nf.test b/validation/topic-channel-citations/main.nf.test index 3942845..1e0567a 100644 --- a/validation/topic-channel-citations/main.nf.test +++ b/validation/topic-channel-citations/main.nf.test @@ -1,8 +1,8 @@ nextflow_pipeline { name "Test nf-core-utils topic channel citations functions" - script "../topic-channel-citations/main.nf" - config "../topic-channel-citations/nextflow.config" + script "./main.nf" + config "./nextflow.config" test("Save citations outputs") { @@ -15,16 +15,9 @@ nextflow_pipeline { then { assert workflow.success - assert workflow.exitStatus == 0 - - def stable_path = getAllFilesFromDir(params.outdir) - - // Snapshot the basic workflow execution assert snapshot( - // workflow.stdout, // No workflow.stdout before we can sanitize this with nft-utils - workflow.exitStatus, - workflow.success, - stable_path + filterNextflowOutput(workflow.stdout + workflow.stderr, keepAnsi: true), + getAllFilesFromDir(params.outdir) ).match() } } diff --git a/validation/topic-channel-citations/main.nf.test.snap b/validation/topic-channel-citations/main.nf.test.snap index 53321f8..ef8ab13 100644 --- a/validation/topic-channel-citations/main.nf.test.snap +++ b/validation/topic-channel-citations/main.nf.test.snap @@ -1,8 +1,57 @@ { "Save citations outputs": { "content": [ - 0, - true, + [ + "N E X T F L O W ~ version [VERSION]", + "Launching `[PATH]/topic-channel-citations/./main.nf` [RUN_NAME] DSL2 - revision: [REVISION]", + "Pipeline is starting! \ud83d\ude80", + "==========================================", + "nf-core-utils Plugin Topic Channel Citation E2E Test", + "==========================================", + "This test demonstrates automatic citation collection using:", + "1. Runtime citation extraction via getCitation()", + "2. Topic channel emission from processes", + "3. Automatic aggregation and formatting", + "4. Zero-maintenance citation management", + "=== Collected 7 citation emissions ===", + "Citation: [VIEW, samtools, [description:Tools for dealing with SAM, BAM and CRAM files, homepage:http://www.htslib.org/, documentation:http://www.htslib.org/doc/samtools.html, tool_dev_url:https://github.com/samtools/samtools, doi:10.1093/bioinformatics/btp352, licence:MIT]]", + "Citation: [FASTQC, fastqc, [description:A quality control tool for high throughput sequence data., homepage:https://www.bioinformatics.babraham.ac.uk/projects/fastqc/, documentation:https://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/, tool_dev_url:https://www.bioinformatics.babraham.ac.uk/projects/fastqc/, doi:10.1093/bioinformatics/btw354, licence:GPL v3]]", + "Citation: [MULTIQC, multiqc, [description:MultiQC searches a given directory for analysis logs and compiles a HTML report., homepage:https://multiqc.info/, documentation:https://multiqc.info/docs/, tool_dev_url:https://github.com/ewels/MultiQC, doi:10.1093/bioinformatics/btw354, licence:GPL v3]]", + "==========================================", + "AUTOMATIC CITATION RESULTS", + "==========================================", + "Citation Text:", + "Tools used in the workflow included: samtools (DOI: 10.1093/bioinformatics/btp352), fastqc (DOI: 10.1093/bioinformatics/btw354), multiqc (DOI: 10.1093/bioinformatics/btw354).", + "Bibliography:", + "