Skip to content

Commit 5b49307

Browse files
committed
Abandon snapshot-based tests for hugo-unifier
1 parent 5906940 commit 5b49307

File tree

9 files changed

+92
-182
lines changed

9 files changed

+92
-182
lines changed

modules/local/hugounifier/apply/tests/main.nf.test

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ nextflow_process {
4747
then {
4848
assertAll(
4949
{ assert process.success },
50-
{ assert snapshot(process.out).match() }
50+
{
51+
with(anndata(process.out.h5ad[0][1])) {
52+
assert var.rownames.size() > 0
53+
assert obs.rownames.size() > 0
54+
}
55+
}
5156
)
5257
}
5358

modules/local/hugounifier/apply/tests/main.nf.test.snap

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -31,38 +31,5 @@
3131
"nf-test": "0.9.2",
3232
"nextflow": "25.04.6"
3333
}
34-
},
35-
"Should run without failures": {
36-
"content": [
37-
{
38-
"0": [
39-
[
40-
{
41-
"id": "test"
42-
},
43-
"test_hugounifier.h5ad:md5,c7cdbd7262128dcbd7b90f845188e34f"
44-
]
45-
],
46-
"1": [
47-
"versions.yml:md5,ecf9df8f7cb2a1ab5594ad9543ee32d7"
48-
],
49-
"h5ad": [
50-
[
51-
{
52-
"id": "test"
53-
},
54-
"test_hugounifier.h5ad:md5,c7cdbd7262128dcbd7b90f845188e34f"
55-
]
56-
],
57-
"versions": [
58-
"versions.yml:md5,ecf9df8f7cb2a1ab5594ad9543ee32d7"
59-
]
60-
}
61-
],
62-
"timestamp": "2026-03-10T07:58:54.198227455",
63-
"meta": {
64-
"nf-test": "0.9.4",
65-
"nextflow": "25.10.2"
66-
}
6734
}
68-
}
35+
}

modules/local/hugounifier/get/tests/main.nf.test

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,17 @@ nextflow_process {
3131
then {
3232
assertAll(
3333
{ assert process.success },
34-
{ assert snapshot(process.out).match() }
34+
{ assert process.out.changes[0][1].size() == 2 },
35+
{
36+
with(path(process.out.changes[0][1][0]).csv) {
37+
assert columnNames == ["action", "symbol", "new", "reason"]
38+
}
39+
},
40+
{
41+
with(path(process.out.changes[0][1][1]).csv) {
42+
assert columnNames == ["action", "symbol", "new", "reason"]
43+
}
44+
}
3545
)
3646
}
3747

modules/local/hugounifier/get/tests/main.nf.test.snap

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -37,44 +37,5 @@
3737
"nf-test": "0.9.2",
3838
"nextflow": "25.04.6"
3939
}
40-
},
41-
"Should run without failures": {
42-
"content": [
43-
{
44-
"0": [
45-
[
46-
{
47-
"id": "test"
48-
},
49-
[
50-
"sample1.csv:md5,912f7444a187b1f8094c1f85b5282945",
51-
"sample2.csv:md5,bba30f28971437148138af65bd42aee0"
52-
]
53-
]
54-
],
55-
"1": [
56-
"versions.yml:md5,4c8215f5c744a2bf227901bd8c53bf13"
57-
],
58-
"changes": [
59-
[
60-
{
61-
"id": "test"
62-
},
63-
[
64-
"sample1.csv:md5,912f7444a187b1f8094c1f85b5282945",
65-
"sample2.csv:md5,bba30f28971437148138af65bd42aee0"
66-
]
67-
]
68-
],
69-
"versions": [
70-
"versions.yml:md5,4c8215f5c744a2bf227901bd8c53bf13"
71-
]
72-
}
73-
],
74-
"timestamp": "2026-03-10T07:56:17.593716871",
75-
"meta": {
76-
"nf-test": "0.9.4",
77-
"nextflow": "25.10.2"
78-
}
7940
}
80-
}
41+
}

nf-test.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ config {
2121
plugins {
2222
load "nft-utils@0.0.3"
2323
load "nft-anndata@0.1.0"
24+
load "nft-csv@0.1.0"
2425
}
2526
}

subworkflows/local/unify/tests/main.nf.test

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,33 @@ nextflow_workflow {
119119

120120
}
121121

