Skip to content

Commit 2b1603e

Browse files
committed
feat: add test for module reinstall
1 parent 64d63c1 commit 2b1603e

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ work/
3737

3838
# Text editor
3939
.vscode
40+
41+
# macOS
42+
.DS_Store

tests/nfcoreInstall/main.nf.test

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,38 @@ nextflow_process {
2121
)
2222
}
2323

24+
cleanup {
25+
new File("${launchDir}/library/").deleteDir()
26+
}
27+
28+
}
29+
30+
test("test module list - reinstall") {
31+
32+
setup {
33+
// Install module
34+
nfcoreInitialise("${launchDir}/library/")
35+
nfcoreInstall("${launchDir}/library/", ["minimap2/index"])
36+
37+
// Delete module files
38+
new File("${launchDir}/library/modules/nf-core/minimap2/").deleteDir()
39+
new File("${launchDir}/library/modules.json").delete()
40+
41+
// Install module again (shouldn't create new files)
42+
nfcoreInstall("${launchDir}/library/", ["minimap2/index"])
43+
}
44+
45+
then {
46+
assertAll(
47+
{ assert !path("${launchDir}/library/modules.json").exists() },
48+
{ assert !path("${launchDir}/library/modules/nf-core/minimap2/").exists() }
49+
)
50+
}
51+
52+
cleanup {
53+
new File("${launchDir}/library/").deleteDir()
54+
}
55+
2456
}
2557

2658
test("test module map") {
@@ -72,6 +104,10 @@ nextflow_process {
72104
)
73105
}
74106

107+
cleanup {
108+
new File("${launchDir}/library/").deleteDir()
109+
}
110+
75111
}
76112

77113
}

0 commit comments

Comments
 (0)