Open adamrtalbot opened 8 months ago
See https://github.com/nf-core/modules/pull/5278 for an example
Hi Adam,
thanks, I tried to replicate this issue, but I only see this behaviour if the path of the input file is wrong. I was able to run the test with both empty and non-empty files.
nextflow_workflow {
name "Test Workflow TEST"
script "./workflow.nf"
workflow "TEST"
test("Should run without failures") {
when {
workflow {
"""
// define inputs of the workflow here. Example:
input[0] = Channel.of(
file("${moduleDir}/test-file2.txt", checkIfExists: true)
)
"""
}
}
then {
assert workflow.success
assert snapshot(workflow.out).match()
}
}
}
See here: https://github.com/askimed/nf-test/commit/d8441aff602247d011fbb377b0cb144f7ecc0574
If you pass an input file to an output file directly, the snapshot includes the absolute path of the input file. This causes problems because the snapshot is not transferable.
workflow.nf:
workflow.nf.test:
test-file.txt
is a blank file.Resulting snapshot (on my mac):