Skip to content

test: reorganize test coverage and speed up CI - #621

Merged
glasstiger merged 25 commits into
mainfrom
perf/e2e-api-setup
Nov 9, 2026
Merged

glasstiger merged 25 commits into
mainfrom
perf/e2e-api-setup

Conversation

@emrberk

@emrberk emrberk commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

CI repeated UI setup and ran the full browser suite again for context paths. This change moves smaller checks to Vitest and keeps Cypress for browser journeys.

  • Move function, component, and cross-module checks to Vitest and React Testing Library. Merge overlapping E2E cases and remove redundant checks.
  • Keep unit and component tests beside their source, with matching names. Put integration and E2E tests under test/ and update scripts and paths.
  • Use API login and fixture setup, plus saved tabs and chats. Keep typing where the test assesses editor interaction.
  • Replace the context-path workflow with a focused spec against a real QuestDB server.
  • Separate Vitest and E2E workflows. Run bundlewatch before Vitest, update the QuestDB submodule, and cache its compiled runtime.
  • Upgrade to Cypress 16 and Node 24, retaining Electron. Fix focus, query, drag, and storage races. Disable the command display for console CI runs.

Validation:

  • 3,334 Vitest tests passed after the main merge. Typecheck and targeted lint passed.
  • All 22 console specs passed locally: 153 tests, one existing skip, with retries disabled.
  • Editor fixes passed under CPU throttling, including repeated native dragging.
  • With 6× browser CPU throttling, disabling the command display made 53 matching passing editor cases 33% faster. CI savings remain unverified.

CI screenshots retain the app but omit the command history panel. Local runs keep the panel.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Web Console deploy preview

Preview Commit Logs
https://pr-621--web-console.netlify.app a8ae4cd build log

@emrberk emrberk changed the title test: reduce repeated login and fixture setup in E2E suites test: reduce E2E login, fixture, and editor setup time Nov 3, 2026
@questdb questdb deleted a comment from github-actions Bot Nov 6, 2026
@questdb questdb deleted a comment from github-actions Bot Nov 6, 2026
@questdb questdb deleted a comment from github-actions Bot Nov 6, 2026
@questdb questdb deleted a comment from github-actions Bot Nov 6, 2026
@questdb questdb deleted a comment from github-actions Bot Nov 6, 2026
@questdb questdb deleted a comment from github-actions Bot Nov 6, 2026
@questdb questdb deleted a comment from github-actions Bot Nov 6, 2026
@questdb questdb deleted a comment from github-actions Bot Nov 6, 2026
@emrberk emrberk changed the title test: reduce E2E login, fixture, and editor setup time test: reorganize test coverage and speed up CI Nov 6, 2026
With the Cypress command log disabled, runLine could click the editor
before Allotment sized its panes, so the click missed Monaco and cy.type()
hit a span. typeQuery now waits until the editor centre lands in its text
area and its box is stable.
- unit: query keys with @, comment-aware glyph/decoration placement,
  appendQuery semicolons after comment-only buffers
- component/integration: schema tree icon tooltip metadata, wizard
  permission choice persisted
- e2e: exact date/JIT error markers with a real validation step, dense
  drawer-exit click sweep, query activity responsiveness bound with auto
  refresh, metrics tab via toolbar button, worker regex error, remembered
  SSO user after admin session
Cypress 16 rejects test-level env overrides, which failed the Enterprise
OIDC spec in its before-all hook and skipped the rest of the suite.
The Enterprise OIDC journey ran SQL right after the token exchange, before
the console mounted Monaco, so typeQueryDirectly read an undefined editor.
Wait for the editor in that step, and make typeQueryDirectly retry until
Monaco has one.
…sions

The Enterprise topbar spec dropped the 'john.doe' user that guarded #446,
so a regression in SHOW PERMISSIONS quoting would pass every test. Use a
dotted generated name again, and add a toolbar component test that runs
in public CI.
@emrberk

emrberk commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

Reviewing PR #621 at level 3 (full pass).

Issues

