fix: HTML report merge crash and harden result file handling - #158
Open
mkzung wants to merge 1 commit into
Open
Conversation
mkzung
marked this pull request as ready for review
July 2, 2026 20:39
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.
Four fixes in the result-merging / report-generation path, plus the repo's first
tests/test_utils.py.merge_htmlcrashed, then produced broken HTML (utils.py). It searched for a<thread>tag (not valid HTML; the tag is<thead>) and indexed[0], sofind_all('thread')[0]raisedIndexErrorand crashed the merge. Beyond the crash, the row merge appended each second-table<tr>into the first table's<tr>, nesting rows and putting a data row inside<thead>. Since the merged tables are the same client's results from two report folders (each client has a uniqueid="table_<client>"), the intent is to stack rows under one header. This removes the duplicate<thead>(decomposing every match, so it also handles a table with none) and appends the second table's body rows into the first table's<tbody>, producing valid, correctly-stacked HTML.merge-results.py. Replacedos.system(f'cp {src} {dst}')withshutil.copy, so paths with spaces or shell metacharacters are handled correctly.report_html.pytags. Fixed a malformed<pre">tag (should be<pre>).report_html.pytable close order. The report emitted</table>before</tbody>; swapped them to close</tbody>then</table>.Adds
tests/test_utils.py(matching the naming of the existing suite) asserting the merged output has one header, all rows stacked in the body, and no nested<tr>, plus the no-<thead>case; a rootconftest.pymakes the top-level modules import under pytest. Run withpython -m pytest tests/test_utils.py -v. Verified locally that the merged output renders as valid, correctly-stacked HTML.