Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nf-test assertions #128

Merged
merged 5 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:

- name: Run nf-test
run: |
nf-test test --tag ${{ matrix.profile }} --profile ${{ matrix.profile }},docker --junitxml=test.xml
nf-test test --tag ${{ matrix.profile }} --profile ${{ matrix.profile }},docker --junitxml=test.xml --verbose

- name: Output log on failure
if: failure()
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
run: |
nextflow secrets set NCBI_EMAIL ${{ secrets.NCBI_EMAIL }}
nextflow secrets set NCBI_KEY ${{ secrets.NCBI_KEY }}
nf-test test --tag ${{ matrix.profile }} --profile ${{ matrix.profile }},docker --junitxml=test.xml
nf-test test --tag ${{ matrix.profile }} --profile ${{ matrix.profile }},docker --junitxml=test.xml --verbose

- name: Output log on failure
if: failure()
Expand Down
28 changes: 27 additions & 1 deletion tests/pipeline/test.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,33 @@ nextflow_pipeline {
}

then {
assert workflow.success
assertAll(
{ assert workflow.success },
{ assert new File("$outputDir/multiqc/multiqc_report.html").exists() },
{ assert new File("$outputDir/pipeline_info/nf_core_pipeline_software_mqc_versions.yml").exists() },
{ assert snapshot(path("$outputDir/db_tables/alleles.tsv"),
path("$outputDir/db_tables/conditions_alleles.tsv"),
path("$outputDir/db_tables/conditions.tsv"),
path("$outputDir/db_tables/entities_proteins.tsv"),
path("$outputDir/db_tables/entities.tsv"),
path("$outputDir/db_tables/microbiomes_entities.no_weights.tsv"),
path("$outputDir/db_tables/microbiomes_entities.nucl.tsv"),
path("$outputDir/db_tables/microbiomes_entities.tsv"),
path("$outputDir/db_tables/microbiomes.tsv"),
path("$outputDir/db_tables/proteins_peptides.tsv"),
path("$outputDir/db_tables/peptides.tsv.gz"),
path("$outputDir/db_tables/proteins.tsv.gz"),
path("$outputDir/db_tables/predictions.tsv.gz"),
path("$outputDir/db_tables/stats.txt")).match("db_tables") },
{ assert new File("$outputDir/figures/entity_binding_ratios.A_01_01.pdf").exists() },
{ assert new File("$outputDir/figures/entity_binding_ratios.with_points.A_01_01.pdf").exists() },
{ assert new File("$outputDir/figures/prediction_score_distribution.A_01_01.pdf").exists() },
{ assert snapshot(path("$outputDir/logs/prediction_warnings.log"),
path("$outputDir/logs/SUCCEEDED_unify_peptide_lengths.log")).match("logs") },
{ assert new File("$outputDir/prodigal/proteins.pred_0.bin.1.tsv.gz").exists() },
{ assert new File("$outputDir/prodigal/proteins.pred_0.bin.2.tsv.gz").exists() },
{ assert new File("$outputDir/prodigal/proteins.pred_1.tsv.gz").exists() }
)
}

}
Expand Down
36 changes: 36 additions & 0 deletions tests/pipeline/test.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"db_tables": {
"content": [
"alleles.tsv:md5,77994270b1eab3e8363c90d8d09780fa",
"conditions_alleles.tsv:md5,e865774e32935a69306461ff47428aa8",
"conditions.tsv:md5,a6fe5daaf11a90b61c83c9934969c52c",
"entities_proteins.tsv:md5,fd4cbfeca8e8f176c9e2f7aff39921bf",
"entities.tsv:md5,beb0a0fca43b5511cdabaf24bcc9113a",
"microbiomes_entities.no_weights.tsv:md5,4d45837586c7c6dc4a19b41735215b01",
"microbiomes_entities.nucl.tsv:md5,f5a3ff3cc1f8100f56238b9fab405e66",
"microbiomes_entities.tsv:md5,ea5c9629387ee19ccc485af0157a922c",
"microbiomes.tsv:md5,20f141ba0c97325e9d99a9c0765f9a37",
"proteins_peptides.tsv:md5,e4d6b0199769075ff20c8eeca1485852",
"peptides.tsv.gz:md5,66f6ceef1d5212d061b46c90703282d9",
"proteins.tsv.gz:md5,3b397fc51074066efe2d31a5aff2abe3",
"predictions.tsv.gz:md5,a50679d98e43e09858bf5f29ed222cd2",
"stats.txt:md5,83204291158696ce5d19c4e976f38efe"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.3"
},
"timestamp": "2024-08-02T07:24:38.491278622"
},
"logs": {
"content": [
"prediction_warnings.log:md5,d41d8cd98f00b204e9800998ecf8427e",
"SUCCEEDED_unify_peptide_lengths.log:md5,c27fb56e478b975c57c910011935dd55"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-26T08:14:54+0000"
}
}
34 changes: 33 additions & 1 deletion tests/pipeline/test_all.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,39 @@ nextflow_pipeline {
}

then {
assert workflow.success
assertAll(
{ assert workflow.success },
{ assert new File("$outputDir/multiqc/multiqc_report.html").exists() },
{ assert new File("$outputDir/pipeline_info/nf_core_pipeline_software_mqc_versions.yml").exists() },
{ assert snapshot(path("$outputDir/db_tables/alleles.tsv"),
path("$outputDir/db_tables/conditions_alleles.tsv"),
path("$outputDir/db_tables/conditions.tsv"),
path("$outputDir/db_tables/entities_proteins.tsv"),
path("$outputDir/db_tables/entities.tsv"),
path("$outputDir/db_tables/microbiomes_entities.no_weights.tsv"),
path("$outputDir/db_tables/microbiomes_entities.nucl.tsv"),
path("$outputDir/db_tables/microbiomes_entities.tsv"),
path("$outputDir/db_tables/microbiomes.tsv"),
path("$outputDir/db_tables/proteins_peptides.tsv"),
path("$outputDir/db_tables/peptides.tsv.gz"),
path("$outputDir/db_tables/proteins.tsv.gz"),
path("$outputDir/db_tables/predictions.tsv.gz"),
path("$outputDir/db_tables/stats.txt")).match("db_tables") },
{ assert snapshot(path("$outputDir/entrez_data/microbiomes_entities.entrez.tsv")).match("entrez_data") },
{ assert new File("$outputDir/entrez_data/entities_proteins.entrez.tsv").exists() },
{ assert new File("$outputDir/entrez_data/proteins.entrez.tsv.gz").exists() },
{ assert new File("$outputDir/entrez_data/taxa_assemblies.tsv").exists() },
{ assert new File("$outputDir/figures/entity_binding_ratios.A_01_01.pdf").exists() },
{ assert new File("$outputDir/figures/entity_binding_ratios.with_points.A_01_01.pdf").exists() },
{ assert new File("$outputDir/figures/prediction_score_distribution.A_01_01.pdf").exists() },
{ assert snapshot(path("$outputDir/logs/prediction_warnings.log"),
path("$outputDir/logs/SUCCEEDED_unify_peptide_lengths.log"),
path("$outputDir/logs/download_proteins.log")).match("logs") },
{ assert new File("$outputDir/prodigal/proteins.pred_1.bin.1.tsv.gz").exists() },
{ assert new File("$outputDir/prodigal/proteins.pred_1.bin.2.tsv.gz").exists() },
{ assert new File("$outputDir/prodigal/proteins.pred_2.tsv.gz").exists() }
)

tillenglert marked this conversation as resolved.
Show resolved Hide resolved
}

}
Expand Down
47 changes: 47 additions & 0 deletions tests/pipeline/test_all.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"entrez_data": {
"content": [
"microbiomes_entities.entrez.tsv:md5,77463a684452d34795b6eda52cfad072"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-26T08:14:54+0000"
},
"db_tables": {
"content": [
"alleles.tsv:md5,77994270b1eab3e8363c90d8d09780fa",
"conditions_alleles.tsv:md5,0e992c19471bb56c9b6e6a6f71302742",
"conditions.tsv:md5,87707cd0dee14b0ca4face090ba9dce9",
"entities_proteins.tsv:md5,57a704e833a65a1809c369452864e241",
"entities.tsv:md5,b7d3d019c258859c93bbc15095d304f1",
"microbiomes_entities.no_weights.tsv:md5,977da228f562b386b0f84fc718cc22e9",
"microbiomes_entities.nucl.tsv:md5,aa0d4cc3546508c8e5b81bc9b4b16e39",
"microbiomes_entities.tsv:md5,03309271d7a983c7b4a5c73418676bbc",
"microbiomes.tsv:md5,70871c8b3023f5a8412c05f4a69dda2f",
"proteins_peptides.tsv:md5,aff145bbff9f962891db2c2a540242c4",
"peptides.tsv.gz:md5,36aba6d50b1aad95859a547b06d04fc5",
"proteins.tsv.gz:md5,027823577635c591b58326410b039b32",
"predictions.tsv.gz:md5,d3b36995f3b4027d1a14e726a0acc6c2",
"stats.txt:md5,896155e0f043f30bd71c38c8ee7b466c"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.3"
},
"timestamp": "2024-08-02T07:59:44.990798256"
},
"logs": {
"content": [
"prediction_warnings.log:md5,d41d8cd98f00b204e9800998ecf8427e",
"SUCCEEDED_unify_peptide_lengths.log:md5,c27fb56e478b975c57c910011935dd55",
"download_proteins.log:md5,488e1962cf079d466188481d526495f2"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-07-17T15:58:41.467969153"
}
}
26 changes: 25 additions & 1 deletion tests/pipeline/test_assembly_only.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,31 @@ nextflow_pipeline {
}

then {
assert workflow.success
assertAll(
{ assert workflow.success },
{ assert new File("$outputDir/multiqc/multiqc_report.html").exists() },
{ assert new File("$outputDir/pipeline_info/nf_core_pipeline_software_mqc_versions.yml").exists() },
{ assert snapshot(path("$outputDir/db_tables/alleles.tsv"),
path("$outputDir/db_tables/conditions_alleles.tsv"),
path("$outputDir/db_tables/conditions.tsv"),
path("$outputDir/db_tables/entities_proteins.tsv"),
path("$outputDir/db_tables/entities.tsv"),
path("$outputDir/db_tables/microbiomes_entities.no_weights.tsv"),
path("$outputDir/db_tables/microbiomes_entities.nucl.tsv"),
path("$outputDir/db_tables/microbiomes_entities.tsv"),
path("$outputDir/db_tables/microbiomes.tsv"),
path("$outputDir/db_tables/proteins_peptides.tsv"),
path("$outputDir/db_tables/peptides.tsv.gz"),
path("$outputDir/db_tables/proteins.tsv.gz"),
path("$outputDir/db_tables/predictions.tsv.gz"),
path("$outputDir/db_tables/stats.txt")).match("db_tables") },
{ assert new File("$outputDir/figures/entity_binding_ratios.A_01_01.pdf").exists() },
{ assert new File("$outputDir/figures/entity_binding_ratios.with_points.A_01_01.pdf").exists() },
{ assert new File("$outputDir/figures/prediction_score_distribution.A_01_01.pdf").exists() },
{ assert snapshot(path("$outputDir/logs/prediction_warnings.log"),
path("$outputDir/logs/SUCCEEDED_unify_peptide_lengths.log")).match("logs") },
{ assert new File("$outputDir/prodigal/proteins.pred_0.tsv.gz").exists() }
)
}

}
Expand Down
36 changes: 36 additions & 0 deletions tests/pipeline/test_assembly_only.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"db_tables": {
"content": [
"alleles.tsv:md5,77994270b1eab3e8363c90d8d09780fa",
"conditions_alleles.tsv:md5,9db7e0afc739b23c430877e336b0143f",
"conditions.tsv:md5,a6fe5daaf11a90b61c83c9934969c52c",
"entities_proteins.tsv:md5,2ba821a04755841dc6f116965f853f40",
"entities.tsv:md5,61f364c97c883f45663ae27d115b229f",
"microbiomes_entities.no_weights.tsv:md5,bd449dafeb86c374552f2e22a9780b19",
"microbiomes_entities.nucl.tsv:md5,3888070b634251c0ae3e9fd4857140d7",
"microbiomes_entities.tsv:md5,6cef150e7f5fc2f3320d9a93da00f5de",
"microbiomes.tsv:md5,3d597aec25752f7ca83436b31bfaa128",
"proteins_peptides.tsv:md5,c2a16b2d30c9cf5ea52207dd799b4603",
"peptides.tsv.gz:md5,dd0f94bea5079df8ef06895de255038b",
"proteins.tsv.gz:md5,104b786dfa89e183a46e29f1f37f17de",
"predictions.tsv.gz:md5,98eeb5672f338ad5e8de7e2047261037",
"stats.txt:md5,d138e30d814db5203a789b7eddd04732"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.3"
},
"timestamp": "2024-08-01T12:28:55.298980309"
},
"logs": {
"content": [
"prediction_warnings.log:md5,d41d8cd98f00b204e9800998ecf8427e",
"SUCCEEDED_unify_peptide_lengths.log:md5,c27fb56e478b975c57c910011935dd55"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-26T08:14:54+0000"
}
}
26 changes: 25 additions & 1 deletion tests/pipeline/test_bins_only.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,31 @@ nextflow_pipeline {
}

