Skip to content

chore: Use local clickhouse instance for playwright tests#1711

Draft
teeohhem wants to merge 8 commits intomainfrom
tom/e2e-local-ch-minimal
Draft

chore: Use local clickhouse instance for playwright tests#1711
teeohhem wants to merge 8 commits intomainfrom
tom/e2e-local-ch-minimal

Conversation

@teeohhem
Copy link
Contributor

@teeohhem teeohhem commented Feb 6, 2026

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2026

⚠️ No Changeset found

Latest commit: 751645b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hyperdx-v2-oss-app Ready Ready Preview, Comment Feb 6, 2026 3:43pm

Request Review

@teeohhem teeohhem changed the title Tom/e2e local ch minimal feat: Use local clickhouse instance for playwright tests Feb 6, 2026
@teeohhem teeohhem changed the title feat: Use local clickhouse instance for playwright tests chore: Use local clickhouse instance for playwright tests Feb 6, 2026
@claude
Copy link

claude bot commented Feb 6, 2026

Code Review

No critical issues found.

The PR successfully refactors E2E tests to use a local Docker ClickHouse instance instead of a remote demo instance. The implementation is solid with good error handling, health checks, and comprehensive test data generation.

Minor observations (not blocking):

  • Hardcoded test data in seed-clickhouse.ts:142 - User IDs and request IDs are deterministic (user-${i % 5}, req-${i}). This is fine for E2E tests but consider adding a note if tests depend on specific values.

  • Error escaping in seed-clickhouse.ts:482-484 - JSON escaping with both double and single quotes could be simplified, but it works correctly for the ClickHouse event logs.

  • Timeout configuration in seed-clickhouse.ts:495-498 - Good that E2E_CLICKHOUSE_READY_TIMEOUT is configurable for CI environments.

The architecture is clean, separates fullstack vs local modes well, and includes proper cleanup/health check mechanisms.

- Add Docker Compose service for local ClickHouse instance
- Add init script to create e2e_* tables in ClickHouse
- Add seed-clickhouse.ts to populate test data
- Add global-setup-local.ts for local mode setup
- Update test scripts to support local ClickHouse
- Update .env.e2e to point to local ClickHouse instead of demo server
- Add stop-e2e.sh script for cleanup

This enables E2E tests to run against a local Docker ClickHouse instance
with seeded test data, instead of relying on the public demo server.
Both full-stack mode (MongoDB + API + ClickHouse) and local mode
(frontend + ClickHouse) now use the same local ClickHouse instance.
The global-setup-fullstack.ts was missing the seedClickHouse() call,
which meant tests had no data to work with.
- Add saveSearchAndWaitForNavigation() to avoid race condition
  - Starts waiting for URL change BEFORE submitting form
  - Eliminates flaky tests where modal closes but URL hasn't changed yet
  - Replaces manual pattern of await modal hidden + await URL change

- Simplify search-filters.spec.ts to use known test data
  - Use hardcoded 'info' severity from seeded data instead of dynamic discovery
  - Remove 18 lines of complex conditional logic
  - More reliable and easier to understand

These changes leverage consistent test data from ClickHouse seeding.
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

E2E Test Results

All tests passed • 0 passed • 0 skipped • 726s

Status Count
✅ Passed 0
❌ Failed 0
⚠️ Flaky 0
⏭️ Skipped 0

Tests ran across 4 shards in parallel.

View full report →

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.

1 participant