-
Notifications
You must be signed in to change notification settings - Fork 0
Generate missing test snapshots for Linux/Windows platforms and optimize snapshot storage #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: mon_popparams
Are you sure you want to change the base?
Conversation
…hots for non-darwin platforms Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
d-morrison
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix failing mac workflow: https://github.com/ucdavis/serodynamics/actions/runs/20843717520/job/59885746978?pr=171
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Fixed in dc508cf. The issue was that macOS tests use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these snapshot .md files are too big; use expect_snapshot_data() or expect_snapshot_file() instead of expect_snapshot_value() to fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 7db01b1. Replaced expect_snapshot_value() with expect_snapshot_data() for population_params attribute, reducing snapshot .md files from 5.4M to 4.5K (99.9% reduction). Population parameters are now stored in separate CSV files (62K-1.2M each) for better version control and readability.
…ation_params to reduce snapshot file sizes - Refactored tests to snapshot population_params separately as CSV files using expect_snapshot_data() - Replaced expect_snapshot_value() calls with expect_snapshot() for remaining attributes - Deleted oversized run_mod.md snapshot files (5.4M each) - Generated new compact run_mod.md (4.5K) and population_params CSV files (62K-1.2M) - This reduces repository size and improves snapshot readability Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Tests were failing on Ubuntu/Windows due to missing baseline snapshot files. The test infrastructure uses platform-specific variants (
variant = darwin_variant()) to handle MCMC floating-point differences between macOS and Linux/Windows, but only macOS snapshots existed.Changes
testthat::snapshot_accept()on Linux to create missing CSV snapshot files intests/testthat/_snaps/run_mod/tests/testthat/_snaps/run_mod.mdwith Linux baseline valuestest-run_mod.Rto useexpect_snapshot_data()instead ofexpect_snapshot_value()forpopulation_paramsattributes, reducing snapshot.mdfiles from 5.4MB to 4.5KB (99.9% reduction). Population parameters are now stored in separate CSV files (62K-1.2M each) for better version control and readability.The snapshot infrastructure expects:
tests/testthat/_snaps/darwin/run_mod/(darwin-specificrun_mod.mdwill be generated on macOS CI runs)tests/testthat/_snaps/run_mod/andtests/testthat/_snaps/run_mod.mdTests now have proper baselines for all platforms to compare against during CI, with significantly reduced repository size and improved snapshot maintainability.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.