8000 fix(gui): show actual skip status of tests after gui restart, reconcile skip status after restoring history by vladislav805 · Pull Request #820 · gemini-testing/html-reporter · GitHub
[go: up one dir, main page]

Skip to content

fix(gui): show actual skip status of tests after gui restart, reconcile skip status after restoring history - #820

Open
vladislav805 wants to merge 2 commits into
gemini-testing:masterfrom
vladislav805:fix/gui-skip-state
Open

vladislav805 wants to merge 2 commits into
gemini-testing:masterfrom
vladislav805:fix/gui-skip-state

Conversation

@vladislav805
Copy link
Copy Markdown

Continuation of #819. Original author's commit is preserved.

Changes

  • Reconcile current pending state after restoring history on startup, refresh and watch.
  • Remove only obsolete trailing skips; preserve earlier attempts.
  • Synchronize the tree, attempt manager and skip list.
  • Read the open database without requiring a saved file.
  • Use timestamp/rowid ordering and delete individual rows.
  • Apply SQLite changes synchronously inside a savepoint.

@vladislav805
vladislav805 marked this pull request as ready for review October 21, 2026 14:22
@shadowusr shadowusr left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your contribution! This iteration is much cleaner and based on my testing is working correctly!

I've left a couple of comments, the most important points are these:

  • whether we really need rowid introduction and if not, we could revert changes related to it
  • i don't think we need _addSyntheticTestResult method, cause it's basically identical to the regular addTestResult

Comment thread lib/report-builder/gui.ts Resolved
Comment thread lib/report-builder/gui.ts

private _resolveSkippedTests(tests: TestAdapter[]): void {
const affectedTests = new Set(tests.map(test => `${test.fullName}\0${test.browserId}`));
_.remove(this._skips, ({suite, browser}) => affectedTests.has(`${suite}\0${browser}`));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

side thought: why do we even have this _skips fields, which is so carefully update yet not used anywhere at all. Should probably delete it in the future, but that's a different story.

Comment thread lib/db-utils/common.ts Resolved
Comment thread lib/report-builder/gui.ts
restoreTestsState({treeState, skips, attempts}: GuiReportBuilderTestsState): void {
this._testsTree.restoreState(treeState);
this._skips = skips;
this._skips.splice(0, this._skips.length, ...skips);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, now that's niche! what's the idea behind this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToolRunner retains the skips array returned by getResult(). Watch updates do not rebuild the entire _tree, so assigning a new array during rollback would leave runner.tree.skips pointing to the old, modified array. splice preserves that reference. The failed watch-update test covers this.

Comment thread lib/sqlite-client.ts
].join(' AND ');

this.delete({
where: `rowid = (SELECT rowid FROM ${DB_SUITES_TABLE_NAME} WHERE ${where} ORDER BY rowid DESC LIMIT 1)`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question about rowid here. Is this truly needed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting by test, browser, status and timestamp would remove both skips from [skipped(T), success(T), skipped(T)], rather than just the trailing one. rowid lets us delete exactly one record without changing the schema. A regression test checks that the earlier attempt survives a GUI restart.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0