From ec57c62d05efe90416bde2827c1d7cf1f76cfd87 Mon Sep 17 00:00:00 2001 From: alessiovignoli Date: Fri, 7 Jun 2024 12:04:53 +0200 Subject: [PATCH] debugging nf-test input file not found --- nf-test.config | 2 +- tests/handle_data.nf.test | 29 +++++++++++++++++++++++++++++ tests/main.nf.test | 28 ---------------------------- 3 files changed, 30 insertions(+), 29 deletions(-) create mode 100644 tests/handle_data.nf.test delete mode 100644 tests/main.nf.test diff --git a/nf-test.config b/nf-test.config index 05d6fda..82d2611 100644 --- a/nf-test.config +++ b/nf-test.config @@ -1,5 +1,5 @@ config { - // Location of nf-tests + // Location of nf-tests testsDir "." // nf-test directory used to create temporary files for each test diff --git a/tests/handle_data.nf.test b/tests/handle_data.nf.test new file mode 100644 index 0000000..0eddef6 --- /dev/null +++ b/tests/handle_data.nf.test @@ -0,0 +1,29 @@ + +nextflow_workflow { + + name "Test Workflow HANDLE_DATA" + script "../workflows/handle_data.nf" + workflow "HANDLE_DATA" + + test("Test reproducibility of data handling") { + + when { + workflow { + """ + input[0] = Channel.fromPath(params.csv) + input[1] = Channel.fromPath(params.exp_conf) + input[2] = Channel.of("TESTING") + """ + } + } + + then { + + assert workflow.success + + with(workflow.out.data) { + assert size() == 2 + } + } + } +} \ No newline at end of file diff --git a/tests/main.nf.test b/tests/main.nf.test deleted file mode 100644 index f2451bf..0000000 --- a/tests/main.nf.test +++ /dev/null @@ -1,28 +0,0 @@ -nextflow_pipeline { - - name "Test Workflow main.nf" - script "main.nf" - tag "PIPELINE" - - test("Default test for reproducibility") { - - when { - params { - outdir = "$outputDir" - // skip the check module step for now maybe change it in the future - check_model = false - } - } - - then { - assertAll( - { assert workflow.success }, - { assert snapshot(UTILS.removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml")).match("software_versions") }, - { assert snapshot( - path( "${params.outdir}/${workflow.runName}_" + "${workflow.start}/".replaceAll('[-:]', '_').split('\\.')[0] + "/test_with_split-shuffle/experiment_config.json" ) - ).match("output_files") - } - ) - } - } -}