Skip to content

Gtest IT: log also to stderr, not only to file#461

Merged
wprzytula merged 6 commits into
scylladb:masterfrom
wprzytula:gtest-log-to-stderr
May 25, 2026
Merged

Gtest IT: log also to stderr, not only to file#461
wprzytula merged 6 commits into
scylladb:masterfrom
wprzytula:gtest-log-to-stderr

Conversation

@wprzytula

@wprzytula wprzytula commented May 25, 2026

Copy link
Copy Markdown
Contributor

Motivation

A recent CI run experienced a panic inside the Rust Driver. I couldn't debug it, because no logs were printed.

What's done

C++ Gtest Logger output

Destination

Before, the logs were only output to a file. Now, they are additionally printed to stderr.

Format

  1. Timestamp display was improved, made in line with Rust tracing subscriber's one.
  2. Log level is now coloured (IFF stderr points to a terminal). It uses the same palette as, again, Rust tracing subscriber.

CI

  1. RUST_LOG=trace is now passed, so the logs are visible in the CI run console.
  2. RUST_BACKTRACE=full is now passed, which will aid in debugging.

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • PR description sums up the changes and reasons why they should be introduced.
  • [ ] I have implemented Rust unit tests for the features/changes introduced.
  • [ ] I have enabled appropriate tests in Makefile in {SCYLLA,CASSANDRA}_(NO_VALGRIND_)TEST_FILTER.
  • [ ] I added appropriate Fixes: annotations to PR description.

wprzytula added 6 commits May 25, 2026 10:13
MAINTENANCE.md contained obsolete information that no docs are
available yet.
This will improve debuggability.
This will improve debuggability.
The C++ integration tests used to redirect logs to a file.
In CI, this made debugging harder, especially in case of an abort.
Now the test Logger also passes the logs to stderr, ensuring
the output is visible in real-time.
Color the severity level and dim the target:line when stderr
is a TTY. Uses the same palette as the Rust tracing
subscriber (magenta TRACE, blue DEBUG, green INFO,
yellow WARN, red ERROR).
Format the timestamp as UTC ISO 8601 with millisecond
precision (e.g. 2026-05-25T08:35:04.515Z), matching the
format used by the Rust tracing subscriber.
@wprzytula wprzytula self-assigned this May 25, 2026
@wprzytula wprzytula added the area/testing Related to unit/integration testing label May 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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 improves integration-test observability by mirroring driver logs to stderr while preserving per-test log files, and configures CI to emit richer Rust diagnostics.

Changes:

  • Adds real-time stderr logging in the C++ integration-test logger with UTC timestamps and optional ANSI coloring.
  • Enables RUST_BACKTRACE=full and RUST_LOG=trace across the build/test workflow.
  • Updates maintenance documentation to point to the Sphinx docs directory.

Reviewed changes

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

File Description
tests/src/integration/logger.cpp Adds formatted stderr output alongside existing file logging.
.github/workflows/build-lint-and-test.yml Adds Rust logging/backtrace environment variables for CI jobs.
MAINTENANCE.md Replaces the documentation TODO with a pointer to /docs.

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

@wprzytula

Copy link
Copy Markdown
Contributor Author

CI failures will hopefully be fixed with scylladb/scylla-rust-driver#1644.

Comment thread tests/src/integration/logger.cpp Outdated
Comment thread tests/src/integration/logger.cpp
@wprzytula
wprzytula merged commit 832fb61 into scylladb:master May 25, 2026
15 of 18 checks passed
@wprzytula
wprzytula deleted the gtest-log-to-stderr branch May 25, 2026 16:53
@wprzytula wprzytula added this to the 1.1.0 milestone May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/testing Related to unit/integration testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants