From 4c3e85c9b5c2103a3f854cb35dc1e1d68b7a9e92 Mon Sep 17 00:00:00 2001 From: atrigila <18577080+atrigila@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:06:12 +0000 Subject: [PATCH] update tests --- modules/local/edger_qc/tests/edger_qc.nf.test | 25 +++- .../edger_qc/tests/edger_qc.nf.test.snap | 141 +++++------------- 2 files changed, 59 insertions(+), 107 deletions(-) diff --git a/modules/local/edger_qc/tests/edger_qc.nf.test b/modules/local/edger_qc/tests/edger_qc.nf.test index f78de707..d33f9c3b 100644 --- a/modules/local/edger_qc/tests/edger_qc.nf.test +++ b/modules/local/edger_qc/tests/edger_qc.nf.test @@ -20,8 +20,15 @@ nextflow_process { } then { - assert process.success - assert snapshot(process.out).match() + assertAll( + { assert process.success }, + { assert snapshot( + // Snapshot only the stable files (.txt, .csv) and exclude PDFs + process.out.edger_files.get(0).findAll { !it.endsWith('pdf')}, + process.out.versions + ) + .match() } + ) } } @@ -49,10 +56,18 @@ nextflow_process { } then { - assert process.success - assert snapshot(process.out).match() + assertAll( + { assert process.success }, + { assert snapshot( + // Snapshot only the stable files (.txt, .csv) and exclude PDFs + process.out.edger_files.get(0).findAll { !it.endsWith('pdf')}, + process.out.versions, + // Check MDS plot exists + file(process.out.edger_files[0].find { file(it).name == "hairpin_edgeR_MDS_plot.pdf" }).exists() + ) + .match() } + ) } - } } diff --git a/modules/local/edger_qc/tests/edger_qc.nf.test.snap b/modules/local/edger_qc/tests/edger_qc.nf.test.snap index 531e1f5a..4e1b8a65 100644 --- a/modules/local/edger_qc/tests/edger_qc.nf.test.snap +++ b/modules/local/edger_qc/tests/edger_qc.nf.test.snap @@ -1,120 +1,57 @@ { "Should not produce MDS plot": { "content": [ - { - "0": [ - [ - "hairpin_counts.csv:md5,9a2c4c71862349eee5071cf08a81df52", - "hairpin_logtpm.csv:md5,590516d1c7447023933f055446d34552", - "hairpin_logtpm.txt:md5,5cbb1258c290d958910db677490596c0", - "hairpin_normalized_CPM.txt:md5,2f6685750d4c0aa1dc8150276f8a5a2d", - "hairpin_unmapped_read_counts.txt:md5,b3ca3b9f01dbdab1bdbd989769121794", - "mature_counts.csv:md5,17b953ef2fb4e58d83acc263f68755fd", - "mature_logtpm.csv:md5,b4654e4ec264243156b1ceab73503017", - "mature_logtpm.txt:md5,9cba6dd8336de7fe79be641285e92a73", - "mature_normalized_CPM.txt:md5,43db2854ec00e6afca25883b64ad67bd", - "mature_unmapped_read_counts.txt:md5,0e129ffe42aa32f96250a5071d3a7649" - ] - ], - "1": [ - "versions.yml:md5,2e5b1dd3ed5befd1d4c9812a3fcb768a" - ], - "edger_files": [ - [ - "hairpin_counts.csv:md5,9a2c4c71862349eee5071cf08a81df52", - "hairpin_logtpm.csv:md5,590516d1c7447023933f055446d34552", - "hairpin_logtpm.txt:md5,5cbb1258c290d958910db677490596c0", - "hairpin_normalized_CPM.txt:md5,2f6685750d4c0aa1dc8150276f8a5a2d", - "hairpin_unmapped_read_counts.txt:md5,b3ca3b9f01dbdab1bdbd989769121794", - "mature_counts.csv:md5,17b953ef2fb4e58d83acc263f68755fd", - "mature_logtpm.csv:md5,b4654e4ec264243156b1ceab73503017", - "mature_logtpm.txt:md5,9cba6dd8336de7fe79be641285e92a73", - "mature_normalized_CPM.txt:md5,43db2854ec00e6afca25883b64ad67bd", - "mature_unmapped_read_counts.txt:md5,0e129ffe42aa32f96250a5071d3a7649" - ] - ], - "versions": [ - "versions.yml:md5,2e5b1dd3ed5befd1d4c9812a3fcb768a" - ] - } + [ + "hairpin_counts.csv:md5,9a2c4c71862349eee5071cf08a81df52", + "hairpin_logtpm.csv:md5,590516d1c7447023933f055446d34552", + "hairpin_logtpm.txt:md5,5cbb1258c290d958910db677490596c0", + "hairpin_normalized_CPM.txt:md5,2f6685750d4c0aa1dc8150276f8a5a2d", + "hairpin_unmapped_read_counts.txt:md5,b3ca3b9f01dbdab1bdbd989769121794", + "mature_counts.csv:md5,17b953ef2fb4e58d83acc263f68755fd", + "mature_logtpm.csv:md5,b4654e4ec264243156b1ceab73503017", + "mature_logtpm.txt:md5,9cba6dd8336de7fe79be641285e92a73", + "mature_normalized_CPM.txt:md5,43db2854ec00e6afca25883b64ad67bd", + "mature_unmapped_read_counts.txt:md5,0e129ffe42aa32f96250a5071d3a7649" + ], + [ + "versions.yml:md5,2e5b1dd3ed5befd1d4c9812a3fcb768a" + ] ], "meta": { "nf-test": "0.8.4", "nextflow": "24.04.4" }, - "timestamp": "2024-08-20T15:35:12.666335127" + "timestamp": "2024-09-30T19:57:28.863043452" }, "Should produce MDS plot": { "content": [ - { - "0": [ - [ - "hairpin_CPM_heatmap.pdf:md5,5d7ade334680f6fa7f822c9c5059ee97", - "hairpin_counts.csv:md5,4b0fa0e52a7b8b40bdc5930378430136", - "hairpin_edgeR_MDS_distance_matrix.txt:md5,f0eb20be2b7bae7775ef65e03139f5a9", - "hairpin_edgeR_MDS_plot.pdf:md5,27c8a310bdfd200f37068c9fddb80d17", - "hairpin_edgeR_MDS_plot_coordinates.txt:md5,2f1f865b11c4ee5253f80ebe9a1914ee", - "hairpin_log2CPM_sample_distances.txt:md5,20592bfa42e23827dfac02eab1e033ff", - "hairpin_log2CPM_sample_distances_dendrogram.pdf:md5,1bfcdd534efcb49b167ef29981f325ce", - "hairpin_log2CPM_sample_distances_heatmap.pdf:md5,2e8e51bd4778a644bce4c0253f683c0b", - "hairpin_logtpm.csv:md5,35a5449d3468995e8010907105922898", - "hairpin_logtpm.txt:md5,1de707003b6ed2c38372670d69eaf5fb", - "hairpin_normalized_CPM.txt:md5,d42e8eb89175107c5dfbfb2c7da98d37", - "hairpin_unmapped_read_counts.txt:md5,c587147fb1a5b6681c17eff2d4859022", - "mature_CPM_heatmap.pdf:md5,486f30379c552346025d9f25eb9a2e52", - "mature_counts.csv:md5,f961a9d6749dbf0c84dfb8976e0b6516", - "mature_edgeR_MDS_distance_matrix.txt:md5,bfbf327feedbc2e7bbbd57020ae0594c", - "mature_edgeR_MDS_plot.pdf:md5,9f9e312f882ff7e7de70701af4dd0f6b", - "mature_edgeR_MDS_plot_coordinates.txt:md5,b89854153c61a348929ea3901a61bd56", - "mature_log2CPM_sample_distances.txt:md5,b4ed17084de4711e7fd4a12d221d65ec", - "mature_log2CPM_sample_distances_dendrogram.pdf:md5,03c1ff39c90fbc64a1112d93756592fa", - "mature_log2CPM_sample_distances_heatmap.pdf:md5,e4dc113bae6464ad0b914f173f8042b1", - "mature_logtpm.csv:md5,850a8ed0e4559d338578f81dc849acf5", - "mature_logtpm.txt:md5,9087155e2f4bc7f85ced8ab8c02c77e6", - "mature_normalized_CPM.txt:md5,3bc348a1248f9597dfc9e8e465c3c8a8", - "mature_unmapped_read_counts.txt:md5,138cf290420edbf9721b9db861204c9c" - ] - ], - "1": [ - "versions.yml:md5,2e5b1dd3ed5befd1d4c9812a3fcb768a" - ], - "edger_files": [ - [ - "hairpin_CPM_heatmap.pdf:md5,5d7ade334680f6fa7f822c9c5059ee97", - "hairpin_counts.csv:md5,4b0fa0e52a7b8b40bdc5930378430136", - "hairpin_edgeR_MDS_distance_matrix.txt:md5,f0eb20be2b7bae7775ef65e03139f5a9", - "hairpin_edgeR_MDS_plot.pdf:md5,27c8a310bdfd200f37068c9fddb80d17", - "hairpin_edgeR_MDS_plot_coordinates.txt:md5,2f1f865b11c4ee5253f80ebe9a1914ee", - "hairpin_log2CPM_sample_distances.txt:md5,20592bfa42e23827dfac02eab1e033ff", - "hairpin_log2CPM_sample_distances_dendrogram.pdf:md5,1bfcdd534efcb49b167ef29981f325ce", - "hairpin_log2CPM_sample_distances_heatmap.pdf:md5,2e8e51bd4778a644bce4c0253f683c0b", - "hairpin_logtpm.csv:md5,35a5449d3468995e8010907105922898", - "hairpin_logtpm.txt:md5,1de707003b6ed2c38372670d69eaf5fb", - "hairpin_normalized_CPM.txt:md5,d42e8eb89175107c5dfbfb2c7da98d37", - "hairpin_unmapped_read_counts.txt:md5,c587147fb1a5b6681c17eff2d4859022", - "mature_CPM_heatmap.pdf:md5,486f30379c552346025d9f25eb9a2e52", - "mature_counts.csv:md5,f961a9d6749dbf0c84dfb8976e0b6516", - "mature_edgeR_MDS_distance_matrix.txt:md5,bfbf327feedbc2e7bbbd57020ae0594c", - "mature_edgeR_MDS_plot.pdf:md5,9f9e312f882ff7e7de70701af4dd0f6b", - "mature_edgeR_MDS_plot_coordinates.txt:md5,b89854153c61a348929ea3901a61bd56", - "mature_log2CPM_sample_distances.txt:md5,b4ed17084de4711e7fd4a12d221d65ec", - "mature_log2CPM_sample_distances_dendrogram.pdf:md5,03c1ff39c90fbc64a1112d93756592fa", - "mature_log2CPM_sample_distances_heatmap.pdf:md5,e4dc113bae6464ad0b914f173f8042b1", - "mature_logtpm.csv:md5,850a8ed0e4559d338578f81dc849acf5", - "mature_logtpm.txt:md5,9087155e2f4bc7f85ced8ab8c02c77e6", - "mature_normalized_CPM.txt:md5,3bc348a1248f9597dfc9e8e465c3c8a8", - "mature_unmapped_read_counts.txt:md5,138cf290420edbf9721b9db861204c9c" - ] - ], - "versions": [ - "versions.yml:md5,2e5b1dd3ed5befd1d4c9812a3fcb768a" - ] - } + [ + "hairpin_counts.csv:md5,4b0fa0e52a7b8b40bdc5930378430136", + "hairpin_edgeR_MDS_distance_matrix.txt:md5,f0eb20be2b7bae7775ef65e03139f5a9", + "hairpin_edgeR_MDS_plot_coordinates.txt:md5,2f1f865b11c4ee5253f80ebe9a1914ee", + "hairpin_log2CPM_sample_distances.txt:md5,20592bfa42e23827dfac02eab1e033ff", + "hairpin_logtpm.csv:md5,35a5449d3468995e8010907105922898", + "hairpin_logtpm.txt:md5,1de707003b6ed2c38372670d69eaf5fb", + "hairpin_normalized_CPM.txt:md5,d42e8eb89175107c5dfbfb2c7da98d37", + "hairpin_unmapped_read_counts.txt:md5,c587147fb1a5b6681c17eff2d4859022", + "mature_counts.csv:md5,f961a9d6749dbf0c84dfb8976e0b6516", + "mature_edgeR_MDS_distance_matrix.txt:md5,bfbf327feedbc2e7bbbd57020ae0594c", + "mature_edgeR_MDS_plot_coordinates.txt:md5,b89854153c61a348929ea3901a61bd56", + "mature_log2CPM_sample_distances.txt:md5,b4ed17084de4711e7fd4a12d221d65ec", + "mature_logtpm.csv:md5,850a8ed0e4559d338578f81dc849acf5", + "mature_logtpm.txt:md5,9087155e2f4bc7f85ced8ab8c02c77e6", + "mature_normalized_CPM.txt:md5,3bc348a1248f9597dfc9e8e465c3c8a8", + "mature_unmapped_read_counts.txt:md5,138cf290420edbf9721b9db861204c9c" + ], + [ + "versions.yml:md5,2e5b1dd3ed5befd1d4c9812a3fcb768a" + ], + true ], "meta": { "nf-test": "0.8.4", "nextflow": "24.04.4" }, - "timestamp": "2024-08-20T15:39:22.840053942" + "timestamp": "2024-09-30T19:59:15.428541578" } } \ No newline at end of file