[PR #2232] [CLOSED] stage_timeline: a missing or unreadable log is one error line; add unit tests (TOOL-STAGE-TIMELINE-TESTS) #2237

Closed
opened 2026-11-26 21:20:31 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2232
Author: @real-rusher
Created: 11/26/2026
Status: ❌ Closed

Base: main ← Head: stage-timeline-tests


📝 Commits (2)

  • 4e34d30 stage_timeline: a missing or unreadable log is one error line, not a traceback
  • afeee54 tests: unit tests for tools/stage_timeline.py

📊 Changes

2 files changed (+171 additions, -1 deletions)

View changed files

➕ tests/test_stage_timeline.py (+166 -0)
📝 tools/stage_timeline.py (+5 -1)

📄 Description

Claimed in the coordination issue as: TOOL-STAGE-TIMELINE-TESTS (#1608)

What and why

tools/stage_timeline.py had no tests, and a wrong path or a folder ended in a FileNotFoundError or IsADirectoryError traceback. It now prints stage_timeline: error: cannot read <log>: <reason> and exits 2, like awc_names and check_no_game_data.

tests/test_stage_timeline.py covers read() and timeline() on synthetic logs (stage changes, "?" and list values, the session low dword, unknown values, press pairing, the loading screen end) and the command line (text and JSON reports, no peek lines, a missing log, a folder). Standard library only, no game data.

Tested

python -I tests/test_stage_timeline.py: 13 tests pass. On main, the two error tests fail and the other 11 pass.
Also run: python -m compileall -q make_game.py tools tests, scripts/check_no_game_data.py on both files, tests/test_ci_registration.py, tests/test_text_write_line_endings.py. All pass. Linux, Python 3.13.

GPUs tested: n/a

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a, no translator change)

🤖 Assisted by Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2232 **Author:** [@real-rusher](https://github.com/real-rusher) **Created:** 11/26/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `stage-timeline-tests` --- ### 📝 Commits (2) - [`4e34d30`](https://github.com/ubiquitarianism/leonida/commit/4e34d30fc73943af682bb40d482668eb5506871a) stage_timeline: a missing or unreadable log is one error line, not a traceback - [`afeee54`](https://github.com/ubiquitarianism/leonida/commit/afeee543b2b0a743c6833b68d1e99a8f1871d000) tests: unit tests for tools/stage_timeline.py ### 📊 Changes **2 files changed** (+171 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `tests/test_stage_timeline.py` (+166 -0) 📝 `tools/stage_timeline.py` (+5 -1) </details> ### 📄 Description Claimed in the coordination issue as: TOOL-STAGE-TIMELINE-TESTS (#1608) ### What and why tools/stage_timeline.py had no tests, and a wrong path or a folder ended in a FileNotFoundError or IsADirectoryError traceback. It now prints `stage_timeline: error: cannot read <log>: <reason>` and exits 2, like awc_names and check_no_game_data. tests/test_stage_timeline.py covers read() and timeline() on synthetic logs (stage changes, "?" and list values, the session low dword, unknown values, press pairing, the loading screen end) and the command line (text and JSON reports, no peek lines, a missing log, a folder). Standard library only, no game data. ### Tested python -I tests/test_stage_timeline.py: 13 tests pass. On main, the two error tests fail and the other 11 pass. Also run: python -m compileall -q make_game.py tools tests, scripts/check_no_game_data.py on both files, tests/test_ci_registration.py, tests/test_text_write_line_endings.py. All pass. Linux, Python 3.13. GPUs tested: n/a AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a, no translator change) 🤖 Assisted by [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 21:20:31 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#2237
No description provided.