Skip to content

test: regression test infra and snapshots#106

Merged
cademirch merged 7 commits into
fiberseq:mainfrom
cademirch:main
May 12, 2026
Merged

test: regression test infra and snapshots#106
cademirch merged 7 commits into
fiberseq:mainfrom
cademirch:main

Conversation

@cademirch
Copy link
Copy Markdown
Contributor

Adds regression testing via insta, which uses 'snapshots' of output to verify behavior stays consistent across changes. Any divergence from the committed snapshots fails the test. This is generally useful, but especially so as I plan to merge molecular annotation format changes soon.

So far the following commands and options are covered using the existing test bams:

  • ft extract --m6a, --nuc, --msp (all.bam)
  • ft extract --all (NAPA.bam — has FIRE annotations)
  • ft center (center.bam + center.bed)
  • ft qc (all.bam)

Before merging this I will add:

  • ft pileup
  • ft fire --extract

@mrvollger
Copy link
Copy Markdown
Member

@cademirch I think if possible with this snap tool, we should use e.g. hck -F chrom -F start -F end -F m6a to pull only certain columns in particular orders, that way adding new columns won't count as a regression.

cademirch added 2 commits May 8, 2026 13:16
Adds a fire --feats-to-text regression test on all.bam, snapshotting a
stable subset of feature columns via select_tsv_cols so bin column
additions don't count as regressions.

Adds select_bed12_cols for headerless bed12 output (extract --m6a/--nuc/
--msp), projecting locator + per-record block data and dropping score/
thick_*/item_rgb (constants or duplicates). Snapshots now carry a
synthetic header so they're self-describing.

Routes qc through select_tsv_cols for consistency.
@cademirch cademirch marked this pull request as ready for review May 11, 2026 23:52
@mrvollger
Copy link
Copy Markdown
Member

Are the snapshots part of .git? If so I think we might need to compress or something.

Also can you outline how we can use these tests?

cademirch added 2 commits May 11, 2026 19:21
Use a 3-motif bed subset and --dist 200 so the snapshot stays small
without losing coverage of liftover, strand flipping, or m6a/nuc/msp
emission. The center math is uniform across distance, so the dist
filter is a downstream check rather than a different code path.
@cademirch
Copy link
Copy Markdown
Contributor Author

cademirch commented May 12, 2026

Thanks, forgot to add docs on these tests. Added to CONTRIBUTING.md.

Snapshots are checked in to git: tests/regressions/snapshots. All of them are small (<1 megabyte) so I don't think compression is needed for them.

The diff is big now (since the snapshots are just all textual output). But it was already helpful in identifying 1bp differences in liftover behavior in the MA spec transition (70fb014)

@mrvollger
Copy link
Copy Markdown
Member

Perfect. This works for me if you want to merge.

@cademirch cademirch merged commit f9d5f88 into fiberseq:main May 12, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants