Skip to content

feat(upgrader): support restoring snapshots in disaster recovery via upgrader#526

Merged
mraszyk merged 1 commit intomraszyk/disaster-recovery-via-snapshotsfrom
mraszyk/disaster-recovery-load-snapshot
Mar 5, 2025
Merged

feat(upgrader): support restoring snapshots in disaster recovery via upgrader#526
mraszyk merged 1 commit intomraszyk/disaster-recovery-via-snapshotsfrom
mraszyk/disaster-recovery-load-snapshot

Conversation

@mraszyk
Copy link
Copy Markdown
Contributor

@mraszyk mraszyk commented Mar 3, 2025

No description provided.

@mraszyk mraszyk marked this pull request as ready for review March 3, 2025 13:34
@mraszyk mraszyk requested a review from a team as a code owner March 3, 2025 13:34
snapshot_id: snapshot.snapshot_id,
sender_canister_version: Some(canister_version()),
};
load_canister_snapshot(snapshot_args)
Copy link
Copy Markdown
Contributor

@olaszakos olaszakos Mar 5, 2025

Choose a reason for hiding this comment

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

Please test this path in unit tests. Since calling directly is not testable, consider adding this method to the InstallCanister trait, and maybe rename it to ManageCanister, and call it through that trait.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have integration tests for this code path. Are they not enough?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well in this case there is indeed not a lot to test, it's mainly to get full coverage and to continue the existing pattern. Deferrig to your judgement.

Copy link
Copy Markdown
Contributor Author

@mraszyk mraszyk Mar 5, 2025

Choose a reason for hiding this comment

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

My reasoning was that the existing pattern allows unit testing general disaster recovery properties (using install_code as the actual recovery operation) and the new integration tests would provide coverage of the new code path (snapshots as the actual recovery operation) specifically.

@mraszyk mraszyk merged commit 4bba380 into mraszyk/disaster-recovery-via-snapshots Mar 5, 2025
23 checks passed
@mraszyk mraszyk deleted the mraszyk/disaster-recovery-load-snapshot branch March 5, 2025 09:49
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