Feature/testing coverage hibernation bench integration migration rollback - #450
Merged
Conversation
Add hibernation_consistency_tests.rs covering the hibernate -> advance ledger clock -> wake cycle: TTL freeze stability mid-window, the wake boundary granting a fresh check-in interval, early-exit TTL budget preservation, and a pending admin (credential) transition spanning a concurrent hibernation cycle. Document the verified guarantees in docs/hibernation.md.
Track trigger_release CPU/memory costs in a baseline.json, add scripts/compare_bench_baseline.py to run bench_trigger_release and diff results against the baseline within a tolerance threshold, and wire it into CI right after the test step. Fails the build on regressions beyond tolerance. Document the baseline update workflow in docs/benchmarking-guide.md.
Add cross_cutting_integration_tests.rs covering 5 gaps not exercised by the existing per-module unit tests: auth failures never warm the vault cache, the rate limiter's budget is independent of auth outcome, both authorized and unauthorized attempts are audited, cache TTL and rate limiter window clocks don't interfere, and cache invalidation + audit logging happen together on a state change. Widen MessageRateLimiter to pub(crate) so it's testable from a sibling module. Wire backend tests into CI (previously never run) and document the new scenarios and required checks in docs/integration-testing-guide.md.
Add Db::rollback(version) with a DOWN_MIGRATIONS table reversing every existing up migration, plus a new migration "10" that demonstrates a data-transformation migration (adds normalized_frequency and backfills it from frequency, not just a schema change). Add migration_rollback_tests.rs verifying: a full apply->rollback->reapply cycle restores the exact schema, each migration's rollback removes and reapply restores its own table/column, and the data-transformation migration correctly preserves and re-derives seed data across a rollback. Wire a dedicated CI step for these tests and document the rollback-testing requirements and new-migration checklist in the previously-missing docs/migration-testing.md. Also fixes a private AuditLogQuery import in the earlier cross-cutting integration tests (should come from crate::models, not crate::db).
|
@Mac-5 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…ntegration-migration-rollback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #408
Closes #409
Closes #410
Closes #411