Fix flaky CI: pin shared test snp fixtures to installed Ensembl release 81 - #400
Merged
Conversation
test_collection_filtering.py calls variants.effects() at module import using the db_snp_variants fixtures from tests/data.py. Those Variants defaulted to reference_name "GRCh38", which pyensembl resolves to its LATEST known release (currently 115) rather than an installed one. The CI mirror (openvax/ensembl-data) tops out at GRCh38.95, so collection intermittently died with "GTF database needs to be created" whenever the latest-release GTF wasn't present -- a pre-existing flake on main's default run, not something the annotator switch introduced. Pin the three snps to cached_release(81) -- the installed release the downstream transcript-id assertions (ENST00000371321, ...371763, ...464755, ...613244) were written against. Same class of fix as #399.
iskandr
added a commit
that referenced
this pull request
Jul 9, 2026
A bare reference name like Variant(..., "GRCh38") or from_csv(genome="GRCh38") resolves, via pyensembl, to the latest release pyensembl KNOWS about (currently 115), not one that's necessarily downloaded. CI installs GRCh38 only up to release 95 (the openvax/ensembl-data mirror tops out there), so dozens of tests across the suite would try to auto-fetch release 115 from Ensembl's FTP at runtime. When that FTP is slow/unreachable the whole job fails with "GTF database needs to be created, run: pyensembl install --release 115" -- an intermittent, whole-suite flake (seen here on 3.11; the previous run passed only because the auto-download happened to succeed). conftest now transparently caps GRCh38 string resolution at the newest release whose GTF index actually exists on disk, walking down from the resolved release and flooring at 76 (the first GRCh38 release) so it never crosses into GRCh37. Verified: the full suite passes identically under release 95 and 115 (1235 passed, both fast and protein_diff), so this only removes the network dependency -- no expected value changes. Library behavior is untouched; this lives entirely in the test harness. Complements the import-time fix in #400 (data.py snps), covering the remaining runtime bare-"GRCh38" call sites.
iskandr
added a commit
that referenced
this pull request
Jul 9, 2026
Two call sites resolved to pyensembl's latest known release via paths
that bypass the conftest GRCh38 cap (which only intercepts varcode's
string resolution):
- test_variant.py imported pyensembl's module-level `ensembl_grch38`
(its latest release, 115) directly. Pin to cached_release(81), matching
the convention used across the rest of the suite. test_serialization
asserts only roundtrip consistency, not a release number, so no
expected value changes.
- test_effect_classes.py built mouse_genome via
genome_for_reference_name("grcm38"), which resolves to GRCm38 release
102; CI installs GRCm38.95. Pin to cached_release(95, species="mouse").
The asserted transcript (ENSMUST00000021049 / Psmc5) is identical
across releases 95 and 102, so the effect assertion is unchanged.
Completes the sweep of runtime latest-release dependencies alongside the
conftest cap and #400.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
tests/test_collection_filtering.pycallsvariants.effects()at module import on thedb_snp_variantsfixtures defined intests/data.py. ThoseVariants defaulted toreference_name="GRCh38", which pyensembl resolves to its latest known release (currently 115) rather than an installed one.CI installs GRCh38 from the
openvax/ensembl-datamirror, which tops out at GRCh38.95. So whenever the latest-release GTF isn't present, collection of that module dies with"GTF database needs to be created"— an intermittent failure on main's default./test.shrun (seen on 3.9/3.10).This is the same class of latent release-dependency bug fixed in #399, at a call site that PR didn't touch.
Fix
Pin the three shared snps to
cached_release(81)— the installed release the downstream transcript-id assertions (ENST00000371321,...371763,...464755,...613244) were already written against. Test-only, no library changes.Verification
test_collection_filtering.py→ 7 passed (including the expression test that fails under release 115)test_cli_genes.py→ 1 passedruff check tests/data.py→ clean.effects()call site: the MAF fixtures (tcga_ov,ov_wustle) resolve to GRCh37/release 75, which is installed — no further trap.https://claude.ai/code/session_01VNtZRyKZ7u9jiMGPQEbx4c