122+
test("Should run without failures - symbol_col index, unify_gene_symbols false, snapshot stability") {
123+
124+
when {
125+
params {
126+
outdir = "$outputDir"
127+
unify_gene_symbols = false
128+
}
129+
workflow {
130+
"""
131+
input[0] = channel.of([
132+
[id: 'test', symbol_col: 'index', batch_col: 'batch', label_col: ''],
133+
file(params.pipelines_testdata_base_path + '/anndata-variations/symbols_as_index.h5ad', checkIfExists: true)
134+
])
135+
input[1] = false
136+
input[2] = 'sum'
137+
input[3] = false
138+
"""
139+
}
140+
}
141+
142+
then {
143+
assert workflow.success
144+
assert snapshot(workflow.out).match()
145+
}
146+
147+
}
148+
122149
test("Should run without failures - symbol_col index, unify_gene_symbols true - stub") {
123150

124151
options '-stub'
@@ -169,8 +196,16 @@ nextflow_workflow {
169196
}
170197

171198
then {
172-
assert workflow.success
173-
assert snapshot(workflow.out).match()
199+
def filename = workflow.out.h5ad[0][1]
200+
assertAll(
201+
{ assert workflow.success },
202+
{
203+
with(anndata(filename)) {
204+
assert var.rownames.size() > 0
205+
assert obs.rownames.size() > 0
206+
}
207+
}
208+
)
174209
}
175210

176211
}

subworkflows/local/unify/tests/main.nf.test.snap

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@
101101
]
102102
}
103103
],
104-
"timestamp": "2026-01-18T21:22:29.899026309",
104+
"timestamp": "2026-01-18T21:22:29.899006309",
105105
"meta": {
106106
"nf-test": "0.9.2",
107107
"nextflow": "25.10.2"
108108
}
109109
},
110-
"Should run without failures - symbol_col index, unify_gene_symbols true": {
110+
"Should run without failures - symbol_col index, unify_gene_symbols false, snapshot stability": {
111111
"content": [
112112
{
113113
"0": [
@@ -121,18 +121,15 @@
121121
"unknown_label": "unknown",
122122
"counts_layer": "X"
123123
},
124-
"test_unified.h5ad:md5,a9ac476adb2844de8640bf5fcaa0e0b9"
124+
"test_unified.h5ad:md5,634cda43f3cc2ce7ffeddcd8cb0a1e76"
125125
]
126126
],
127127
"1": [
128128

129129
],
130130
"2": [
131131
"versions.yml:md5,28f13636db3e448a09677ac7d2de39dc",
132-
"versions.yml:md5,4e6f35e1d0c91cec3120567db9f0bdfe",
133-
"versions.yml:md5,56867b1608bf70187c185b4fecb3eab7",
134-
"versions.yml:md5,b080fe0c3ed4678d71941f74947dc2e4",
135-
"versions.yml:md5,e9c711a68f147215c1754f64ca792664"
132+
"versions.yml:md5,b080fe0c3ed4678d71941f74947dc2e4"
136133
],
137134
"h5ad": [
138135
[
@@ -145,25 +142,22 @@
145142
"unknown_label": "unknown",
146143
"counts_layer": "X"
147144
},
148-
"test_unified.h5ad:md5,a9ac476adb2844de8640bf5fcaa0e0b9"
145+
"test_unified.h5ad:md5,634cda43f3cc2ce7ffeddcd8cb0a1e76"
149146
]
150147
],
151148
"multiqc_files": [
152149

153150
],
154151
"versions": [
155152
"versions.yml:md5,28f13636db3e448a09677ac7d2de39dc",
156-
"versions.yml:md5,4e6f35e1d0c91cec3120567db9f0bdfe",
157-
"versions.yml:md5,56867b1608bf70187c185b4fecb3eab7",
158-
"versions.yml:md5,b080fe0c3ed4678d71941f74947dc2e4",
159-
"versions.yml:md5,e9c711a68f147215c1754f64ca792664"
153+
"versions.yml:md5,b080fe0c3ed4678d71941f74947dc2e4"
160154
]
161155
}
162156
],
163-
"timestamp": "2026-03-10T09:06:13.565614981",
157+
"timestamp": "2026-03-12T19:00:45.019297969",
164158
"meta": {
165159
"nf-test": "0.9.4",
166-
"nextflow": "25.10.2"
160+
"nextflow": "25.10.4"
167161
}
168162
},
169163
"Should run without failures - symbol_col index, unify_gene_symbols false - stub": {
@@ -274,7 +268,7 @@
274268
]
275269
}
276270
],
277-
"timestamp": "2026-01-18T17:41:17.198406767",
271+
"timestamp": "2026-01-18T17:41:17.198064779",
278272
"meta": {
279273
"nf-test": "0.9.2",
280274
"nextflow": "25.04.6"

subworkflows/local/unify_genes/tests/main.nf.test

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,16 @@ nextflow_workflow {
4949
}
5050

5151
then {
52-
assert workflow.success
53-
assert snapshot(workflow.out).match()
52+
def filename = workflow.out.h5ad[0][1]
53+
assertAll(
54+
{ assert workflow.success },
55+
{
56+
with(anndata(filename)) {
57+
assert var.rownames.size() > 0
58+
assert obs.rownames.size() > 0
59+
}
60+
}
61+
)
5462
}
5563

5664
}
@@ -97,8 +105,21 @@ nextflow_workflow {
97105
}
98106

99107
then {
100-
assert workflow.success
101-
assert snapshot(workflow.out).match()
108+
assertAll(
109+
{ assert workflow.success },
110+
{
111+
with(anndata(workflow.out.h5ad[0][1])) {
112+
assert var.rownames.size() > 0
113+
assert obs.rownames.size() > 0
114+
}
115+
},
116+
{
117+
with(anndata(workflow.out.h5ad[1][1])) {
118+
assert var.rownames.size() > 0
119+
assert obs.rownames.size() > 0
120+
}
121+
}
122+
)
102123
}
103124

104125
}
Lines changed: 1 addition & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,4 @@
11
{
2-
"Should run without failures - single sample": {
3-
"content": [
4-
{
5-
"0": [
6-
[
7-
{
8-
"id": "test"
9-
},
10-
"test_hugounifier.h5ad:md5,c7cdbd7262128dcbd7b90f845188e34f"
11-
]
12-
],
13-
"1": [
14-
"versions.yml:md5,a25a9f067f9ece70fa40d51efbcdbdee",
15-
"versions.yml:md5,ff9e30a2b6a2a38e584c66fc01f53b5e"
16-
],
17-
"h5ad": [
18-
[
19-
{
20-
"id": "test"
21-
},
22-
"test_hugounifier.h5ad:md5,c7cdbd7262128dcbd7b90f845188e34f"
23-
]
24-
],
25-
"versions": [
26-
"versions.yml:md5,a25a9f067f9ece70fa40d51efbcdbdee",
27-
"versions.yml:md5,ff9e30a2b6a2a38e584c66fc01f53b5e"
28-
]
29-
}
30-
],
31-
"timestamp": "2026-03-10T08:00:45.100584607",
32-
"meta": {
33-
"nf-test": "0.9.4",
34-
"nextflow": "25.10.2"
35-
}
36-
},
372
"Should run without failures - multiple samples - stub": {
383
"content": [
394
{
@@ -117,54 +82,5 @@
11782
"nf-test": "0.9.2",
11883
"nextflow": "25.04.6"
11984
}
120-
},
121-
"Should run without failures - multiple samples": {
122-
"content": [
123-
{
124-
"0": [
125-
[
126-
{
127-
"id": "test1"
128-
},
129-
"test1_hugounifier.h5ad:md5,c7cdbd7262128dcbd7b90f845188e34f"
130-
],
131-
[
132-
{
133-
"id": "test2"
134-
},
135-
"test2_hugounifier.h5ad:md5,c7cdbd7262128dcbd7b90f845188e34f"
136-
]
137-
],
138-
"1": [
139-
"versions.yml:md5,a25a9f067f9ece70fa40d51efbcdbdee",
140-
"versions.yml:md5,ff9e30a2b6a2a38e584c66fc01f53b5e",
141-
"versions.yml:md5,ff9e30a2b6a2a38e584c66fc01f53b5e"
142-
],
143-
"h5ad": [
144-
[
145-
{
146-
"id": "test1"
147-
},
148-
"test1_hugounifier.h5ad:md5,c7cdbd7262128dcbd7b90f845188e34f"
149-
],
150-
[
151-
{
152-
"id": "test2"
153-
},
154-
"test2_hugounifier.h5ad:md5,c7cdbd7262128dcbd7b90f845188e34f"
155-
]
156-
],
157-
"versions": [
158-
"versions.yml:md5,a25a9f067f9ece70fa40d51efbcdbdee",
159-
"versions.yml:md5,ff9e30a2b6a2a38e584c66fc01f53b5e",
160-
"versions.yml:md5,ff9e30a2b6a2a38e584c66fc01f53b5e"
161-
]
162-
}
163-
],
164-
"timestamp": "2026-03-10T08:01:28.835317824",
165-
"meta": {
166-
"nf-test": "0.9.4",
167-
"nextflow": "25.10.2"
168-
}
16985
}
170-
}
86+
}

0 commit comments

Comments
 (0)