Track exception occurrences across test runs - #325
Merged
Merged
Conversation
Reimplements the exception-tracking feature from the stale PR #253 on a fresh branch off main (5 months of drift made the original diff conflict in 10 files), using its diff as the spec rather than resolving merge conflicts. - New ExceptionProcessor (processors.py): a ResultVisitor that tracks TRY/EXCEPT depth and records the message of the innermost failing keyword per TRY block (nested TRY, FOR-loops inside TRY, and keyword-wrapping- keyword cases all only count the leaf failure, not parents/ancestors). - New `exceptions` SQLite table (queries.py, database.py): created for both fresh and legacy databases, inserted per-run, included in get_data(), and cleaned up in _remove_run() — all defensively tolerant of a missing table for custom database classes. - New "Keyword Exceptions" graph (bar/timeline, keyword.js + graph_data/exceptions.js) and "Table Exception" (tables.js), wired through the existing graphMetadata-driven layout system — no changes needed to layout.js/graphs.js/settings.js since graph visibility and GridStack placement are fully data-driven from graphMetadata.js. - filter.js: filteredExceptions flows through the same timezone/filter/sort pipeline as the other filtered arrays. Validated end-to-end against a real Robot Framework suite exercising nested TRY/EXCEPT, a FOR loop inside TRY, and a keyword wrapping another failing keyword — exception counts matched hand-counted expectations exactly, the `exceptions` table and dashboard HTML embed the right data, and the bundled JS (extracted from the generated HTML) is syntax-clean with no duplicate function declarations. Tests: 30 new Python tests (ExceptionProcessor unit tests, database insert/get/remove-run round-trips including a missing-table legacy-DB case, dashboard placeholder embedding) and 10 new JS tests for get_exceptions_data() (bar/timeline aggregation, sorting, limits, aliasing). 340 Python / 266 JS tests passing overall. Docs: docs/graphs-tables.md, .github/skills/dashboard.md, CLAUDE.md, .github/copilot-instructions.md, README.md, setup.py long_description. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
# Conflicts: # .github/copilot-instructions.md # CLAUDE.md
The new Exceptions tile makes the keyword statistics section taller than the 1600px test viewport, so the page scrolled and the sticky navbar bled into the element screenshot. Raise the viewport height to 2000px and update the reference screenshot with the Linux-rendered result. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #103. Reimplements #253 (which had drifted 5 months and conflicted in 10 files) on a fresh branch off
main, using its diff as the spec rather than resolving merge conflicts.ExceptionProcessor(processors.py): aResultVisitorthat tracks TRY/EXCEPT depth and records the message of the innermost failing keyword per TRY block. Nested TRY blocks, a FOR loop inside TRY, and a keyword wrapping another failing keyword all correctly count only the leaf failure, never the parent/ancestor keywords.exceptionsSQLite table (queries.py,database.py): created for both fresh and legacy databases (CREATE TABLE IF NOT EXISTS, so opening an existing DB just adds it), inserted per-run ininsert_output_data, included inget_data(), and cleaned up in_remove_run()— all defensively tolerant of a missing table (custom database classes, or a table dropped out-of-band).keyword.js+ newgraph_data/exceptions.js) and "Table Exception" (tables.js), wired through the existinggraphMetadata-driven layout system. No changes were needed tolayout.js/graphs.js/settings.js— graph visibility, default show/hide state, and GridStack placement are all fully data-driven fromgraphmetadata.js, so a new entry there is sufficient.filter.js:filteredExceptionsflows through the same timezone-conversion/filter/sort pipeline as the other filtered arrays (runs/suites/tests/keywords).Test plan
bash scripts/python-tests.sh— 340/340 passing (30 new tests:ExceptionProcessorunit tests covering TRY depth tracking and leaf-only counting, database insert/get/remove-run round-trips including a missing-exceptions-table legacy-DB case, dashboard placeholder embedding)bash scripts/javascript-tests.sh— 266/266 passing (10 new tests forget_exceptions_data(): bar/timeline aggregation, sorting by total count, Top-10 limit, run-alias labeling)ExceptionProcessor's counts matched hand-counted expectations exactly (3/3/1 across three distinct exception messages); theexceptionsSQLite table and the generated dashboard HTML both embedded the correct compressed data; the bundled<script>extracted from the generated HTML is syntax-clean (node --check) with no duplicate function declarations from the multi-file JS merge.npm run docs:build— cleandocs/graphs-tables.md,.github/skills/dashboard.md,CLAUDE.md,.github/copilot-instructions.md,README.md,setup.pylong_description🤖 Generated with Claude Code