Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a nextflow module with the same name as a nextflow operator causes recursion. #579

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/test/resources/testnextflowvdsl3/src/concat/config.vsh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
functionality:
name: concat
arguments:
- name: "--input"
type: file
required: true
example: input.txt
- name: "--output"
type: file
required: true
direction: output
example: output.txt
resources:
- type: bash_script
path: script.sh
platforms:
- type: native
- type: docker
image: nextflow/bash:latest
- type: nextflow
1 change: 1 addition & 0 deletions src/test/resources/testnextflowvdsl3/src/concat/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cp "$par_input" "$par_output"
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
functionality:
name: operator_conflict
namespace: test_wfs
resources:
- type: nextflow_script
path: main.nf
entrypoint: base
# TODO: make absolute when the ns build uses the right CWD
- path: ../../../resources
dependencies:
- name: concat
platforms:
- type: nextflow
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

workflow base {
take: input_ch
main:

// generate list from 0 to 1
ch = Channel.fromList(0..1)
| map { num ->
// create temporary file
file = tempFile()
file.write("num: $num")

["num$num", [ num: num, file: file ]]
}
| concat.run(
fromState: ["input": "input"],
toState: {id, output, state ->
def newState = [
"step1_output": output.output,
"num": state.num,
"file": state.file
]
return newState
}
)


emit:
input_ch
}
12 changes: 12 additions & 0 deletions src/test/scala/io/viash/runners/nextflow/NextflowScriptTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,18 @@ class NextflowScriptTest extends AnyFunSuite with BeforeAndAfterAll {
assert(exitCode == 0, s"\nexit code was $exitCode\nStd output:\n$stdOut\nStd error:\n$stdErr")
}

test("Test conflicts with nextlow operator", DockerTest, NextflowTest) {
val (exitCode, stdOut, stdErr) = NextflowTestHelper.run(
mainScript = "target/nextflow/test_wfs/operator_conflict/main.nf",
args = List(
"--publish_dir", "output"
),
cwd = tempFolFile
)

assert(exitCode == 0, s"\nexit code was $exitCode\nStd output:\n$stdOut\nStd error:\n$stdErr")
}


test("Test nested workflows", DockerTest, NextflowTest) {
val (exitCode, stdOut, stdErr) = NextflowTestHelper.run(
Expand Down
Loading