Skip to content

Logging tests#472

Merged
wprzytula merged 6 commits into
scylladb:mainfrom
adespawn:logging-tests
Jun 20, 2026
Merged

Logging tests#472
wprzytula merged 6 commits into
scylladb:mainfrom
adespawn:logging-tests

Conversation

@adespawn

@adespawn adespawn commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Fixes: #44

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@wprzytula, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 8 minutes and 58 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 29da8f8b-30f0-4cd5-bea4-6c678c59db18

📥 Commits

Reviewing files that changed from the base of the PR and between 27e01ed and 5f73fb9.

📒 Files selected for processing (10)
  • package.json
  • src/logging.rs
  • src/tests/logging_tests.rs
  • src/tests/mod.rs
  • test/integration/supported/client-logging-tests.js
  • test/typescript/api-generation-test.ts
  • test/typescript/client-tests.ts
  • test/typescript/types-test.ts
  • test/unit/api-tests.js
  • test/unit/logging-tests.js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@adespawn adespawn mentioned this pull request Jun 11, 2026
@adespawn adespawn changed the title Logging tests [On top of #469] Logging tests Jun 17, 2026
@adespawn adespawn marked this pull request as ready for review June 17, 2026 08:09
@adespawn adespawn requested a review from Copilot June 17, 2026 08:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 test coverage for the Rust→JS logging forwarding layer, including validation of the exposed types.logLevels string enum and multi-callback / lifecycle isolation behaviors.

Changes:

  • Adds new JS unit and integration tests covering log emission, formatting, level filtering, and per-client callback registration/removal.
  • Adds Rust-side NAPI test helpers that emit tracing events for deterministic verification from JS.
  • Adds additional Rust unit tests for MessageVisitor formatting and updates TS API-generation/typecheck tests to include types.logLevels.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/unit/logging-tests.js New unit tests for Rust log forwarding, formatting, filtering, and multi-callback behavior.
test/unit/api-tests.js Verifies types.logLevels is exposed with expected string values.
test/typescript/types-test.ts Typecheck coverage for types.logLevels in TS.
test/typescript/client-tests.ts Typecheck coverage for using logLevel: types.logLevels.* in Client options.
test/typescript/api-generation-test.ts Extends TS API generation checks to include string-enum printing for types.logLevels.
test/integration/supported/client-logging-tests.js New integration tests validating Rust log emission and isolation across shutdown/GC.
src/tests/mod.rs Registers the new Rust test-helper module.
src/tests/logging_tests.rs Adds NAPI-exported Rust helpers that emit tracing events at known levels/fields.
src/logging.rs Adds unit tests for MessageVisitor formatting and existing level parsing/mapping.
package.json Removes --exit from the integration test script.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/logging.rs
Comment thread test/unit/logging-tests.js
Comment thread test/integration/supported/client-logging-tests.js
@adespawn adespawn mentioned this pull request Jun 17, 2026
Comment thread test/unit/logging-tests.js Outdated
adespawn and others added 6 commits June 20, 2026 11:23
At some point the code was changed, in a way that fixes scylladb#44.
This commit fixes scylladb#44 by removing that redundant flag
This includes moving api tests to a proper directory, since those tests
are properly supported.
Covers MessageVisitor field formatting (str message, mixed str/debug
extras, comma separation across multiple fields) and the
rust_level_to_js / parse_js_level_to_rust mapping correctness.
Adds napi test helpers (tests_emit_log_*) that emit tracing events at
controlled levels and with varied field shapes, plus the JS unit suite
that drives them across the FFI boundary:
- forwarding delivers events at all 5 tracing levels
- message content and target (Rust module path) survive the FFI boundary
- multiple registered callbacks each receive events (shared subscriber)
- removeLogging stops delivery without affecting other callbacks
- level filtering only passes events at or above the registered level
- furtherInfo field formatting end-to-end (comma separation, debug
  quotes, int/bool repr)
- default logLevel registers the Rust callback; logLevel 'off' suppresses
  all events
Verifies logging against a real cluster:
- the Rust driver produces log events during connection
- JS and Rust log events coexist during connection
- cleanup works both on explicit shutdown and on GC finalization
@wprzytula wprzytula merged commit 1df6525 into scylladb:main Jun 20, 2026
9 checks passed
@wprzytula wprzytula added this to the 0.7 milestone Jun 20, 2026
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.

Mocha integration tests don't exit after finishing

3 participants