Skip to content

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

Draft
marc0olo wants to merge 1 commit into
masterfrom
worktree-agent-a87c071a4181f6c34
Draft

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

Conversation

@marc0olo

Copy link
Copy Markdown
Member

Summary

  • Replace dfx.json with icp.yaml using @dfinity/rust@v3.3.0 recipe
  • Move src/hello_canister/backend/, rename Cargo package from hello_canister to backend
  • Rename hello_canister.didbackend/backend.did; update lib.rs candid compatibility test to reference backend.did
  • Update backend/tests/integration_tests.rs to import from the backend crate and reference backend.wasm
  • Add Makefile with test target exercising all 5 public endpoints (get_count, increment_count, decrement_count, get_proposal_info, get_proposal_titles)
  • Add CI workflow unit_testable_rust_canister.yml with a cargo test --lib step (unit tests) plus icp deploy + make test; delete old dfx-based workflow
  • Update README.md with icp-cli deploy instructions, preserve architecture/testing-strategy documentation

Test plan

  • cargo test --lib passes (unit tests with mocked dependencies)
  • icp network start -d && icp deploy && make test passes on a clean local environment
  • CI job rust-unit_testable_rust_canister passes in the new workflow

🤖 Generated with Claude Code

- 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>
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