UI tests: Add filter/sort UI tests for the Event Table and Compute kernel table - #1019
jeremynugara wants to merge 5 commits into
Conversation
|
I'm not sure that this test is a good idea, at least not as it's currently done. The custom SQL queries tie this test to a specific schema. The model module of the application goes to great lengths to decouple the UI from any underlying data source (schema), while this test is strongly tied to a specific schema implementation. |
|
Below is a AI generated PR suggestion The model layer exists so the UI never needs to know whether durations come from
That makes these less "UI tests" and more integration tests with an embedded SQL oracle, run through the ImGui harness because that's where the runner lives. Why I think that's a problem
The Test Peer pattern ( Suggested path forwardPlease consider splitting this PR:
For data-accuracy checks that must stay end-to-end, prefer an oracle through DataProvider / Controller API (what the view already uses) rather than bypassing the stack with direct SQL. If SQL oracles are needed, they fit naturally next to existing coverage in Happy to re-review once the SQL-oracle pieces are relocated (or if we explicitly decide to accept fixture-locked E2E oracles in the UI harness and document that trade-off). |
|
Thanks Tom, that makes sense. I'll take a look at splitting it along those lines and follow up when ready. |
3786cde to
c32aa58
Compare
Add compute_kernel_table_sort_by_duration, compute_kernel_table_filter_duration, and sys_event_table_filter_restricts_rows, plus a ReachKernelTableOrSkip helper. Each restores the tab, selection, time range, and filter state it mutates before asserting so nothing leaks into later tests in the reused process.
c32aa58 to
70e2cc2
Compare
… of rebuilding them The sort and filter tests addressed the Duration header and per-column filter box by rehashing ImGui's id from the label plus table id ($$2/##filter), with comments citing widget source line numbers. That coupling breaks silently on any PushID or layout change in the widget. Capture the ids ImGui actually assigns at render time (ImGui::GetItemID) into IMGUI_ENABLE_TEST_ENGINE-guarded members, exposed via KernelMetricTableTestPeer, matching the existing FlameWindowId pattern. Tests now read the real ids; the table_win reconstruction plumbing is gone.
…rows PR #1027 gated the SQL WHERE filter box and Submit button behind Advanced filter mode; the table now defaults to Basic. The test typed its predicate assuming the box was always present, so after merging main it aborted on the missing widgets. Open the funnel Filter Mode menu and select Advanced before driving the filter.
… instead of rebuilding them" This reverts commit dad7360.
|
Reworked according to your review suggestions. Took out the SQL oracle approach. Also merged main in since #1027 affected the Event Table. |
Three headless UI tests that drive real filter and sort widgets and check the row counts the UI shows. Expected counts come from the displayed table data, not SQL against the schema.
The tests read the real ImGui ids the widget captures at render time (
ImGui::GetItemID) instead of rebuilding them by hand.Merged main for #1027, which moved the Event Table filter behind Advanced mode. The event-table test now switches to Advanced before filtering.