docs: Rust testing guide#100
Conversation
Review: docs/languages/rust/testing.mdMust fix1. Incorrect unit test assertions — code won't compile The 2. CI setup is missing The stub's content brief explicitly lists "CI setup" as a required topic alongside unit tests, PocketIC integration tests, test patterns, and testing upgrades. All other items are covered; CI is omitted entirely. Add a section showing how to run canister tests in CI (caching the PocketIC binary, building the WASM before tests, etc.). Suggestions
Verified ✓
|
|
Feedback addressed for PR #100 (docs/languages/rust/testing.md): Changes applied1. Fixed incorrect unit test assertions (must-fix) The test_counter_endpoints snippet was comparing api.get_count() directly to 0, but Updated all calls to use response struct fields:
The underflow test now also captures the final decrement into a response variable 2. Added CI setup section (must-fix) The stub content brief explicitly lists CI setup alongside unit tests, PocketIC
Based on patterns from .sources/cdk-rs/.github/workflows/ci.yml. 3. Removed ic-cdk-macros from Cargo.toml summary (suggestion applied) ic-cdk-macros is a transitive dependency re-exported by ic-cdk. Listing it as an 4. Added note about hardcoded WASM path (suggestion applied) Added a comment in the get_wasm() snippet explaining that the ../../target/... path Items skippedNone - all four feedback items (two must-fix, two suggestions) were factually |
Summary
Sync recommendation
informed by dfinity/examples — rust/unit_testable_rust_canister; dfinity/cdk-rs — e2e-tests/