Skip to content

fix(ci): quiet Rust test output - #1407

Merged
lovasoa merged 3 commits into
mainfrom
fix/quiet-rust-test-output
Aug 30, 2026
Merged

fix(ci): quiet Rust test output#1407
lovasoa merged 3 commits into
mainfrom
fix/quiet-rust-test-output

Conversation

@lovasoa

@lovasoa lovasoa commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Problem

The PostgreSQL matrix failure in the referenced job is difficult to diagnose because the failure output contains every passing test and a very large repeated SQL error.

Root Cause

stop_at_first_error logged every DbItem::Error with the full anyhow chain at error level. The same error was then handled downstream. For error_too_many_nested_inclusions.sql, each recursive sqlpage.run_sql context was included repeatedly, producing a huge target=sqlpage::webserver::database::execute_queries line. The aggregate SQL-file test attached all captured logs to one failure.

Recursive errors were also wrapped again by each parent run_sql call and statement-position formatter, so development error pages repeated the same context.

Fix

  • Stop logging the database error redundantly in stop_at_first_error; downstream error handling remains responsible for the error response.
  • Run compiled Rust test binaries with --quiet in the database matrix, removing successful-test chatter while preserving failures and captured diagnostics.
  • Preserve an already-positioned nested error instead of wrapping it again, and return nested run_sql errors without adding repeated context.
  • Assert that the recursive-inclusion fixture does not expose repeated run_sql: unable to run context.

Before

From the linked job:

running 75 tests
test basic::test_static_files ... ok
test configuration_docs::configuration_md_documents_every_option ... ok
... dozens of other passing tests ...
test sql_test_files::run_all_sql_test_files ... FAILED

---- sql_test_files::run_all_sql_test_files stdout ----
ts=... level=error msg="In \\"tests/sql_test_files/component_rendering/error_too_many_nested_inclusions.sql\\": ... run_sql: unable to run ... run_sql: unable to run ... [repeated recursive context]" target=sqlpage::webserver::database::execute_queries
...
Test timeout: tests/sql_test_files/data/fetch_with_meta_error.sql

After

The same failure retains the actionable test and panic while removing passing-test chatter and the duplicate recursive log:

running 75 tests
sql_test_files::run_all_sql_test_files --- FAILED

---- sql_test_files::run_all_sql_test_files stdout ----
...
Test timeout: tests/sql_test_files/data/fetch_with_meta_error.sql

For a recursive inclusion request in development, the response now contains one positioned error with the Too many nested inclusions message, rather than a repeated run_sql: unable to run chain. Production behavior remains the generic safe error response.

Validation

  • cargo test --quiet
  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • git diff --check

@lovasoa
lovasoa merged commit 133485c into main Aug 30, 2026
51 checks passed
@lovasoa
lovasoa deleted the fix/quiet-rust-test-output branch August 30, 2026 10:02
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.

1 participant