Skip to content

Expand test coverage and fix incorrect stub type annotations#49

Merged
s3rius merged 1 commit intofeature/otlp-js-consumersfrom
copilot/analyze-test-coverage-improve-tests
Apr 9, 2026
Merged

Expand test coverage and fix incorrect stub type annotations#49
s3rius merged 1 commit intofeature/otlp-js-consumersfrom
copilot/analyze-test-coverage-improve-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

Test coverage had gaps across several API surfaces, and a handful of stub type annotations were wrong in ways that would mislead type checkers and users.

Stub fixes

  • kv.pyi: KVConfig.description was annotated str (should be str | None); max_age and limit_markers were float | None (Rust Duration exposes as Python timedelta, not float)
  • stream.pyi: SubjectTransform.__new__ removed — the class has no Python constructor (Rust-internal only); StreamInfo.created corrected from float to int (Rust i64 Unix timestamp)

New tests (+33, 268 → 301)

Nats client propertiesaddr, token, nkey, user_and_pass, custom_inbox_prefix, read_buffer_capacity, sender_capacity, max_reconnects: default values and custom construction both covered.

Subscription context managerSubscriptionCtxManager.detatch() was untested.

JetStreamjs.counters manager property.

Streamstream.name, StreamInfo.created, StreamState.subjects_count, StreamState.first/last_timestamp, StreamState.consumer_count.

ConsumersPullConsumer.consume() and PushConsumer.consume() context managers were never exercised.

JetStreamMessage properties__len__, length, published, pending, delivered, consumer_sequence, stream_sequence, consumer, stream.

KVKVEntry.seen_current, KVConfig.max_age timedelta round-trip, KVConfig.description None.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.00%. Comparing base (1e67c68) to head (27b8c6b).
⚠️ Report is 1 commits behind head on feature/otlp-js-consumers.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@                      Coverage Diff                      @@
##           feature/otlp-js-consumers      #49      +/-   ##
=============================================================
+ Coverage                      85.41%   87.00%   +1.58%     
=============================================================
  Files                             32       32              
  Lines                           3100     3100              
=============================================================
+ Hits                            2648     2697      +49     
+ Misses                           452      403      -49     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@s3rius s3rius merged commit b1bddb7 into feature/otlp-js-consumers Apr 9, 2026
9 checks passed
@s3rius s3rius deleted the copilot/analyze-test-coverage-improve-tests branch April 9, 2026 17:40
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.

2 participants