Skip to content

Add upgrade, DR, backup-integrity and canary deployment testing (#557–#560)#606

Merged
fejilaup-cloud merged 1 commit into
AtomicIP:mainfrom
Nexha-dev:feature/557-560-upgrade-dr-backup-canary-testing
May 30, 2026
Merged

Add upgrade, DR, backup-integrity and canary deployment testing (#557–#560)#606
fejilaup-cloud merged 1 commit into
AtomicIP:mainfrom
Nexha-dev:feature/557-560-upgrade-dr-backup-canary-testing

Conversation

@Nexha-dev
Copy link
Copy Markdown
Contributor

@Nexha-dev Nexha-dev commented May 30, 2026

Summary

Implements testing for four reliability / operations issues:

  • Add Contract Upgrade Testing #557 Contract Upgrade Testingcontracts/ip_registry/src/upgrade_tests.rs (7 tests): upgrade-compatibility validation (accept valid hashes, reject the zero hash), state preservation across the compatibility check, idempotency, and the admin-authorization guard on upgrade(). Docs: docs/contract-upgrade-testing.md.
  • Implement Disaster Recovery Testing #558 Disaster Recovery Testingscripts/test-disaster-recovery.sh runs the full backup → verify → restore → service-verify chain hermetically, mocking Stellar/AWS/API/Postgres. Docs: docs/disaster-recovery-testing.md.
  • Add Backup Integrity Verification #559 Backup Integrity Verificationverify-backup-integrity.sh now verifies a SHA-256 sidecar when present; backup-contract-state.sh writes and uploads that sidecar (backward compatible). scripts/test-backup-integrity.sh covers valid / corrupt / missing-file / malformed-JSON / checksum-mismatch cases. Docs: docs/backup-integrity-verification.md.
  • Implement Canary Deployment Testing #560 Canary Deployment Testingscripts/canary-deploy.sh: health-gated canary rollout with automatic rollback; side-effecting steps are pluggable hooks so it runs against real infra in prod and mocks in tests. scripts/test-canary-deployment.sh exercises every promote/rollback branch. Docs: docs/canary-deployment.md.

Shared infrastructure

  • scripts/tests/lib.sh — hermetic shell-test harness (mock binaries, assertions, fixtures).
  • scripts/run-ops-tests.sh + .github/workflows/ops-tests.yml — run the ops suites in CI (no secrets/infra needed).
  • README documentation index updated.

Test results

Suite Result
test-disaster-recovery.sh (#558) ✅ 12/12
test-backup-integrity.sh (#559) ✅ 16/16
test-canary-deployment.sh (#560) ✅ 18/18
upgrade_tests (#557) Compiles clean; see note below
bash scripts/run-ops-tests.sh   # ALL OPS TEST SUITES PASSED

⚠️ Pre-existing main build breakage (not introduced here)

The ip_registry crate does not currently compile on main, so cargo test -p ip_registry cannot be executed locally. This is pre-existing and unrelated to this PR:

  • Duplicate pub fn batch_verify_commitments definitions in contracts/ip_registry/src/lib.rs (lines 2895 and 3710) — hard E0592/E0428 errors from two separately-merged PRs.
  • Test code referencing DataKey/ContractError variants that don't exist and std inside the #![no_std] crate.

The new upgrade_tests module is purely additive: the crate's error count is identical (64) whether mod upgrade_tests; is enabled or disabled, confirming this PR adds no new errors. The module mirrors the existing (passing) test.rs idioms and will run green once the duplicate-definition bug on main is fixed. Happy to address that separately if useful.
Closes #557
Closes #559
Closes #558
Closes #560

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@Nexha-dev 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! 🚀

Learn more about application limits

…icIP#557AtomicIP#560)

Implements testing for four reliability/ops issues:

AtomicIP#557 Contract Upgrade Testing
  - New contracts/ip_registry/src/upgrade_tests.rs covering upgrade
    compatibility validation (accept/reject), state preservation across the
    validation check, and the admin-authorization guard on upgrade().
  - docs/contract-upgrade-testing.md.

AtomicIP#558 Disaster Recovery Testing
  - scripts/test-disaster-recovery.sh runs the full backup -> verify ->
    restore -> service-verify chain hermetically (external services mocked).
  - docs/disaster-recovery-testing.md.

AtomicIP#559 Backup Integrity Verification
  - verify-backup-integrity.sh now verifies a SHA-256 sidecar when present;
    backup-contract-state.sh writes and uploads that sidecar (backward
    compatible).
  - scripts/test-backup-integrity.sh covers valid/corrupt/missing/malformed/
    checksum-mismatch backups.
  - docs/backup-integrity-verification.md.

AtomicIP#560 Canary Deployment Testing
  - scripts/canary-deploy.sh: health-gated canary rollout with automatic
    rollback; side-effecting steps are pluggable hooks for testability.
  - scripts/test-canary-deployment.sh exercises promote/rollback branches.
  - docs/canary-deployment.md.

Shared:
  - scripts/tests/lib.sh: hermetic shell-test harness (mock bins, assertions,
    fixtures).
  - scripts/run-ops-tests.sh + .github/workflows/ops-tests.yml run the ops
    suites in CI.
  - README documentation index updated.

Test status: shell suites all pass (46 checks). The Rust upgrade_tests module
compiles cleanly and is purely additive (identical error count with the module
enabled or disabled), but cannot be executed locally because the ip_registry
crate does not currently build on main — pre-existing and unrelated: a
duplicate batch_verify_commitments definition (lib.rs:2895 and lib.rs:3710,
E0592) plus test code referencing absent DataKey/ContractError variants.
@Nexha-dev Nexha-dev force-pushed the feature/557-560-upgrade-dr-backup-canary-testing branch from d02eb30 to bbc2a90 Compare May 30, 2026 11:00
@fejilaup-cloud fejilaup-cloud merged commit 7928400 into AtomicIP:main May 30, 2026
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.

Implement Canary Deployment Testing Add Backup Integrity Verification Implement Disaster Recovery Testing Add Contract Upgrade Testing

2 participants