Skip to content

Add unit tests for coverage of core s3s modules#519

Merged
Nugine merged 4 commits intomainfrom
copilot/improve-code-coverage-100
Feb 27, 2026
Merged

Add unit tests for coverage of core s3s modules#519
Nugine merged 4 commits intomainfrom
copilot/improve-code-coverage-100

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

  • Add tests for s3s::time (now_utc, Instant::now, Instant::elapsed)
  • Add tests for s3s::stream (RemainingLength, VecByteStream, into_dyn, Debug impls, From conversions)
  • Add tests for s3s::utils::format (fmt_boolean, fmt_integer, fmt_long, fmt_usize, fmt_timestamp)
  • Add tests for s3s::sig_v4::amz_content_sha256 (parse all 7 variants, is_streaming, has_trailer, error case)
  • Add tests for s3s::sig_v2::post_signature_v2 (extract success and 3 missing-field cases)
  • Add tests for s3s::service (set_auth, set_host, set_route, set_access, Debug, Clone)
  • Add tests for s3s::s3_op (S3Operation::name)
  • Add tests for s3s::protocol (HttpError, TrailingHeaders, S3Request::map_input, S3Response constructors/map_output)
  • Add tests for s3s::path (S3Path accessor methods, check_key boundary, edge cases)
  • All tests pass (458 total), clippy clean
  • Code review passed with no issues
  • Fix CI: apply cargo fmt --all to 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.

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

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 98.32134% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/s3s/src/service.rs 82.92% 7 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Nugine
Copy link
Member

Nugine commented Feb 27, 2026

@copilot fix CI failure of current PR

Co-authored-by: Nugine <30099658+Nugine@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 27, 2026

@copilot fix CI failure of current PR

Fixed in 04f713e. The CI was failing because cargo fmt --all --check detected a formatting difference in post_signature_v2.rs (a multi-line vec! that rustfmt wanted on one line). Applied cargo fmt --all to resolve it.

@Nugine Nugine marked this pull request as ready for review February 27, 2026 04:48
Copilot AI review requested due to automatic review settings February 27, 2026 04:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (service builder setters, protocol request/response mapping, path parsing/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>
@Nugine Nugine enabled auto-merge February 27, 2026 04:56
@Nugine Nugine added this pull request to the merge queue Feb 27, 2026
Merged via the queue into main with commit 4228277 Feb 27, 2026
17 checks passed
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.

3 participants