Issue ID Issue name Category Severity Location Net impact Evidence Description Steps to reproduce Suggested fix
#1 "New notebook" menu no longer tested Test review & coverage Moderate out-of-diff: src/scenes/Editor/Monaco/tabs.tsx:756-776 (the "New notebook" action in the tab "+" menu) Main notebook entry point lost its only test N/A — static, git grep. Base e0e82ac2 had 6 live cy.createNotebook() callers: editor.spec.js:2458/2541/2600, notebookCellControls.spec.js:101, notebookHighlight.spec.js:51, schema.spec.js:1112. Head 3a650ae6 has none; the helper is still defined at test/e2e/commands.js:565. No Vitest test renders tabs.tsx. On base, CI checked that "+" → "New notebook" (addBuffer({ notebookViewState: createDefaultNotebookViewState() })) opens a working notebook. The PR swapped those setup steps for createNotebookBuffer(). That writes a hand-made notebook (fixed cell id, focusedCellId set) straight into IndexedDB, skipping both addBuffer and the default state. If the menu action, or opening a notebook from its default state, breaks, no test fails. The onboarding modal's create buttons build the same default state and aren't tested either. This code changes often: 18 commits this year across tabs.tsx and store/notebook.ts (#581, #585, #593).
  • Break the new-tab-notebook onSelect in tabs.tsx, or make the notebook view require focusedCellId.
  • Run yarn test and yarn test:e2e.
  • Both stay green.
In one existing spec, e.g. the beforeEach of notebookCellControls.spec.js, create the notebook with cy.createNotebook() instead of seeding it. Or add a component test that clicks new-tab-notebook and checks that a notebook opens with a single empty cell.

Adjacent findings (not blocking — file as issues)

None.

Summary

  • Verdict: approve with comments. I'd like wip test for error range #1 addressed (Moderate) but won't block on it.
  • Correctness gate: passes; no admitted Critical findings.
  • Test gate: passes; 1 admitted coverage gap (Moderate), 0 Critical.
  • Quality checks at 3a650ae6: yarn typecheck, yarn lint, yarn build and yarn test (3,358 tests) all pass. CI is green, including E2E, context-path and enterprise E2E.
  • Regressions: none found in the production changes. Checked against every caller:
    • appendQuery → appendQueryEdit produces exactly the same edit and selection.
    • The Monaco vs path now resolves to the same address for every URL the console can start from, and the worker URL now keeps the context path.
    • The SearchableSelect fixed item height equals the real row height (3.2rem = 32px).
    • The rewritten import paths add no circular imports.
    • The AI chat fallback, EE import owner default and single download error toast change behaviour only where base was wrong.
  • Coverage of the reorganization:
    • Vitest: every base test still exists at head with the same body.
    • E2E: every other removed case (482 → 178) still has a matching check at head, including the deleted navbars, telemetry and enterprise/import specs.
    • Test discovery: the narrower Vitest file pattern stops no existing test from running.
  • Tradeoff: the context-path job no longer runs the whole E2E suite. It now runs the 7-case contextPath.spec.js against QuestDB serving the built console, which checks every request to the console's own server.
  • PR description: it doesn't list the user-facing fixes: EE import owner default, AI chat button opening the latest saved chat before chats load, a single download error message, and Monaco workers under a context path. Worth adding them for the changelog.
  • In-diff / out-of-diff: 0 / 1.
  • Severity: 0 Critical, 1 Moderate, 0 Minor.

@glasstiger
glasstiger merged commit 642764d into main Nov 9, 2026
7 checks passed
@glasstiger
glasstiger deleted the perf/e2e-api-setup branch November 9, 2026 16:31
emrberk added a commit that referenced this pull request Nov 11, 2026
Takes main's test layout (#621: e2e under test/e2e, integration tests
under test/integration). The e2e specs from this branch move with it;
the appendQuery suite stays removed (Example queries are gone, the
scenarios live in src/scenes/Editor/Monaco/appendQuery.test.ts), and the
search/tabs expectations follow this branch's preview-bar semantics.
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.

2 participants