Skip to content

test: drop gratuitous --subnet args; add focused subnet-routing tests#580

Merged
lwshang merged 1 commit into
mainfrom
test/drop-gratuitous-subnet-arg
Jun 2, 2026
Merged

test: drop gratuitous --subnet args; add focused subnet-routing tests#580
lwshang merged 1 commit into
mainfrom
test/drop-gratuitous-subnet-arg

Conversation

@lwshang
Copy link
Copy Markdown
Contributor

@lwshang lwshang commented Jun 2, 2026

Summary

Bumps the network-launcher to 14.0.0-2026-05-29-04-44 and fixes the integration-test fallout.

  • What broke: launcher 14.0.0 makes the fiduciary and test-threshold-keys subnets always-on, which shifts the deterministically-derived subnet ids. The hard-coded SUBNET_ID no longer existed, so ~40 tests failed with subnet_not_found.
  • Root cause: most of those tests passed --subnet as cargo-culted boilerplate — they just need a canister, not a specific subnet, so they were needlessly coupled to the launcher topology.
  • Fix: drop --subnet (and the SUBNET_ID constant) from all subnet-agnostic tests, leaving canister creation to auto-select an application subnet.
  • Keep explicit subnet selection only where it's the point: the CloudEngine tests (now discovering ids at runtime) plus two new focused tests asserting --subnet <id> actually routes the canister to the requested subnet.
  • Result: net −90 lines, and the suite is immune to future launcher topology changes.

Supersedes the bot's plain version-bump PR (#579), which left the tests red.

Test plan

With the v14 launcher fixture:

  • both new focused routing tests pass
  • deploy / canister_create / canister_settings / sync / network / metadata / delete / info / status / start / stop tests pass
  • the 3 affected identity tests pass
  • cargo fmt and cargo clippy --tests -p icp-cli clean

🤖 Generated with Claude Code

The network-launcher 14.0.0 bump makes the `fiduciary` and
`test-threshold-keys` subnets always-on, which shifts the deterministically
derived subnet ids. The hard-coded `common::SUBNET_ID` no longer existed,
breaking ~40 integration tests with `subnet_not_found`.

Most of those tests passed `--subnet` only as cargo-culted boilerplate —
they just need *a* deployed canister, not a specific subnet. `deploy`
auto-selects an application subnet from CMC, so the arg added nothing while
coupling the tests to the launcher topology. Drop `--subnet` (and the
`SUBNET_ID` constant) from all subnet-agnostic tests; they no longer touch
the topology and are immune to future launcher changes.

Keep explicit subnet selection only where it is the point of the test:
- the two CloudEngine tests, now consolidated onto the new
  `TestContext::{cloud_engine_subnet_id, subnet_id_by_kind}` helpers that
  discover ids from the running network's /_/topology endpoint;
- two new focused tests, `deploy_routes_canister_to_requested_subnet` and
  `canister_create_on_requested_subnet`, that assert `--subnet <id>` routes
  the canister to the requested subnet (using `application_subnet_id`).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lwshang lwshang marked this pull request as ready for review June 2, 2026 16:54
@lwshang lwshang requested a review from a team as a code owner June 2, 2026 16:54
@lwshang lwshang enabled auto-merge (squash) June 2, 2026 16:59
@lwshang lwshang merged commit ba4cfd1 into main Jun 2, 2026
152 of 154 checks passed
@lwshang lwshang deleted the test/drop-gratuitous-subnet-arg branch June 2, 2026 21:15
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