Skip to content

Commit 227a6b7

Browse files
committed
test: update nf-test
1 parent 53c89a7 commit 227a6b7

File tree

2 files changed

+18
-32
lines changed

2 files changed

+18
-32
lines changed

modules/local/compute_gene_scores/tests/main.nf.test

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,21 @@ nextflow_process {
2020
then {
2121
assertAll(
2222
{ assert process.success },
23-
{ assert snapshot(process.out).match() },
23+
{
24+
def files = process.out.scores_for_mqc[0][1]
25+
def signatureScoresFile = files.find { file(it).name.contains('signature_scores_mqc') }
26+
def signatureQcFile = files.find { file(it).name.contains('signature_scores_qc_mqc') }
27+
28+
// Round floating-point numbers to 2 decimal places
29+
def scoresContent = file(signatureScoresFile).text.replaceAll(/(-?\d+\.\d+)/) { match ->
30+
String.format("%.2f", Double.parseDouble(match[1]))
31+
}
32+
33+
assert snapshot(
34+
scoresContent,
35+
file(signatureQcFile).text
36+
).match()
37+
}
2438
)
2539
}
2640
}

modules/local/compute_gene_scores/tests/main.nf.test.snap

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,14 @@
11
{
22
"test profile": {
33
"content": [
4-
{
5-
"0": [
6-
[
7-
{
8-
"id": "test"
9-
},
10-
[
11-
"signature_scores_mqc.txt:md5,315dc730c79b02067b542074eaeb07b9",
12-
"signature_scores_qc_mqc.txt:md5,88ec48e1d7488357663557b378615923"
13-
]
14-
]
15-
],
16-
"1": [
17-
"versions.yml:md5,267e6a81e12563418edabbdaa1a5ef79"
18-
],
19-
"scores_for_mqc": [
20-
[
21-
{
22-
"id": "test"
23-
},
24-
[
25-
"signature_scores_mqc.txt:md5,315dc730c79b02067b542074eaeb07b9",
26-
"signature_scores_qc_mqc.txt:md5,88ec48e1d7488357663557b378615923"
27-
]
28-
]
29-
],
30-
"versions": [
31-
"versions.yml:md5,267e6a81e12563418edabbdaa1a5ef79"
32-
]
33-
}
4+
"# id: nf-core-nanoflow-signature-score\n# section_name: 'Signature Scores'\n# description: 'Signature Scores: Algorithm: plage.dir'\n# plot_type: 'heatmap'\n# section_href: 'https://github.com/nf-core/nanoflow'\nsample\tsalmon_01_01.RCC\tsalmon_03_03.RCC\tsalmon_02_02.RCC\tsalmon_04_04.RCC\n1\t0.26\t0.60\t-0.75\t-0.12\n",
5+
"# id: nf-core-nanoflow-signature-score-qc\n# section_name: 'Signature Score QC'\n# description: 'Compare Signatures to Expression Matrix'\n# plot_type: 'table'\n# section_href: 'https://github.com/nf-core/nanoflow'\ngeneset\tsize.geneset\tsize.missing\tsize.left\tgenes.missing\tgenes.used\ntestscore\t6\t1\t5\tG6PDH\tCB-2, HNF4, orexin, MT2, CART\n"
346
],
357
"meta": {
368
"nf-test": "0.9.2",
379
"nextflow": "25.04.6"
3810
},
39-
"timestamp": "2025-09-03T18:30:49.272399939"
11+
"timestamp": "2025-09-04T13:10:59.407071654"
4012
},
4113
"stub": {
4214
"content": [

0 commit comments

Comments
 (0)