then {
assert workflow.success
assertAll(
{ assert workflow.success },
{ assert new File("$outputDir/multiqc/multiqc_report.html").exists() },
{ assert new File("$outputDir/pipeline_info/nf_core_pipeline_software_mqc_versions.yml").exists() },
{ assert snapshot(path("$outputDir/db_tables/alleles.tsv"),
path("$outputDir/db_tables/conditions_alleles.tsv"),
path("$outputDir/db_tables/conditions.tsv"),
path("$outputDir/db_tables/entities_proteins.tsv"),
path("$outputDir/db_tables/entities.tsv"),
path("$outputDir/db_tables/microbiomes_entities.no_weights.tsv"),
path("$outputDir/db_tables/microbiomes_entities.nucl.tsv"),
path("$outputDir/db_tables/microbiomes_entities.tsv"),
path("$outputDir/db_tables/microbiomes.tsv"),
path("$outputDir/db_tables/proteins_peptides.tsv"),
path("$outputDir/db_tables/peptides.tsv.gz"),
path("$outputDir/db_tables/proteins.tsv.gz"),
path("$outputDir/db_tables/predictions.tsv.gz"),
path("$outputDir/db_tables/stats.txt")).match("db_tables") },
{ assert new File("$outputDir/figures/entity_binding_ratios.A_01_01.pdf").exists() },
{ assert new File("$outputDir/figures/entity_binding_ratios.with_points.A_01_01.pdf").exists() },
{ assert new File("$outputDir/figures/prediction_score_distribution.A_01_01.pdf").exists() },
{ assert snapshot(path("$outputDir/logs/prediction_warnings.log"),
path("$outputDir/logs/SUCCEEDED_unify_peptide_lengths.log")).match("logs") },
{ assert new File("$outputDir/prodigal/proteins.pred_0.bin.1.tsv.gz").exists() }
)
}

}
Expand Down
36 changes: 36 additions & 0 deletions tests/pipeline/test_bins_only.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"db_tables": {
"content": [
"alleles.tsv:md5,77994270b1eab3e8363c90d8d09780fa",
"conditions_alleles.tsv:md5,9db7e0afc739b23c430877e336b0143f",
"conditions.tsv:md5,5b04349198a406fc16760c7e8808bb23",
"entities_proteins.tsv:md5,20e495ff06ccacb0f81dbd65e556fc83",
"entities.tsv:md5,7a472316b8e96e9b12d7ca3ff6a88d39",
"microbiomes_entities.no_weights.tsv:md5,bf3ff9d0390b49c6ecafd89c93909b67",
"microbiomes_entities.nucl.tsv:md5,84b6b907695caaddc959682504749832",
"microbiomes_entities.tsv:md5,2f40573eb52f3d823aad2f09a639eee2",
"microbiomes.tsv:md5,3f58c3029d21a59316861c28af4361d1",
"proteins_peptides.tsv:md5,50df6a9278679870190795d7b7968113",
"peptides.tsv.gz:md5,34497a1a57af3c3e48fceb762cf94f75",
"proteins.tsv.gz:md5,1ae4d6be0e8bc4beb3d225aed3379d1c",
"predictions.tsv.gz:md5,1dd8ab58446c326432beadb44a0b327a",
"stats.txt:md5,62d598a845aff61f2be843daa250f485"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.3"
},
"timestamp": "2024-08-01T13:39:59.996820893"
},
"logs": {
"content": [
"prediction_warnings.log:md5,d41d8cd98f00b204e9800998ecf8427e",
"SUCCEEDED_unify_peptide_lengths.log:md5,c27fb56e478b975c57c910011935dd55"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-26T08:14:54+0000"
}
}
28 changes: 27 additions & 1 deletion tests/pipeline/test_coassembly.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,33 @@ nextflow_pipeline {
}

