Skip to content

Test snapshots#1170

Merged
jgabry merged 7 commits intomasterfrom
snapshots
Apr 10, 2026
Merged

Test snapshots#1170
jgabry merged 7 commits intomasterfrom
snapshots

Conversation

@VisruthSK
Copy link
Copy Markdown
Member

@VisruthSK VisruthSK commented Apr 4, 2026

Swap some tests to use snapshots. Should be discussed.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.25%. Comparing base (c0e7c35) to head (53afd19).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1170      +/-   ##
==========================================
+ Coverage   91.14%   91.25%   +0.10%     
==========================================
  Files          15       15              
  Lines        6065     6070       +5     
==========================================
+ Hits         5528     5539      +11     
+ Misses        537      531       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@VisruthSK VisruthSK marked this pull request as ready for review April 7, 2026 18:32
@VisruthSK VisruthSK requested a review from jgabry April 7, 2026 18:33
Copy link
Copy Markdown
Member

@jgabry jgabry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! At first glance this looks good. I'll take another look soon to take a closer look at exactly which tests we're converting to snapshots.

For now a question: if we set cran=FALSE I assume the snapshot tests should still run on CI, right? If we do eventually submit to CRAN we can't run most of these tests because CRAN won't have CmdStan installed and probably won't let us install it on CRAN systems just to run our tests. So we'd probably end up doing what RStudio does with their tensorflow package:

https://github.com/rstudio/tensorflow/blob/main/tests/testthat.R

@VisruthSK
Copy link
Copy Markdown
Member Author

Ah yes, forgot about that. Will fix that in a bit.

Copy link
Copy Markdown
Member

@jgabry jgabry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is pretty much good to go. I made one small change request and suggested adding one code comment, but otherwise I've come around to the idea that switching to snapshots for these print tests is probably for the best, despite losing the explicitness of the assertions in the old tests.

Co-authored-by: Jonah Gabry <jgabry@gmail.com>
@VisruthSK
Copy link
Copy Markdown
Member Author

Yes the main thing now is that we need to be very protective of the snaps and ensure they aren't changed spuriously. If the API does change its a lot easier to update tests.

@jgabry
Copy link
Copy Markdown
Member

jgabry commented Apr 10, 2026

Yes the main thing now is that we need to be very protective of the snaps and ensure they aren't changed spuriously.

Yeah definitely. We need to make sure no snapshot updates are snuck into large PRs without realizing it.

@jgabry jgabry merged commit cb6d218 into master Apr 10, 2026
23 of 25 checks passed
@jgabry jgabry deleted the snapshots branch April 10, 2026 00:25
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.

3 participants