Skip to content
Open
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
4 changes: 4 additions & 0 deletions modules/local/ena_webin_cli/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ process ENA_WEBIN_CLI {
# there was attempt to re-submit already submitted genome
export STATUS="success"
true
elif grep -q "Submission(s) validated successfully" "${prefix}_webin-cli.report"; then
# we ran with -validate flag
export STATUS="success"
true
else
export STATUS="failed"
false
Expand Down
86 changes: 86 additions & 0 deletions modules/local/ena_webin_cli/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
nextflow_process {

name "Test Process ENA_WEBIN_CLI"
script "modules/local/ena_webin_cli/main.nf"
process "ENA_WEBIN_CLI"

test("Run validate with no failures") {

when {
params {
webincli_submit = false
}
process {
"""
input[0] = Channel.of(
tuple(
[id: 'lachnospira_eligens'],
file("https://github.com/nf-core/test-datasets/raw/refs/heads/seqsubmit/test_data/bins/bin_lachnospira_eligens.fa.gz", checkIfExists: true),
file("https://github.com/nf-core/test-datasets/raw/refs/heads/seqsubmit/test_data/lachnospira_eligens.manifest", checkIfExists: true)
)
)
"""
}
}

then {
assertAll {
assert process.success
assert process.out.upload_status[0][1] == 'success'
assert path(process.out.webin_report[0][1]).readLines()[0].contains("Submission(s) validated successfully")
assert snapshot(process.out.versions).match()
}
}

}

test("Run push with no failures") {
setup {
run("GENERATE_TEST_DATA") {
script "./setup_test.nf"
process {
"""
input[0] = Channel.of(
file("https://github.com/nf-core/test-datasets/raw/refs/heads/seqsubmit/test_data/lachnospira_eligens.manifest", checkIfExists: true)
)
"""
}
}

}

when {
params {
webincli_submit = true
test_upload = true
}
process {
"""
def fasta = file("https://github.com/nf-core/test-datasets/raw/refs/heads/seqsubmit/test_data/bins/bin_lachnospira_eligens.fa.gz", checkIfExists: true)

input[0] = GENERATE_TEST_DATA.out.test_manifest.map { manifest ->
tuple(
[id: 'lachnospira_eligens'],
fasta,
file(manifest)
)
}
"""
}
}

then {
assertAll {
assert process.success
assert process.out.upload_status[0][1] == 'success'
assert snapshot(process.out.versions).match()
assert path(process.out.webin_report[0][1]).readLines()[1].contains("Submission(s) validated successfully")
assert path(process.out.webin_report[0][1]).readLines()[5].contains("The submission has been completed successfully")
assert path(process.out.webin_report[0][1]).readLines()[6].contains("This was a TEST submission(s)")

}
}

}

}
26 changes: 26 additions & 0 deletions modules/local/ena_webin_cli/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"Run validate with no failures": {
"content": [
[
"versions.yml:md5,a38fb03bead632d71062a101d7889ded"
]
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.04.8"
},
"timestamp": "2025-10-29T14:09:00.202532371"
},
"Run push with no failures": {
"content": [
[
"versions.yml:md5,a38fb03bead632d71062a101d7889ded"
]
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.04.8"
},
"timestamp": "2025-10-29T14:01:42.491885321"
}
}
17 changes: 17 additions & 0 deletions modules/local/ena_webin_cli/setup_test.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
process GENERATE_TEST_DATA {
label 'process_low'
container "quay.io/biocontainers/ena-webin-cli:9.0.1--hdfd78af_1"

input:
path(manifest_template)

output:
path("*.manifest"), emit: test_manifest

script:
"""
timestamp="\$(date +%s)"

sed -E "s/^(ASSEMBLYNAME\t[^\t]+)/\\1_\${timestamp}/" "${manifest_template}" > "lachnospira_eligens_dynamic_fixture.manifest"
"""
}
Loading