diff --git a/modules/haplocheck/main.nf b/modules/haplocheck/main.nf index 92c6c3b4..2dae20ae 100644 --- a/modules/haplocheck/main.nf +++ b/modules/haplocheck/main.nf @@ -11,9 +11,9 @@ process HAPLOCHECK { tuple val(meta), path(vcf) output: - tuple val(meta), path("*.txt"), emit: txt + tuple val(meta), path("*.txt") , emit: txt tuple val(meta), path("*.html"), emit: html - path "versions.yml" , emit: versions + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -29,4 +29,16 @@ process HAPLOCHECK { haplocheck: \$(echo \$(haplocheck --version 2>&1) | cut -f 2 -d " " ) END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch $prefix.txt + touch $prefix.html + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + haplocheck: \$(echo \$(haplocheck --version 2>&1) | cut -f 2 -d " " ) + END_VERSIONS + """ } diff --git a/tests/modules/haplocheck/test.yml b/tests/modules/haplocheck/test.yml index 4da5365a..69a816fc 100644 --- a/tests/modules/haplocheck/test.yml +++ b/tests/modules/haplocheck/test.yml @@ -1,11 +1,20 @@ -- name: "haplocheck" +- name: haplocheck test_haplocheck command: nextflow run ./tests/modules/haplocheck -entry test_haplocheck -c ./tests/config/nextflow.config -c ./tests/modules/haplocheck/nextflow.config tags: - - "haplocheck" + - haplocheck files: - - path: "output/haplocheck/test.html" + - path: output/haplocheck/test.html md5sum: 59d69052c86edff0301816956eaf4d5f - path: output/haplocheck/test.raw.txt md5sum: 69f4e5b28a59b97fc19eb8e8b650d9d5 - path: output/haplocheck/versions.yml md5sum: 94e2fa3ceb3946487319f92cea08c942 + +- name: haplocheck test_haplocheck using stubs + command: nextflow run ./tests/modules/haplocheck -entry test_haplocheck -c ./tests/config/nextflow.config -c ./tests/modules/haplocheck/nextflow.config -stub-run + tags: + - haplocheck + files: + - path: output/haplocheck/test.html + - path: output/haplocheck/test.raw.txt + - path: output/haplocheck/versions.yml