refactor(ci): use PocketIC with_icp_features for system canister setup#621
Open
refactor(ci): use PocketIC with_icp_features for system canister setup#621
with_icp_features for system canister setup#621Conversation
mraszyk
reviewed
Mar 27, 2026
mraszyk
reviewed
Mar 27, 2026
mraszyk
reviewed
Mar 27, 2026
cba25e1 to
e1af296
Compare
Rust 1.88.0 stabilizes let chains and enables the
`uninlined_format_args` clippy lint. Fix all instances of
`format!("{}", x)` -> `format!("{x}")` across the workspace
to keep CI green under `-D clippy::all`.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
c53b832 to
cf4ca5b
Compare
The integration tests and e2e tests were failing because external dependencies were fetched from unpinned sources (latest/master): - assetstorage.wasm downloaded from dfinity/sdk master now imports env_var_count from ic0, which PocketIC server 9.0.3 does not support - Internet Identity latest release changed its UI, removing the #registerButton element expected by e2e tests Pin both to known-working versions: - assetstorage.wasm: pin to SDK commit d65717bd (matching the ic-certified-assets git dependency already in Cargo.lock) - Internet Identity: pin to release-2025-08-29 (last release before the final successful CI run) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace manual installation of ICP ledger, ICP index, and CMC with PocketIC's built-in `with_icp_features` API, which automatically bootstraps these system canisters. This eliminates ~400 lines of setup code, removes NNS canister WASM downloads from the test script, and cleans up dead system canister functions from the orbit dev script. - Upgrade pocket-ic 9.0.2 → 10.0.0 and server 9.0.3 → 10.0.0 - Remove manual canister creation/init for ICP ledger, index, CMC - Remove unused types (CMC init args, subnet assignment args, etc.) - Clean up orbit script: remove --init-cmc, --init-icp-ledger, etc. - Remove cmc entry from dfx.json Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rest Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…file The rebase accidentally kept ic-management-canister-types 0.4.1 from the base branch. Revert to 0.3.0 (matching main) to avoid duplicate versions that cause type mismatches with pocket-ic's re-exported types. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The station canister now uses the ic0::env_var_count API (via dependencies), which PocketIC server 10.0.0 doesn't support. Bump the server binary to 13.0.0 while keeping the pocket-ic crate at 10.0.0 (11+ requires Rust 1.88, project uses 1.87). The server REST API changes between 10 and 13 are additive/non-breaking. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pocket-ic 10.0.0's with_icp_features bundles NNS system canister WASMs that use ic0::env_var_count, which the PocketIC 10.0.0 server's Wasm engine doesn't support. Upgrading both crate and server to 13.0.0 resolves the mismatch. This requires Rust 1.88 (bumped in the preceding commit via arshavir/rust-1.88-toolchain-bump). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cf4ca5b to
f7ac2f8
Compare
….0.0 pocket-ic 13.0.0 depends on ic-management-canister-types 0.5.0, causing type mismatches when the project used 0.3.x. Align versions to resolve the "two different versions of crate" compilation errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
45c0298 to
b3658f5
Compare
PocketIC's with_icp_features(DefaultConfig) doesn't set initial balances for test accounts. Mint ICP to the test controller after the ledger is bootstrapped so tests that transfer ICP don't fail with InsufficientFunds. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b3658f5 to
2b31cd5
Compare
with_icp_features for system canister setup
sea-snake
approved these changes
Apr 2, 2026
…ance count pocket-ic 13.0.0 server crashes (ConnectionReset) when many PocketIC instances are created concurrently in integration tests. Downgrading to 12.0.0 which has the same with_icp_features API but a more stable server. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Relax error message assertion in failed_system_restore test to match across pocket-ic versions (error format changed) - Widen timestamp tolerance in upgrader migration test from 1ms to 1s since system canister initialization can advance time differently Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
After upgrading from a pre-built stable-memory binary (v1), the recovery request timestamps originate from the binary's PocketIC genesis time, which differs from the current run's genesis time (with_icp_features uses a different default). Replace the tight tolerance check with a count assertion and RFC 3339 validation, keeping the timestamp normalization for the subsequent deep comparison. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Duration import was removed but a second usage in the log timestamp comparison was missed, causing a compilation error. Apply the same fix: validate RFC 3339 format without strict time matching, since pre-built stable-memory binaries have different genesis times. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rtions `with_icp_features` with `cycles_minting` changes PocketIC's default time from the IC genesis (2021-05-06T19:17:10 UTC) to the CMC's default ICP/XDR conversion-rate timestamp + 1s (2021-05-10T08:00:01 UTC). Pre-built stable-memory binaries (upgrader-memory-v1.bin) were generated under the old genesis, so we now set the time to IC genesis explicitly when `set_time_to_now` is false. This lets us restore the original precise (1ms) timestamp assertions in the upgrader migration tests. See: https://github.com/dfinity/ic/blob/master/rs/pocket_ic_server/src/pocket_ic.rs (the `default_timestamp` function) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PocketIC with `cycles_minting` feature sets default time to 2021-05-10T08:00:01 UTC (CMC conversion-rate timestamp + 1s) and does not allow setting time to an earlier value. Pre-built stable-memory binaries (v0/v1) were recorded under the IC genesis time (2021-05-06T19:17:10 UTC), so timestamps cannot match after loading those binaries. Add a `check_timestamps` parameter to `test_api()`: - `true` before migration (timestamps are from the current run) - `false` after loading a pre-built binary (timestamps differ) The structural deep-comparison of recovery requests and logs is still performed in all cases; only the tight 1 ms tolerance check is gated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
PocketIcBuilder::with_icp_features(), which automatically bootstraps ICP ledger, ICP index, and CMC system canistersorbitdev scriptTest plan
cargo check --package integration-tests(passes locally)./scripts/run-integration-tests.shto verify all integration tests pass with the new PocketIC-managed system canistersorbit --initstill works for local dev setup🤖 Generated with Claude Code