Repository navigation
chore: bump PocketIC 9.0.3 → 15.0.0 - #4078
Merged
Merged
Conversation
Bump the PocketIC test harness to v15, which is the first version whose bundled replica implements the request-delegation `permissions` extension (dfinity/ic#10449). This unblocks adding integration tests that exercise read-only (queries-only) delegation enforcement end-to-end. - Cargo.toml: pocket-ic "9.0.2" -> "15" (transitively bumps candid 0.10.20->0.10.31, ic-management-canister-types 0.3.3->0.5.0, ic-transport-types 0.40->0.45). Compiles with no code changes. - scripts/test-canisters.sh: POCKET_IC_SERVER_VERSION 9.0.3 -> 15.0.0 (same release asset name; download mechanism unchanged). - .github/workflows/canister-tests.yml: the two `dfinity/pocketic` action pins 9.0.3 -> 15.0.0. The E2E launcher pin (icp-cli-network-launcher v12, see the comment re dfinity/ic#10226) is intentionally left untouched — it is a separate pocket-ic used by the Playwright suite. Validated locally: the full `delegation` integration suite (37 tests) passes against pocket-ic-server 15.0.0; CI runs the complete suite. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018gHRjyFYqumMxAMwbPRLuN
vc_issuer directly pins pocket-ic and path-depends on canister_tests; the root bump to 15 made canister_tests require pocket-ic 15, colliding with vc_issuer's own 9.0.2 pin (two pocket_ic versions -> 55 type errors, plus a stale sibling lockfile). Align vc_issuer to pocket-ic 15 and refresh its lock. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018gHRjyFYqumMxAMwbPRLuN
PocketIC v15 funds freshly-created canisters with a default cycle balance, which broke three assertions that compared against hard-coded / absolute balances: - archive `should_expose_status`: assert the status exposes a funded balance (> 0) rather than the old hard-coded 0; `api::status` is an update call so it cannot be compared against `env.cycle_balance`. - `should_deploy_archive_with_cycles`: assert the *delta* spent on archive creation (exactly `canister_creation_cycles_cost`) instead of an absolute post-deploy balance, which is base-dependent now. - `icrc3_test_vectors`: also strip the environment-dependent top-level `root_key_hex` and `canister_sig_pk_hex` (which embeds the PocketIC-assigned canister id) before comparing. The deterministic `message_hex` / `signed_message_hex` bytes are unchanged.
|
✅ No security or compliance issues detected. Reviewed everything up to ae37fd7. Security Overview
Detected Code Changes
|
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the project’s PocketIC-based integration-test harness to PocketIC v15 (server + Rust crate), and adjusts a few cycle- and snapshot-related assertions to account for v15’s environment-dependent outputs and default canister funding behavior.
Changes:
- Bump
pocket-icdependency (workspace + VC issuer demo) and refresh lockfiles. - Update CI + scripts to install/run
pocket-ic-server 15.0.0. - Adapt a small set of integration tests to assert stable deltas/fields instead of environment-dependent absolute values.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
Cargo.toml |
Bumps workspace pocket-ic dependency to major v15. |
Cargo.lock |
Lockfile refresh reflecting transitive dependency updates from PocketIC v15. |
demos/vc_issuer/Cargo.toml |
Bumps demo’s direct pocket-ic dependency to v15 to avoid multi-version conflicts. |
demos/vc_issuer/Cargo.lock |
Demo lockfile refresh for PocketIC v15 and transitive changes. |
scripts/test-canisters.sh |
Updates POCKET_IC_SERVER_VERSION to 15.0.0. |
.github/workflows/canister-tests.yml |
Updates GitHub Actions PocketIC server version pins to 15.0.0. |
src/internet_identity/tests/integration/archive_integration.rs |
Updates archive deployment cycle assertions to use a delta rather than an absolute balance. |
src/archive/tests/tests.rs |
Updates status test to assert non-zero cycles (PocketIC now funds new canisters). |
src/internet_identity/tests/integration/attributes.rs |
Makes ICRC-3 snapshot comparisons robust by stripping additional environment-dependent fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- should_deploy_archive_with_cycles: hoist the creation cost into a single named constant (used by both the init arg and the assertion) and compute the spent delta with a checked subtraction so a deploy that fails to spend cycles reports a clear message instead of risking an underflow panic. - should_expose_status: document why `cycles` (a candid::Nat) is compared against the `0u8` primitive via `Nat: PartialOrd<u8>` — constructing an owned Nat for the comparison trips clippy::cmp_owned.
nmattia
approved these changes
Jul 2, 2026
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.
Motivation
Bump the PocketIC test harness to v15 — the first version whose bundled replica implements the request-delegation
permissionsextension (dfinity/ic#10449). This is a prerequisite for adding integration tests that exercise read-only (queries-only) delegation enforcement end-to-end (follow-up to #4016). Landing the bump on its own keeps that dependency/infra change reviewable in isolation, separate from the feature work.Changes
Cargo.toml:pocket-ic"9.0.2"→"15". This transitively bumpscandid0.10.20→0.10.31,ic-management-canister-types0.3.3→0.5.0, andic-transport-types0.40→0.45 across the workspace (i.e. it touches the II canister's own dependency tree). The canister and the test framework compile with no code changes.demos/vc_issuer/Cargo.toml: samepocket-ic"9.0.2"→"15"bump (it pins pocket-ic directly and path-depends oncanister_tests, so it must move in lockstep to avoid a two-version collision), plus theCargo.lockrefresh.scripts/test-canisters.sh:POCKET_IC_SERVER_VERSION9.0.3 → 15.0.0 (same release-asset name; download mechanism unchanged)..github/workflows/canister-tests.yml: the twodfinity/pocketicaction pins 9.0.3 → 15.0.0.archive::should_expose_status: assert the status exposes a funded balance (> 0) instead of a hard-coded0.should_deploy_archive_with_cycles: assert the delta spent on archive creation (exactlycanister_creation_cycles_cost) rather than an absolute, base-dependent post-deploy balance.icrc3_test_vectors: also strip the environment-dependent top-levelroot_key_hexandcanister_sig_pk_hex(the latter embeds the PocketIC-assigned canister id) before comparing. The deterministicmessage_hex/signed_message_hexbytes are byte-identical — no II-side change.The E2E Playwright launcher pin (
icp-cli-network-launcherv12, see the in-file comment about dfinity/ic#10226) is intentionally left untouched — that's a separate pocket-ic build used only by the browser suite.Tests
cargo checkacrossinternet_identity+canister_tests(incl. tests): clean, no porting needed.delegationintegration suite (37 tests) passes locally againstpocket-ic-server 15.0.0.pocket-ic-server 15.0.0.🤖 Generated with Claude Code
https://claude.ai/code/session_018gHRjyFYqumMxAMwbPRLuN
Generated by Claude Code