Files
arena-tracker/crates/core/tests/journal.rs
T
nessarandClaude Opus 5.5 3d4c8bbc83
CI / core (pull_request) Failing after 1m45s
Address review: Journal private, client found/gone, sync redaction test (#142)
- Rule #3: Journal and its open/launch are private again; the writer's
  tests move to src/journal/tests.rs, only the launch test stays an
  integration test. The « Ouvrir le dossier des journaux » selector sits
  on the button itself, not on a div drawn for the test.
- The log notes the League client found and gone (its event stream
  connects or drops), and a client without anyone signed in reads
  "nobody signed in" instead of "absent".
- Other libraries (GPUI…) reach the log only with errors: their info and
  warnings may come per frame. The HTTP client stays out entirely.
- The log opens after the single-instance check: a relayed launch no
  longer writes to, nor rotates, the running instance's log.
- A whole sync through the Riot adapter is tested to log neither the key
  nor a full PUUID. The URL comment follows the spec: Riot IDs may be
  logged, a full PUUID may not.
- --verify-release keeps its eprintln: the publishing script reads it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 16:52:48 +01:00

21 lines
849 B
Rust

//! The application log as the app installs it (#142). The writer's own tests are in
//! `src/journal/tests.rs`.
use std::fs;
use arena_tracker_core::init_journal;
/// The only test that installs the process's logger.
#[test]
fn launching_creates_the_file_with_the_version_and_the_channel() {
let data = tempfile::tempdir().unwrap();
init_journal(data.path(), false, "9.8.7", "beta", || {}).unwrap();
log::info!(target: "arena_tracker", "after the launch");
log::logger().flush();
let text = fs::read_to_string(data.path().join("logs").join("arena-tracker.log")).unwrap();
let lines: Vec<_> = text.lines().collect();
assert_eq!(lines.len(), 2, "{text}");
assert!(lines[0].contains("INFO Arena Tracker 9.8.7 started (update channel: beta)"));
assert!(lines[1].ends_with("INFO after the launch"), "{text}");
}