Skip to content

Commit

Permalink
re-organize tests and use tags in ci job matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
sateeshperi committed Jun 20, 2023
1 parent 4b093cd commit 49579a9
Show file tree
Hide file tree
Showing 25 changed files with 279 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.config linguist-language=nextflow
*.nf.test linguist-language=nextflow
tests/**/*nf.test.snap linguist-generated
modules/nf-core/** linguist-generated
subworkflows/nf-core/** linguist-generated
26 changes: 14 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,25 @@ jobs:
fi
test:
name: Run pipeline with test data
name: nf-test
needs: define_nxf_versions
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
NXF_VER: ${{ fromJson(needs.define_nxf_versions.outputs.matrix) }}
component:
- "tests/pipeline/misc/custom_reftax.nf.test --profile test_reftaxcustom"
- "tests/pipeline/misc/doubleprimers.nf.test --profile test_doubleprimers"
- "tests/pipeline/misc/fasta_input.nf.test --profile test_fasta"
- "tests/pipeline/misc/multi_seq.nf.test --profile test_multi"
- "tests/pipeline/paired_end/paired_end.nf.test --profile test"
- "tests/pipeline/paired_end/pe_iontorrent.nf.test --profile test_iontorrent"
- "tests/pipeline/paired_end/pe_novaseq.nf.test --profile test_novaseq"
- "tests/pipeline/paired_end/pe_pacbio_its.nf.test --profile test_pacbio_its"
- "tests/pipeline/single_end/single_end.nf.test --profile test_single"
tags:
- "test"
- "test_single"
- "test_fasta"
- "test_multi"
- "test_reftaxcustom"
- "test_doubleprimers"
- "test_iontorrent"
- "test_novaseq"
- "test_pacbio_its"
- "test_sintax"
- "test_pplace"
profile:
- "docker"

Expand Down Expand Up @@ -101,7 +103,7 @@ jobs:
- name: Run nf-test
run: |
nf-test test ${{ matrix.component }},${{ matrix.profile }} --junitxml=test.xml
nf-test test --tag ${{ matrix.tags }} --profile ${{ matrix.tags }},${{ matrix.profile }} --junitxml=test.xml
- name: Output log on failure
if: failure()
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Added`

- [#580](https://github.com/nf-core/ampliseq/pull/580) - Add NF-TEST pipeline end-to-end tests for existing CI tests
- [#591](https://github.com/nf-core/ampliseq/pull/591) - New version of the Unite taxonomy databases: 9.0
- [#564](https://github.com/nf-core/ampliseq/pull/564),[#567](https://github.com/nf-core/ampliseq/pull/567),[#582](https://github.com/nf-core/ampliseq/pull/582) - Added phylogenetic placement
- [#577](https://github.com/nf-core/ampliseq/pull/577) - Added SINTAX for taxonomic classification
Expand All @@ -15,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Changed`

- [#580](https://github.com/nf-core/ampliseq/pull/580) - GitHub Actions CI - pull_request to `dev` tests with NXF_VER `latest-everything` & pull_request to `master` tests with NXF_VER `22.10.1` & `latest-everything`
- [#563](https://github.com/nf-core/ampliseq/pull/563) - Renamed DADA2 taxonomic classification files to include the chosen reference taxonomy abbreviation.
- [#567](https://github.com/nf-core/ampliseq/pull/567) - Renamed `--dada_tax_agglom_min` and `--qiime_tax_agglom_min` to `--tax_agglom_min` and `--dada_tax_agglom_max` and `--qiime_tax_agglom_max` to `--tax_agglom_max`
- [#598](https://github.com/nf-core/ampliseq/pull/598) - Updated Workflow figure with SINTAX and phylogenetic placement
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
62 changes: 62 additions & 0 deletions tests/pipeline/pplace.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
nextflow_pipeline {

name "Test Workflow main.nf"
script "main.nf"
tag "test_pplace"
tag "pipeline"

test("Pplace") {

when {
params {
outdir = "$outputDir"
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") },
{ assert snapshot(path("$outputDir/overall_summary.tsv")).match("overall_summary_tsv") },
{ assert snapshot(path("$outputDir/barrnap/rrna.arc.gff"),
path("$outputDir/barrnap/rrna.bac.gff"),
path("$outputDir/barrnap/rrna.euk.gff"),
path("$outputDir/barrnap/rrna.mito.gff")).match("barrnap") },
{ assert new File("$outputDir/barrnap/summary.tsv").exists() },
{ assert snapshot(path("$outputDir/cutadapt/cutadapt_summary.tsv")).match("cutadapt") },
{ assert snapshot(path("$outputDir/dada2/ASV_seqs.fasta"),
path("$outputDir/dada2/ASV_table.tsv"),
path("$outputDir/dada2/DADA2_stats.tsv"),
path("$outputDir/dada2/DADA2_table.rds"),
path("$outputDir/dada2/DADA2_table.tsv")).match("dada2") },
{ assert snapshot(path("$outputDir/input/Samplesheet.tsv"),
path("$outputDir/input/Metadata.tsv")).match("input") },
{ assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-1.tsv").exists() },
{ assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-2.tsv").exists() },
{ assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-3.tsv").exists() },
{ assert new File("$outputDir/qiime2/abundance_tables/count_table_filter_stats.tsv").exists() },
{ assert new File("$outputDir/qiime2/abundance_tables/filtered-table.qza").exists() },
{ assert new File("$outputDir/qiime2/abundance_tables/feature-table.biom").exists() },
{ assert new File("$outputDir/qiime2/abundance_tables/feature-table.tsv").exists() },
{ assert new File("$outputDir/qiime2/input/rep-seqs.qza").exists() },
{ assert new File("$outputDir/qiime2/input/table.qza").exists() },
{ assert new File("$outputDir/qiime2/input/taxonomy.qza").exists() },
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-1.tsv").exists() },
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-2.tsv").exists() },
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-3.tsv").exists() },
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV.tsv").exists() },
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV_with-PPLACE-tax.tsv").exists() },
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV_with-QIIME2-tax.tsv").exists() },
{ assert new File("$outputDir/qiime2/representative_sequences/filtered-sequences.qza").exists() },
{ assert new File("$outputDir/qiime2/representative_sequences/rep-seq.fasta").exists() },
{ assert snapshot(path("$outputDir/qiime2/representative_sequences/descriptive_stats.tsv"),
path("$outputDir/qiime2/representative_sequences/seven_number_summary.tsv")).match("qiime2") },
{ assert new File("$outputDir/pplace/test_pplace.taxonomy.per_query_unique.tsv").exists() },
{ assert new File("$outputDir/pplace/test_pplace.taxonomy.per_query.tsv").exists() },
{ assert new File("$outputDir/pplace/test_pplace.graft.test_pplace.epa_result.newick").exists() },
{ assert snapshot(path("$outputDir/multiqc/multiqc_data/multiqc_general_stats.txt"),
path("$outputDir/multiqc/multiqc_data/multiqc_cutadapt.txt")).match("multiqc") }
)
}
}
}
60 changes: 60 additions & 0 deletions tests/pipeline/pplace.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
72 changes: 72 additions & 0 deletions tests/pipeline/sintax.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
nextflow_pipeline {

name "Test Workflow main.nf"
script "main.nf"
tag "test_sintax"
tag "pipeline"

test("Sintax") {

when {
params {
outdir = "$outputDir"
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") },
{ assert snapshot(path("$outputDir/overall_summary.tsv")).match("overall_summary_tsv") },
{ assert snapshot(path("$outputDir/barrnap/rrna.arc.gff"),
path("$outputDir/barrnap/rrna.bac.gff"),
path("$outputDir/barrnap/rrna.euk.gff"),
path("$outputDir/barrnap/rrna.mito.gff")).match("barrnap") },
{ assert new File("$outputDir/barrnap/summary.tsv").exists() },
{ assert snapshot(path("$outputDir/cutadapt/cutadapt_summary.tsv")).match("cutadapt") },
{ assert snapshot(path("$outputDir/dada2/ASV_seqs.fasta"),
path("$outputDir/dada2/ASV_table.tsv"),
path("$outputDir/dada2/DADA2_stats.tsv"),
path("$outputDir/dada2/DADA2_table.rds"),
path("$outputDir/dada2/DADA2_table.tsv")).match("dada2") },
{ assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-2.tsv").exists() },
{ assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-3.tsv").exists() },
{ assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-4.tsv").exists() },
{ assert new File("$outputDir/qiime2/abundance_tables/count_table_filter_stats.tsv").exists() },
{ assert new File("$outputDir/qiime2/abundance_tables/filtered-table.qza").exists() },
{ assert new File("$outputDir/qiime2/abundance_tables/feature-table.biom").exists() },
{ assert new File("$outputDir/qiime2/abundance_tables/feature-table.tsv").exists() },
{ assert new File("$outputDir/qiime2/input/rep-seqs.qza").exists() },
{ assert new File("$outputDir/qiime2/input/table.qza").exists() },
{ assert new File("$outputDir/qiime2/input/taxonomy.qza").exists() },
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-2.tsv").exists() },
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-3.tsv").exists() },
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-4.tsv").exists() },
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV.tsv").exists() },
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV_with-SINTAX-tax.tsv").exists() },
{ assert new File("$outputDir/qiime2/representative_sequences/filtered-sequences.qza").exists() },
{ assert new File("$outputDir/qiime2/representative_sequences/rep-seq.fasta").exists() },
{ assert new File("$outputDir/qiime2/ancom/Category-var2-ASV/percent-abundances.tsv").exists() },
{ assert new File("$outputDir/qiime2/ancom/Category-var3-ASV/percent-abundances.tsv").exists() },
{ assert snapshot(path("$outputDir/qiime2/representative_sequences/descriptive_stats.tsv"),
path("$outputDir/qiime2/representative_sequences/seven_number_summary.tsv")).match("qiime2") },
{ assert snapshot(path("$outputDir/input/Samplesheet_pacbio_ITS.tsv"),
path("$outputDir/input/Metadata_pacbio_ITS.tsv")).match("input") },
{ assert new File("$outputDir/itsx/ASV_ITS_seqs.full.fasta").exists() },
{ assert new File("$outputDir/itsx/ASV_ITS_seqs.ITS2.fasta").exists() },
{ assert new File("$outputDir/itsx/ASV_ITS_seqs.summary.txt").exists() },
{ assert new File("$outputDir/itsx/ITSx.args.txt").exists() },
{ assert snapshot(path("$outputDir/SBDI/dna.tsv"),
path("$outputDir/SBDI/emof.tsv"),
path("$outputDir/SBDI/event.tsv")).match("SBDI") },
{ assert new File("$outputDir/SBDI/annotation.tsv").exists() },
{ assert new File("$outputDir/SBDI/asv-table.tsv").exists() },
{ assert new File("$outputDir/sintax/ASV_ITS_tax_sintax.unite-fungi.raw.tsv").exists() },
{ assert new File("$outputDir/sintax/ASV_tax_sintax.unite-fungi.tsv").exists() },
{ assert new File("$outputDir/sintax/ref_taxonomy_sintax.txt").exists() },
{ assert snapshot(path("$outputDir/multiqc/multiqc_data/multiqc_general_stats.txt"),
path("$outputDir/multiqc/multiqc_data/multiqc_cutadapt.txt")).match("multiqc") }
)
}
}
}
68 changes: 68 additions & 0 deletions tests/pipeline/sintax.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.

0 comments on commit 49579a9

Please sign in to comment.