Add unit tests for coverage of core s3s modules#519
Merged
Conversation
Add tests for: time, stream, utils::format, sig_v4::amz_content_sha256, sig_v2::post_signature_v2, service, s3_op, protocol, and path modules. Co-authored-by: Nugine <30099658+Nugine@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Increase code coverage for specified modules
Add unit tests for coverage of core s3s modules
Feb 27, 2026
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Member
|
@copilot fix CI failure of current PR |
Co-authored-by: Nugine <30099658+Nugine@users.noreply.github.com>
Contributor
Author
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds unit tests across several core s3s modules to improve coverage of foundational utilities (time, streaming, protocol types, path parsing, and signature helpers).
Changes:
- Added unit tests for small utility modules (
time,utils::format,stream) to cover basic formatting/behavior and trait impls. - Added unit tests for signature parsing helpers (
sig_v4::amz_content_sha256,sig_v2::post_signature_v2). - Added unit tests for core types/constructors (
servicebuilder setters,protocolrequest/response mapping,pathparsing/accessors,S3Operation::name).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/s3s/src/utils/format.rs | Adds unit tests for boolean/integer/timestamp formatting helpers. |
| crates/s3s/src/time.rs | Adds unit tests for now_utc and Instant basic usage. |
| crates/s3s/src/stream.rs | Adds unit tests for RemainingLength, VecByteStream, and into_dyn. |
| crates/s3s/src/sig_v4/amz_content_sha256.rs | Adds unit tests for parsing all supported x-amz-content-sha256 variants. |
| crates/s3s/src/sig_v2/post_signature_v2.rs | Adds unit tests for extracting POST SigV2 multipart fields and missing-field cases. |
| crates/s3s/src/service.rs | Extends builder/service tests (auth/host/route/access + Debug/Clone). |
| crates/s3s/src/s3_op.rs | Adds a unit test for S3Operation::name(). |
| crates/s3s/src/protocol.rs | Adds unit tests for HttpError, TrailingHeaders, S3Request::map_input, and S3Response constructors/map_output. |
| crates/s3s/src/path.rs | Adds unit tests for S3Path accessors and additional parsing/key/bucket edge cases. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
s3s::time(now_utc, Instant::now, Instant::elapsed)s3s::stream(RemainingLength, VecByteStream, into_dyn, Debug impls, From conversions)s3s::utils::format(fmt_boolean, fmt_integer, fmt_long, fmt_usize, fmt_timestamp)s3s::sig_v4::amz_content_sha256(parse all 7 variants, is_streaming, has_trailer, error case)s3s::sig_v2::post_signature_v2(extract success and 3 missing-field cases)s3s::service(set_auth, set_host, set_route, set_access, Debug, Clone)s3s::s3_op(S3Operation::name)s3s::protocol(HttpError, TrailingHeaders, S3Request::map_input, S3Response constructors/map_output)s3s::path(S3Path accessor methods, check_key boundary, edge cases)cargo fmt --allto resolve formatting check failure🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.