then {
assert workflow.success
assertAll(
{ assert workflow.success },
{ assert new File("$outputDir/multiqc/multiqc_report.html").exists() },
{ assert new File("$outputDir/pipeline_info/nf_core_pipeline_software_mqc_versions.yml").exists() },
{ assert snapshot(path("$outputDir/db_tables/alleles.tsv"),
path("$outputDir/db_tables/conditions_alleles.tsv"),
path("$outputDir/db_tables/conditions.tsv"),
path("$outputDir/db_tables/entities_proteins.tsv"),
path("$outputDir/db_tables/entities.tsv"),
path("$outputDir/db_tables/microbiomes_entities.no_weights.tsv"),
path("$outputDir/db_tables/microbiomes_entities.nucl.tsv"),
path("$outputDir/db_tables/microbiomes_entities.tsv"),
path("$outputDir/db_tables/microbiomes.tsv"),
path("$outputDir/db_tables/proteins_peptides.tsv"),
path("$outputDir/db_tables/peptides.tsv.gz"),
path("$outputDir/db_tables/proteins.tsv.gz"),
path("$outputDir/db_tables/predictions.tsv.gz"),
path("$outputDir/db_tables/stats.txt")).match("db_tables") },
{ assert new File("$outputDir/figures/entity_binding_ratios.A_01_01.pdf").exists() },
{ assert new File("$outputDir/figures/entity_binding_ratios.with_points.A_01_01.pdf").exists() },
{ assert new File("$outputDir/figures/prediction_score_distribution.A_01_01.pdf").exists() },
{ assert snapshot(path("$outputDir/logs/prediction_warnings.log"),
path("$outputDir/logs/SUCCEEDED_unify_peptide_lengths.log")).match("logs") },
{ assert new File("$outputDir/prodigal/proteins.pred_0.tsv.gz").exists() },
{ assert new File("$outputDir/prodigal/proteins.pred_1.bin.1.tsv.gz").exists() },
{ assert new File("$outputDir/prodigal/proteins.pred_1.bin.2.tsv.gz").exists() }
)
}

}
Expand Down
Loading
Loading