Skip to content

test: add basic e2e crate#46

Merged
lwshang merged 7 commits intomainfrom
lwshang/SDK-2698_test_p3
May 7, 2026
Merged

test: add basic e2e crate#46
lwshang merged 7 commits intomainfrom
lwshang/SDK-2698_test_p3

Conversation

@lwshang
Copy link
Copy Markdown
Collaborator

@lwshang lwshang commented May 6, 2026

Summary

  • Adds the e2e/ workspace crate with LocalNetwork RAII infrastructure and a basic deploy/assert test against the example/ project
  • Decodes canister responses via icp canister call -o hex + candid::decode_args into typed structs (AssetDetails, AssetEncodingDetails) copied from assets-sync::canister — no candid_parser or IDLValue traversal needed
  • Adds icp-cli installation step in the test CI job in .github/workflows/ci.yml
  • Updates TEST.md to reflect the hex-decode approach and list candid/hex in the infrastructure table

Test fixture strategy

The example/ project at the workspace root has been moved into e2e/tests/fixture/basic/ and is now the canonical fixture for e2e tests. Each test calls setup_project(), which copies the fixture into a fresh tempfile::TempDir and places the pre-built WASM files (provided by build.rs via CANISTER_WASM/PLUGIN_WASM env vars) under wasms/. This gives every test an isolated working directory so tests can run concurrently without interfering with each other. Additional fixtures for future test scenarios can be added as subdirectories under e2e/tests/fixture/ and loaded with the same setup_project() helper.

🤖 Generated with Claude Code

Adds the e2e/ workspace crate with LocalNetwork infrastructure and a
basic deploy/list test. Canister responses are decoded via -o hex +
candid::decode_args into typed structs (AssetDetails, AssetEncodingDetails)
copied from assets-sync::canister, removing the candid_parser dependency.
Also wires up the e2e CI job and updates TEST.md to reflect the approach.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lwshang lwshang changed the title test: add e2e crate with typed Candid decoding test: add basic e2e crate May 6, 2026
@lwshang lwshang marked this pull request as ready for review May 6, 2026 21:11
@lwshang lwshang requested a review from a team as a code owner May 6, 2026 21:11
Comment thread e2e/tests/basic.rs
Comment thread e2e/tests/basic.rs
Comment thread e2e/tests/basic.rs Outdated
lwshang and others added 4 commits May 7, 2026 12:41
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the `example/` directory with a self-contained fixture under
`e2e/tests/fixture/basic/`. A new `e2e/build.rs` pre-builds the canister
and plugin WASMs so the test copies pre-built binaries into a temp dir
rather than invoking `cargo build` (or `ic-wasm`) at deploy time.
This removes the `ic-wasm` dependency from CI and from icp.yaml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Parse proxy_canister_principal from `icp network status --json` output
and deploy with the --proxy flag, verifying assets are served correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Concurrent tests both called `icp network start` on port 8000, causing
conflicts. Setting `gateway.port: 0` lets each test get an ephemeral port.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lwshang lwshang merged commit 9177d56 into main May 7, 2026
11 checks passed
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