Skip to content

Add q2-annotate Integration Tests #353

Description

@VinzentRisch

Several registered actions in q2-annotate currently exercise only mocked external dependency paths. These actions should get integration tests that actually invoke the relevant external CLI, network/API path, or plugin action path where feasible.

Parent issue: rachis-org/roadmap#73

When a registered pipeline wraps a lower-level registered action that reaches the same external dependency, add the integration test for the pipeline and do not add a duplicate integration test for the lower-level action.

Slow Integration Test Marks

If an integration test is too slow or resource-heavy for the normal pull request test suite, mark it so it can run on a less frequent schedule:

  • weekly: integration tests that should run only on weekly builds.
  • release: integration tests that should run only before a release.

Actions Needing External Integration Tests

  • q2_annotate.kraken2.bracken.estimate_bracken
  • q2_annotate.eggnog.build_custom_diamond_db
  • q2_annotate.eggnog.build_eggnog_diamond_db
  • q2_annotate.eggnog.search_orthologs_hmmer
  • q2_annotate.prodigal.predict_genes_prodigal
  • q2_annotate.kaiju.classify_kaiju
  • q2_annotate.filtering.construct_human_pangenome_index
  • q2_annotate.filtering.filter_reads_human_pangenome
Plugin Registered action function External dependency or plugin call
q2-annotate q2_annotate.kraken2.bracken.estimate_bracken bracken CLI.
q2-annotate q2_annotate.eggnog.build_custom_diamond_db diamond makedb CLI.
q2-annotate q2_annotate.eggnog.build_eggnog_diamond_db create_dbs.py external script.
q2-annotate q2_annotate.eggnog.search_orthologs_hmmer Plugin actions; reaches emapper.py through _eggnog_hmmer_search.
q2-annotate q2_annotate.prodigal.predict_genes_prodigal prodigal CLI.
q2-annotate q2_annotate.kaiju.classify_kaiju Plugin actions for partitioning and feature_table merge/merge_taxa; reaches Kaiju through _classify_kaiju.
q2-annotate q2_annotate.filtering.construct_human_pangenome_index wget, gunzip, gfatools, seqtk; plugin actions rescript.get_ncbi_genomes and quality_control.bowtie2_build.
q2-annotate q2_annotate.filtering.filter_reads_human_pangenome Plugin actions quality_control.filter_reads and optionally annotate.construct_human_pangenome_index.

Fetch Actions

These actions should get two levels of integration coverage for the download/database path:

  • weekly: a lightweight URL or remote availability check that verifies the configured download location is reachable.

  • release: a full database download test that verifies the action can fetch and prepare the database before release.

  • q2_annotate.kraken2.build_kraken_db

  • q2_annotate.eggnog.fetch_eggnog_db

  • q2_annotate.eggnog.fetch_diamond_db

  • q2_annotate.eggnog.fetch_eggnog_proteins

  • q2_annotate.eggnog.fetch_ncbi_taxonomy

  • q2_annotate.eggnog.fetch_eggnog_hmmer_db

  • q2_annotate.kaiju.fetch_kaiju_db

Plugin Registered action function How current tests work
q2-annotate q2_annotate.kraken2.build_kraken_db Mocked. Tests patch requests.get, tar extraction, _fetch_prebuilt_dbs, _build_dbs_from_seqs, and Kraken/Bracken helper functions; they verify command/request construction and mocked response handling.
q2-annotate q2_annotate.eggnog.fetch_eggnog_db Completely mocked. Tests patch subprocess.run for wget, gunzip, and tar, plus file removal.
q2-annotate q2_annotate.eggnog.fetch_diamond_db Completely mocked. Tests patch subprocess.run for wget and gunzip.
q2-annotate q2_annotate.eggnog.fetch_eggnog_proteins Completely mocked. Tests patch subprocess.run for both wget calls.
q2-annotate q2_annotate.eggnog.fetch_ncbi_taxonomy Completely mocked. Tests patch subprocess.run, MD5 collection/checking, and file removal.
q2-annotate q2_annotate.eggnog.fetch_eggnog_hmmer_db Mocked. The top-level action test patches validation and download/build helpers; helper tests patch urllib.request.urlopen with fake HTML and patch subprocess.run for wget, tar, and hmmpress.
q2-annotate q2_annotate.kaiju.fetch_kaiju_db Mocked. Tests patch requests.get with static HTML and patch _fetch_and_extract_db; download/extract helper tests also patch requests.get, tar extraction, progress bar, and file removal.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions