Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
  • Loading branch information
bentsherman committed Feb 6, 2025
1 parent d3705d4 commit 550377e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ An alternative method to build and test the plugin for development purposes:
make install

# run with regular nextflow install
nextflow run tests/test.nf
nextflow run tests/test.nf -plugins nf-prov@<version>
```

## Package, Upload, and Publish
Expand Down
12 changes: 12 additions & 0 deletions tests/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,22 @@ prov {
wrroc {
file = "${params.outdir}/ro-crate-metadata.json"
overwrite = true
license = "https://spdx.org/licenses/Apache-2.0"
}
}
}

manifest {
name = "nf-prov-test"
contributors = [
[name: "Bruno Grande", contribution: ["AUTHOR"]],
[name: "Ben Sherman", contribution: ["MAINTAINER"]],
[name: "Stephen Kelly", contribution: ["CONTRIBUTOR"]]
]
homePage = "https://github.com/nextflow-io/nf-prov"
description = "Test pipeline for nf-prov"
mainScript = "test.nf"
nextflowVersion = "!>=24.10.0"
version = "0.3.0"
license = "https://spdx.org/licenses/Apache-2.0"
}
27 changes: 12 additions & 15 deletions tests/test.nf
Original file line number Diff line number Diff line change
@@ -1,45 +1,42 @@
nextflow.enable.dsl=2

process RNG {
params.constant = "foo"

process ECHO_SCRIPT {
tag "${prefix}"
publishDir "${params.outdir}", mode: 'copy'
publishDir params.outdir, mode: 'copy'

input:
tuple val(prefix), val(constant)

output:
tuple val(prefix), val(constant), emit: 'values'
path "*.txt", emit: 'file'
tuple val(prefix), val(constant), path("*.txt")

script:
"""
echo \$RANDOM > ${prefix}.${constant}.1.txt
echo \$RANDOM > ${prefix}.${constant}.2.txt
"""

}

// shows nf-prov behavior with exec tasks
process EXEC_FOO {
process ECHO_EXEC {
tag "${prefix}"
publishDir "${params.outdir}", mode: 'copy'
publishDir params.outdir, mode: 'copy'

input:
tuple val(prefix), val(constant)

output:
path(outputfile), emit: "txt"
path(outfile), emit: txt

exec:
outputfile = task.workDir.resolve("${prefix}.exec_foo.txt")
outputfile.write(prefix)
outfile = "${prefix}.exec.txt"
task.workDir.resolve(outfile).write(prefix)
}

workflow {
prefixes_ch = channel.from('r1', 'r2', 'r3')
constant_ch = channel.of(params.constant)
inputs_ch = prefixes_ch.combine(constant_ch)
RNG(inputs_ch)
RNG.output.values.view()
EXEC_FOO(inputs_ch)
ECHO_SCRIPT(inputs_ch)
ECHO_EXEC(inputs_ch)
}

0 comments on commit 550377e

Please sign in to comment.