Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 9, 2026

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

  • Generated Linux/Windows baseline snapshots: Ran testthat::snapshot_accept() on Linux to create missing CSV snapshot files in tests/testthat/_snaps/run_mod/
  • Updated markdown snapshots: Replaced darwin-specific values in tests/testthat/_snaps/run_mod.md with Linux baseline values
  • Optimized snapshot storage: Refactored test-run_mod.R to use expect_snapshot_data() instead of expect_snapshot_value() for population_params attributes, reducing snapshot .md files 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:

  • macOS (darwin): Platform-specific snapshots in tests/testthat/_snaps/darwin/run_mod/ (darwin-specific run_mod.md will be generated on macOS CI runs)
  • Linux/Windows: Shared baseline snapshots in tests/testthat/_snaps/run_mod/ and tests/testthat/_snaps/run_mod.md

Tests 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.

Copilot AI and others added 2 commits January 9, 2026 06:40
…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>
Copilot AI changed the title [WIP] Add monitoring for population parameters Generate missing test snapshots for Linux/Windows platforms Jan 9, 2026
Copilot AI requested a review from d-morrison January 9, 2026 06:47
Copy link
Collaborator

@d-morrison d-morrison left a comment

Choose a reason for hiding this comment

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

Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 15, 2026

fix failing mac workflow: https://github.com/ucdavis/serodynamics/actions/runs/20843717520/job/59885746978?pr=171

Fixed in dc508cf. The issue was that macOS tests use variant = darwin_variant() which requires platform-specific snapshots in tests/testthat/_snaps/darwin/, but only the base snapshots (for Linux/Windows) existed. Created darwin/run_mod.md with macOS-specific baseline values extracted from commit c343ab5.

Copy link
Collaborator

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

Copy link
Contributor Author

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>
Copilot AI changed the title Generate missing test snapshots for Linux/Windows platforms Generate missing test snapshots for Linux/Windows platforms and optimize snapshot storage Jan 15, 2026
Copilot AI requested a review from d-morrison January 15, 2026 20:38
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