Repository navigation
Tests: pin the process logger's level filter and file line format - #1589
amazedturnip wants to merge 1 commit into
Conversation
crates/xcl/src/log.rs had zero inline tests and zero integration coverage. This test pins its contract: Level::parse (case-insensitive, 'warning'->Warn, unknown->Info), enabled() as an ordering comparison against the level set by init, and write() emitting one '[<elapsed>][<tid>][<TAG>] <msg>\n' line per enabled level and nothing otherwise. It covers init() creating the log's parent directory, the Warn filter dropping Info/Debug/Trace lines, and the exact '[elapsed][tid][TAG] message' line shape. Note: the logger keeps process-wide state (file handle, level, echo flag), so this test lives in its own binary (the default for a new integration test file) with a single #[test]: no other test in this file may observe or set that state.
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Empirical test report (466a425)Hardware / environment
Commands and results
$env:XCL_ADAPTER = 'NONE_CPU_ONLY'; $env:RUST_TEST_NOCAPTURE = '1'; cargo test -p xcl --test log_contract -- --nocapture 2>&1 | Tee-Object -FilePath 'L:\XclTooling\neon-slot-1\tmp\pr1589-focused.log'
Observed behavior
Not tested This verification covered workspace test compilation and the focused CPU test. It omitted execution of the full GPU workspace suite and game smoke runs. AI use Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against |
|
Nothing has happened on this PR for 3 days, so it is marked |
|
Still merges cleanly onto main (765b2c5) with passing checks; pins process logger level filtering and output line format contracts — waiting on maintainer / post-goal review. |
|
No open or merged PR tests the logger's level filter and line format; main's log.rs has only AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Pins the process logger's contract in a single host-local integration test: Level::parse (case-insensitive; 'warning'->Warn; unknown/empty -> Info), enabled() as an ordering comparison against the level set by init(), and write() emitting one '[][][TAG] \n' line per enabled level and nothing otherwise. init() is also verified to create the log's parent directory and file. Single #[test] in its own binary (no shared Logger state with other tests).
What is in it
crates/xcl/tests/log_contract.rs: new integration test pinninglog::Level::parse(case-insensitive, 'warning'->Warn, unknown/empty -> Info),enabled()as an ordering comparison against the level set byinit, andwrite()emitting one[<elapsed>][<tid>][<TAG>] <msg>\nline per enabled level and nothing otherwise. Also pins thatinit()creates the log's parent directory and the log file itself. Single test in its own binary (no other test may observe or set the process-wide logger state).Tested
AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64),XCL_ADAPTER=radeon):cargo test --workspace -- --test-threads=1— 777 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 1 (no heap windows))cargo test --test log_contractFAILED with 'assertionleft == rightfailed' on line 43 (Level::parse("warning") expected Warn, got Info). Thengit checkout -- crates/xcl/src/log.rsrestored the source; original run passes.Not tested
AI use