Repository navigation
test(dashmate): assert the migrated config format version, not a literal - #5241
Conversation
The tenderdash image migration test passed the package version in and then
asserted the stamped `configFormatVersion` equalled the literal `4.2.0`. The
version bump to `5.0.0-beta.1` therefore broke it, and every later bump would
break it again.
It now asserts against the `version` the test itself passes to
`migrateConfigFile`, which is what the migration stamps.
Test would have caught this in CI: 2 failing before the fix
("expected '5.0.0-beta.1' to equal '4.2.0'", twice), 3 passing after.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: dashpay/platform/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe migration test now checks that ChangesMigration test
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~5 minutes Change: Other Suggested reviewers: Merge Risk: ⚪ Minimal · up to No production behavior changes, and the updated migration test expectation matches the current target. No actionable merge risk remains. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🕓 Queued for automated review — 7th in line, estimated start in ~2.0 h (commit 76093f9)
|
…nc migration Keyed at 5.1.0, the state sync migration now runs for every config a 4.2 or 5.0 build stamped, including the partial ones the image migration test feeds through the whole chain, and threw on a config without a full Drive section. Skip those, as the other migrations do. The image migration test asserted the literal 4.2.0 as the resulting config format version, which already failed on v5.1-dev (dashpay#5241 fixed it on v5.0-dev by asserting the package version). Assert what getConfigFormatVersion computes instead, which holds whether or not a migration is keyed above the package version. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…nc migration Keyed at 5.1.0, the state sync migration now runs for every config a 4.2 or 5.0 build stamped, including the partial ones the image migration test feeds through the whole chain, and threw on a config without a full Drive section. Skip those, as the other migrations do. The image migration test asserted the literal 4.2.0 as the resulting config format version, which already failed on v5.1-dev (#5241 fixed it on v5.0-dev by asserting the package version). Assert what getConfigFormatVersion computes instead, which holds whether or not a migration is keyed above the package version. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Issue being fixed or feature implemented
JS packages (dashmate) / Testsfails onv5.0-devand on every PR based on it:test/unit/config/configFile/tenderdashImageMigration.spec.jsreads the package version, passes it tomigrateConfigFileas the version to migrate to, and then asserts the stampedconfigFormatVersionequals the literal4.2.0. The bump to5.0.0-beta.1broke it, and the next bump would break it again.The test is parameterised over two source versions, so it fails twice.
What was done?
Assert against the
versionthe test itself passed in, which is what the migration stamps. One line, no production code touched.How Has This Been Tested?
Red then green locally, with the literal restored and removed again:
Breaking Changes
None. Test-only.
Checklist:
🤖 Generated with Claude Code
PR Hygiene ·
76093f9/skip-botsproceeds without the ones not yet reported/self-reviewedonce the bots are doneWhen every box is checked the
PR Hygienecheck passes and this can merge.Summary by CodeRabbit