Skip to content

Commit 7a7cc36

Browse files
committed
fix tests
1 parent acb3718 commit 7a7cc36

3 files changed

Lines changed: 12 additions & 21 deletions

File tree

cleanup-workdir/tests/checker.nf

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,7 @@
2020
Junjun Zhang
2121
*/
2222

23-
/*
24-
This is an auto-generated checker workflow to test the generated main template workflow, it's
25-
meant to illustrate how testing works. Please update to suit your own needs.
26-
*/
27-
28-
/********************************************************************/
29-
/* this block is auto-generated based on info from pkg.json where */
30-
/* changes can be made if needed, do NOT modify this block manually */
3123
nextflow.enable.dsl = 2
32-
version = '1.0.0' // package version
33-
34-
container = [
35-
'ghcr.io': 'ghcr.io/icgc-argo/data-processing-utility-tools.cleanup-workdir'
36-
]
37-
default_container_registry = 'ghcr.io'
38-
/********************************************************************/
3924

4025
// universal params
4126
params.container_registry = ""
@@ -98,7 +83,7 @@ workflow {
9883
// perform cleanup in gFile1 workdir
9984
cleanupWorkdir(
10085
gFile1.out.collect(),
101-
gFile2.out.file.collect() // flag enables waiting for gFile2 before cleaning up gFile1 workdir
86+
fExist1.out.collect() // flag enables waiting for fExist1 before cleaning up gFile1 workdir
10287
)
10388

10489
// test cleaned up workdir from gFile1 indeed does not have previous files

cleanup-workdir/tests/files-exist.nf

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ nextflow.enable.dsl = 2
2929
version = '1.0.0' // package version
3030

3131
container = [
32-
'ghcr.io': 'ghcr.io/icgc-argo/data-processing-utility-tools.helper-functions'
32+
'ghcr.io': 'ghcr.io/icgc-argo/data-processing-utility-tools.cleanup-workdir'
3333
]
3434
default_container_registry = 'ghcr.io'
3535
/********************************************************************/
@@ -49,23 +49,29 @@ process filesExist {
4949
path files
5050
val dependency_flag // any output from process(es) you'd like to make this process depend on
5151

52+
output:
53+
stdout()
54+
5255
script:
5356
file_name_arg = file_names instanceof List ? file_names.join(" ") : file_names
5457
"""
5558
if [[ "${expect}" = "exist" ]]; then
5659
for f in \$(echo "${file_name_arg}"); do
5760
if [[ ! -f \$f ]]; then
58-
exit "Expected \$f not exists."
61+
echo "Expected \$f not exists."
62+
exit 1
5963
fi
6064
done
6165
elif [[ "${expect}" = "not_exist" ]]; then
6266
for f in \$(echo "${file_name_arg}"); do
6367
if [[ -f \$f ]]; then
64-
exit "Unexpected \$f exists."
68+
echo "Unexpected \$f exists."
69+
exit 1
6570
fi
6671
done
6772
else
68-
exit "Second argument must be either 'exist' or 'not_exist'. '${expect}' is supplied."
73+
echo "Second argument must be either 'exist' or 'not_exist'. '${expect}' is supplied."
74+
exit 1
6975
fi
7076
"""
7177
}

cleanup-workdir/tests/generate-dummy-file.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ nextflow.enable.dsl = 2
2929
version = '1.0.0' // package version
3030

3131
container = [
32-
'ghcr.io': 'ghcr.io/icgc-argo/data-processing-utility-tools.helper-functions'
32+
'ghcr.io': 'ghcr.io/icgc-argo/data-processing-utility-tools.cleanup-workdir'
3333
]
3434
default_container_registry = 'ghcr.io'
3535
/********************************************************************/

0 commit comments

Comments
 (0)