Skip to content

chore: migrate rust/unit_testable_rust_canister to icp-cli#1405

Draft
marc0olo wants to merge 5 commits into
masterfrom
worktree-agent-a87c071a4181f6c34
Draft

chore: migrate rust/unit_testable_rust_canister to icp-cli#1405
marc0olo wants to merge 5 commits into
masterfrom
worktree-agent-a87c071a4181f6c34

Conversation

@marc0olo

@marc0olo marc0olo commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary

Migrates rust/unit_testable_rust_canister from dfx to icp-cli.

Removed: dfx.json, BUILD.md, .devcontainer/, old dfx-based CI workflow

Changed:

  • Source moved from src/hello_canister/ to backend/; package renamed to backend
  • hello_canister.didbackend/backend.did; Candid compatibility test and integration test WASM path updated accordingly
  • pocket-ic updated from 9.0.2 to 14.0.0

Added:

  • icp.yaml with @dfinity/rust@v3.3.0 recipe
  • test.sh with 5 tests covering all public endpoints
  • CI workflow with three steps: unit tests (cargo test --lib), PocketIC integration tests (cargo test --test integration_tests) using the dfinity/pocketic action, and icp-cli deploy + bash test.sh

Test plan

  • cargo test --lib passes (unit tests)
  • cargo test --test integration_tests passes (PocketIC integration tests, requires PocketIC server)
  • icp network start -d && icp deploy && bash test.sh passes
  • CI job passes

🤖 Generated with Claude Code

marc0olo and others added 2 commits June 17, 2026 19:00
- Replace dfx.json with icp.yaml using @dfinity/rust@v3.3.0 recipe
- Move src/hello_canister/ to backend/, rename package to "backend"
- Rename hello_canister.did to backend/backend.did
- Update lib.rs candid_interface_compatibility test to reference backend.did
- Update integration_tests.rs to use backend crate and backend.wasm paths
- Add Makefile with test target exercising all public canister endpoints
- Add CI workflow with cargo test --lib step plus icp deploy + make test
- Delete old dfx-based CI workflow rust-unit-testable-rust-canister-example.yml
- Update README with icp-cli deploy instructions, preserve architecture docs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…CI image to 1.0.1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marc0olo marc0olo force-pushed the worktree-agent-a87c071a4181f6c34 branch from 8f8221f to bf60780 Compare June 17, 2026 17:01
marc0olo and others added 3 commits June 19, 2026 17:18
…ion tests in CI

- Update pocket-ic from 9.0.2 to 14.0.0 (API is compatible, no code changes needed)
- Add PocketIC integration test step to CI using dfinity/pocketic action
- README documents how to install PocketIC server and run integration tests locally

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…egration tests

The integration tests try to load the WASM at runtime but the in-test
rebuild logic fails in CI due to working directory differences. Explicitly
build the WASM first (same pattern as guards PR 1396).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n example, not a branch

The candid-type-generation branch no longer exists as such — the content
is now the rust/candid_type_generation example in this repo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant