test: add final unit tests and update Testing Guide#48
Open
Conversation
Adds `prepare_asset_skips_gzip_when_not_smaller` to `sync.rs` to directly exercise the size-comparison branch in `prepare_asset`. The other two scenarios (text→gzip, binary→identity-only) are already covered by the `encoders_for` tests in `content.rs`, so no E2E tests are needed. Updates TEST.md accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR finalizes previously planned E2E coverage by adding targeted unit tests in assets-sync (chunking boundaries, gzip “not smaller” behavior, authorization error propagation, and pagination behavior), and replaces the old verbose TEST.md “Test Plan” with a concise “Testing Guide” describing where each test layer lives and when to add new tests.
Changes:
- Rewrote
TEST.mdinto a shorter Testing Guide describing the three test components (canister, plugin, e2e) and when to extend each. - Added unit tests in
assets-sync/src/sync.rsfor chunk upload boundary cases, gzip skip behavior, proxy-mode commit permission granting, and permission error propagation fromcreate_batch. - Added unit tests in
assets-sync/src/canister.rsvalidatinglist_assetspagination termination behavior across empty, partial, and multi-page responses.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
TEST.md |
Replaces the prior detailed test plan with a concise guide to running and extending tests by component. |
assets-sync/src/sync.rs |
Adds unit tests for chunking boundaries, gzip skip behavior, and authorization-related sync flows. |
assets-sync/src/canister.rs |
Adds unit tests for list_assets pagination behavior across different page patterns. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TEST.mdwith a concise Testing Guide focused on what testers actually need