Refresh tests tree#773
Conversation
sonic16x
commented
Jun 2, 2026
commit: |
✅ Component tests succeed
|
✅ E2E tests succeed
|
cfe0215 to
60bf6ea
Compare
c135c1e to
3ad54fc
Compare
3ad54fc to
2a5956d
Compare
| } | ||
|
|
||
| async refreshTests(): Promise<void> { | ||
| this._ensureReportBuilder().saveDb(); |
There was a problem hiding this comment.
Why do we need to save db before initializing?
Why do "refreshTests" method calls reinit?
Maybe it would be better to pull "what is necessary" from "initialize" to extra method?
Perhaps we could skip saving db this way
There was a problem hiding this comment.
We need it for using merge mechanism in initialize. For example, If we run some tests and then refresh tests, first we need save current result and then reinit for read new tests and merge it with current results.
In other case we should realize merge logic second time in frontend.
| useEffect(() => { | ||
| if (currentBrowser && !currentBrowserEntity && isInitialized && visibleTreeNodeIds.length > 0) { | ||
| onSelectFirstResult(); | ||
| } | ||
| }, [currentBrowser, currentBrowserEntity, isInitialized, visibleTreeNodeIds.length]); |
There was a problem hiding this comment.
For select first result in case when current selected test after refresh was deleted
| save(): void { | ||
| fs.writeFileSync(this._dbPath, this._db.export()); | ||
| } |
There was a problem hiding this comment.
"close" is sync because we can't call async operations on sync "exit" event
But "save" is what you call from async code. Its better to have it async.
2a5956d to
b79cc0d
Compare
| }).catch(() => { | ||
| logError(new Error('ololo')); | ||
| }); |
| import {copyAndUpdate} from '../../test-result/utils'; | ||
|
|
||
| export const handleTestResults = (testplane: TestplaneWithHtmlReporter, reportBuilder: GuiReportBuilder, client: EventSource): void => { | ||
| testplane.removeAllListeners(); |
There was a problem hiding this comment.
It removes all listeners, including these ones:
https://nda.ya.ru/t/nu5584BV7ik3kV
You can't do that.
You have that "event listeners" problem because you call "initialize" second time.
"just removing event listeners, while keeping second init" is sweeping the problem under the carpet.