Commit Graph
133 Commits
Author SHA1 Message Date
Neha P 1e00d3b661 test(logs): cover the search-toolbar pin system (#15358) 2026-10-15 10:30:55 +00:00
c99cb0d516 fix(logs): logs finesse phase 1 — severity inference, auto-run, free-text FTS search, J/K, line permalinks (#15234)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Neha P <neha@openobserve.ai>
2026-10-12 16:50:32 +00:00
Omkar Kesarkhane 0e9ab49ad1 fix(saved-views): Traces saved views in the More menu with a pin, and one shared list dialog with Logs (#15189) 2026-10-09 04:34:20 +00:00
Neha P 3b1c5f4c7e test(logs): fix the false-green paths in the #15086 coverage, and move it onto logsPage (#15138) 2026-10-07 05:10:21 +00:00
Neha P e6deef9737 test(logs): UI and API coverage for the #15086 logs changes (#15116) 2026-10-06 09:26:24 +00:00
Prabhat Sharmaandgithub-actions[bot] 6971683fe6 feat(logs): default-on logs features, Drill down mode, full search-term highlighting, multi-stream search-around, fail-closed redaction, trace View Logs (#15086)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-05 23:35:01 +00:00
Vamsi Karthik R e2bf875908 test: deflake 20 flaky E2E tests across Logs, Dashboards, Metrics, Traces, Reports, GeneralTests (#14968) 2026-09-30 05:54:07 +00:00
461bb39713 test(autoe2e): generated E2E tests for #14750 (logs-patterns-multi-stream-guard) (#14802)
Co-authored-by: Shrinath-O2 <214651540+Shrinath-O2@users.noreply.github.com>
Co-authored-by: Neha P <neha@openobserve.ai>
2026-09-29 02:55:15 +00:00
25ddc35b7c test(autoe2e): generated E2E tests for #14508 (logs-refresh-cache-dropdown) (#14517)
Co-authored-by: Shrinath-O2 <214651540+Shrinath-O2@users.noreply.github.com>
Co-authored-by: Neha P <144308844+neha00290@users.noreply.github.com>
Co-authored-by: Neha P <neha@openobserve.ai>
2026-09-22 08:03:00 +00:00
Shrinath RaoandShrinath-O2 630c96feee test(autoe2e): generated E2E tests for #14518 (logs-stream-not-found) (#14535)
Co-authored-by: Shrinath-O2 <214651540+Shrinath-O2@users.noreply.github.com>
2026-09-22 06:58:55 +00:00
Neha P 80d9d6ff91 test: regression coverage for 4 closed Needs-Automation bugs, and repair the alert wizard's stream select (#14689) 2026-09-21 12:17:22 +00:00
Neha P 0104b53ffe test: regression coverage for 10 closed Needs-Automation bugs, and rebalance the Logs shard (#14494) 2026-09-16 08:07:59 +00:00
BhargavandHengfei Yang d555f02db3 fix(logs): make Refresh Cache & Run Query visibility consistent across tabs (#14508)
Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2026-09-16 04:38:59 +00:00
Vamsi Karthik R ff438211c7 test: deflake Alerts/RUM/Logs/Metrics shard tests (#14417) 2026-09-11 04:29:30 +00:00
Bhargav 3a5feaf17e fix: Fix/logs stream selector issues (#14259) 2026-09-09 06:57:43 +00:00
Shrinath Raoandhengfeiyang ec0b08dcee fix: stop quick mode dropping the RUM identity fields, and deflake 5 UI tests (#14113)
Co-authored-by: hengfeiyang <hengfei.yang@gmail.com>
2026-09-02 12:11:26 +00:00
Prabhat Sharmaandgithub-actions[bot] b90e61410e fix: repair false-success gates and the deterministic Playwright failures they masked (#14025)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-31 01:01:03 +00:00
ktx-akshay 78998b5fa3 test(logs): E2E cover for Build tab stream list with no stream selected (#13884)
Adds E2E regression cover for the fix in #13812.

The Logs → Build toggle mounts PanelFieldList with pageKey "build" in
edit
mode, which deferred its stream-list fetch until a stream was already
set.
Since ZO_QUERY_ON_STREAM_SELECTION defaults to true, the logs page
selects
nothing, so Build mounted blank and its Stream dropdown was left
enabled,
openable and permanently empty on "No options found" — no way to pick a
stream, no way out.

## Tests (Logs-SelectStar shard)

- **P0** — with no stream selected on the logs page, the Build tab's
Stream
dropdown is populated and a stream can actually be picked: no empty
state,
  options render, `e2e_automate` is offered, selecting it lands, and the
  field list loads that stream's schema.
- **P1** — changing Stream Type with a blank stream refetches the list:
logs → traces drops `e2e_automate` (a logs stream) and loads a real
traces
list, switching back restores it. Covers the stream_type watcher, which
is
  gated on the same `initialStreamsLoaded` flag the fix arms.

`beforeEach` asserts the logs page starts with no stream selected —
without
that precondition both tests would pass against the buggy build.

## Notes

- Page-object locators are scoped to
`[data-test="logs-build-query-page"]`:
the Visualize tab mounts a second PanelEditor that stays in the DOM
under
`v-show`, so an unscoped `index-dropdown-stream` is a strict-mode
violation.
- Verified 6/6 green over 3 repeats locally. The shard runs the backend
with
ZO_QUICK_MODE_ENABLED=true, which the local instance does not —
assertions
  avoid named fields so quick mode's field narrowing can't affect them.
2026-08-20 05:38:27 +00:00
Shrinath Rao 6650950a50 test(e2e/alpha1): fix share-link redirect origin and cloud metrics ingest auth (#13776)
## Why

The scheduled **Alpha1 (Cloud)** e2e run failed on three jobs
([o2-enterprise run
31547517666](https://github.com/openobserve/o2-enterprise/actions/runs/31547517666)):
**Logs-Features** (7), **Functions** (11), **RegressionSet** (4).
Root-caused each against a freshly-deployed alpha; two are genuine test
heals, one was pure environment skew.

## Root causes & fixes

### 1. Logs-Features — shareLink + monaco-query-prefill (7 tests) ✅
fixed
On cloud the app builds the share link from its **public** base URL
(`*.external.zinclabs.dev`), while the tests authenticate against the
ingress host (`*.internal.zinclabs.dev`). `page.goto(sharedUrl)`
navigated **cross-origin**, dropped the auth cookies, and bounced to Dex
— so every post-redirect state assertion read back `null`.

**Fix:** re-point the short URL's origin to `ZO_BASE_URL` in
`clickShareLinkAndGetUrl()` (right next to the existing HTTP→HTTPS
"maintain auth context" step). `/short/<id>` resolves identically on the
backend regardless of ingress host, so only the origin changes and the
session stays valid. Same-origin envs (localhost / matching deployed
host) are untouched.

### 2. RegressionSet — alerts Bug #9967 PromQL (1 test) ✅ fixed
`ingestMetricsData()` authenticated with `ZO_ROOT_USER_EMAIL:PASSWORD`,
but **cloud ingestion needs `email:passcode`**. The ingest silently
401'd → the `e2e_test_cpu_usage` metrics stream was never created → the
PromQL alert flow timed out selecting it.

**Fix:** build auth via `getAuthHeaders()` (passcode on cloud, root
creds on self-hosted), refresh the passcode from the live browser
session first, and poll until the stream is indexed so the wizard's
stream-select doesn't race WAL lag.

### 3. Functions — radio → segmented toggle (11 tests) — no change
needed
The page object was already migrated to the segmented toggle in #13766;
these failures were the **alpha frontend lagging the merged test code**.
Green after the redeploy with zero code change.

## Verification (against alpha, `auto_org_1`)
- `shareLink.spec.js` + `monaco-query-prefill.spec.js` → **11/11
passed**
- `alerts-regression.spec.js` (full) → **5/5 passed** (#9967, #10110,
#10899, #10872, #10472)
- `Functions/js-transform-type.spec.js` → **7/7**,
`row-expansion.spec.js` → green

## Scope
OSS-only (test files). The ENT `playwright_alpha1.yml` checks out
opensource at `main`, so merging makes the next scheduled run pick this
up. It can also be pre-verified by dispatching that workflow with
`o2_opensource_repo=test/alpha1-e2e-heals-0812`.
2026-08-12 06:35:48 +00:00
Prabhat Sharmaandgithub-actions[bot] 360b989272 feat(slos): PromQL support for count and time-sliced SLOs, plus SLO/alert regression fixes (#13761)
Supersedes #13738, whose commit is included here as the first of four.

Adds PromQL support to count and time-sliced SLOs, lets metrics streams
choose SQL or PromQL, and fixes three shipped bugs found along the way.

## Shipped bug: every SQL time-slice SLO recorded wrong history

`fetch_rows`' `SliQueryPlan::Single` arm normalized every hit with
`with_good_column: true`, but that arm serves **two** shapes and only
one projects `zo_slo_good`:

| shape | projects | result |
|---|---|---|
| count single-query | `zo_slo_good` + `zo_slo_value` | correct |
| time slice | `zo_slo_value` only | `good` defaulted to `0.0` |

So every SQL time-slice slice was classified from `0.0` instead of its
aggregate. With a positive threshold, `<`/`<=` (e.g. `p95 < 300ms`)
recorded every slice **good** — the SLO read ~100%, the budget never
burned, and no alert on it could fire. `>`/`>=` recorded every slice
**bad** and fired continuously. Shipped in v0.92.0 (`4772df1723`);
`to_row` had no time-slice test, which is how it got through.

Fixed by deriving the flag from the SLI type in a new
`single_query_rows`. Deliberately **not** fixed inside `to_row` by
falling back to `total` — that would read a count bucket whose `SUM`
came back NULL as *fully good*, inventing uptime. A test forbids it.

**Stored history is not rewritten.** It ages out within one window; an
operator can force a rebuild sooner by making a real edit (a no-op
re-save does nothing — `update` bumps only on `definition_changed`). No
auto-migration: bumping every time-slice SLO at boot would freeze every
attached alert org-wide until backfill cleared the coverage floor, and
double each org's row budget for 97 days — a self-inflicted monitoring
gap to repair a reporting error.

## PromQL support

**Time slice** carried a `query_language` field the planner ignored, so
a PromQL time-slice SLO saved cleanly and measured nothing, forever.

- `SliQueryPlan::PromQlValue` — one expression, not a good/total pair,
planned at slice ends from the same helper the count arm uses.
- The expression is passed through **verbatim**. Grouping comes from
series labels; wrapping it in `sum by (...)` the way the SQL arm injects
GROUP BY would destroy the aggregate (the sum of four pods' p95 is not a
p95).
- `promql_value_rows` **rejects** two series colliding on one
`(slice_start, group_key)` via `RejectReason::AmbiguousSeries` instead
of summing. Summing is right for counters (what `promql_rows` does) and
meaningless here. Detection is unconditional, so the ungrouped case — an
unaggregated `histogram_quantile` returning one series per instance — is
covered. Rejects are plumbed through `fetch_rows` into
`PassResult.rejected` on both the live and backfill paths.

**Count** already had a working `CountSource::PromQl` backend that no UI
could reach.

## Metrics streams choose SQL or PromQL

`language_suits_stream` refused SQL whenever `stream_type == "metrics"`,
and the form derived the language from the stream type — so metrics had
no SQL option. A metrics stream is an ordinary stream with a `value`
column, and `SELECT histogram(_timestamp, '5 minute'), avg(value) FROM
cpu_usage` is a perfectly good SLI. SQL is now valid for any stream
type; PromQL stays metrics-only. The form asks via a toggle (defaulting
to PromQL) instead of deriving.

## Validation

- `scope` refused for PromQL — a SQL `WHERE` fragment with nowhere to go
in a PromQL plan.
- Empty `query` refused for **both** languages (the SQL aggregate was
previously never validated — same silent-freeze shape).
- Expressions parsed with `promql-parser` at save, in `core` (`config`
has no parser).
- **Parse-only by design.** A grouping check requiring the root to be an
aggregation whose `by(...)` matches `group_by` wrongly rejects
`histogram_quantile(0.95, sum by (le, region)(...))` (function-call
root; `le` is a necessary label superset) and binary-op roots like `sum
by (region)(increase(a[5m])) - sum by (region)(increase(b[5m]))`. A
"warn instead" variant needs a warnings channel the save API doesn't
have.

## Also fixed

- **Time-slice comparator 422.** `SliConfig::TimeSlice.comparator` has
no serde default, so a dropdown the user never opened was omitted and
the save died with a bare 422 — blocking creation of *any* time-slice
SLO from the UI. Seeded to `<` only when blank, so a stored comparator
survives an edit.
- **SLO/alert/service-stream regressions** (the commit from #13738):
fractional-threshold serde round-trip, `SloAlertCondition` UI, alerts
table, service streams.

## Verification

- 487 config · 206 core · 45 infra · 418 frontend — all passing; clippy
`-D warnings`, `cargo fmt`, prettier, eslint, `vue-tsc` all clean.
- Driven through a real browser against a running server (isolated
instance, own data dir). All four SLI/language combinations create and
store correctly: count·PromQL, count·**SQL over metrics**,
time-slice·PromQL, time-slice·**SQL over metrics**. Also verified: the
toggle swaps field shapes both ways, scope shows for SQL and hides for
PromQL, PromQL-only hints appear only in PromQL mode, and editing a
stored SQL-over-metrics SLO reopens as SQL with its predicate intact.
- Validation rejections confirmed live with actionable messages:
PromQL-with-scope, unparseable PromQL, and an empty SQL aggregate.

Known limitation, pre-existing: `threshold` likewise has no serde
default and is not seeded, so leaving it blank still 422s. That is
genuine user error rather than an untouched-control trap; adding form
validation was out of scope.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-11 17:35:52 +00:00
Shrinath Rao cb78ef36fd test(sentinel): complete POM compliance — Dashboards + Correlation (follow-up to #13727) (#13735)
## Summary

Completes the Sentinel **Page Object Model** compliance sweep of the
Playwright suite (follow-up to #13727, which covered the non-Dashboards
shards). Every raw `page.locator(...)` / `page.getBy*(...)` selector —
in **actions and assertions** — is relocated out of the spec files into
the relevant page object; specs now call page-object methods/getters
only.

**Result: 0 raw fixture-`page` selectors across the entire
`playwright-tests` suite** (single-line *and* multi-line, verified with
a dotall/multiline scanner). Together with #13727, the whole suite is
POM-clean.

## What's in this PR

**Dashboards shards — ~1,460 selectors** relocated into their page
objects (`dashboard-panel-configs/actions/edit/time`, `dashboard-chart`,
`dashboard-variables-scoped`, `dashboard-filter`, `dashboard-drilldown`,
`crossLinkPage`, `visualise`, `dashboard-share-export`,
`dashboard-create`, `dashboard-settings`, `dashboard-variables`):

| Shard | selectors |
|-------|----------:|
| Dashboard-Config-Settings (11 specs) | ~255 |
| Dashboards-Variables (12 specs, 4 batches) | ~693 |
| Dashboards-Tables (7 specs) | ~127 |
| Dashboards-Charts (9 specs) | ~81 |
| Dashboards-Core + Visualize (10 specs) | ~144 |
| Dashboards-Settings + Panel-DateTime (8 specs) | ~107 |
| Dashboard-Regression (1 spec) | ~52 |

**Correlation UI specs** (3 new `Correlation/*.ui.spec.js` that arrived
via main's merge, after the original audit) — converted into a new
`correlationDrawerPage` + an extended `correlationSettingsPage`, with
`PageManager` wired into specs that previously used none.

**Audit stragglers** the original **single-line** audit grep
undercounted — multi-line `page\n.locator(...)` chains in
`logstable.spec.js` (→ `logsPage.getTableHeaderByField()`) and
`dashboard-streaming.spec.js` (2 add-panel selectors).

**AI-review fixes** (DeepSeek, on this PR) — removed 2 dead-code
duplicate getters + 1 redundant method alias (merge artifacts from the
sequential batch commits).

One Node-context `console.log` (`dashboard-general-setting`'s
`beforeEach`) → `testLogger.info`.

## Approach

Nearly every Dashboards spec shares the same page objects, so the work
was done in **sequential batches** (one committed, verified unit at a
time) to keep page-object edits conflict-free. 13 commits, mapping 1:1
to those batches.

## Not changed (by design)

- **`waitForTimeout`** left as-is — logged in the audit, not rewritten
(per direction).
- **Browser-context code inside `page.evaluate()` /
`waitForFunction()`** (`document.querySelector`, `window.*`) left as-is
— it runs in the page's JS engine, not Node, so `testLogger` (a Node
module) can't be called there. *No `console.*` remained in dashboards
specs*; the Node-context ones were converted to `testLogger`.
- **`newPage.locator(...)`** on separate popup `Page` instances left
as-is (not the fixture `page`).

## Verification

- **0 raw fixture-`page` selectors** across all specs — single- and
multi-line, comments stripped.
- All changed `.js` files pass `node --check`.
- **CI-gated** for browser execution (no local runs), consistent with
#13727. The enterprise E2E crosscheck already passed against this PR.

## Stats

82 files changed (+3,355 / −2,211) — 61 specs, 21 page objects.
Selectors **moved into page objects, not deleted**.
2026-08-11 06:09:06 +00:00
Shrinath Rao 82d14e8458 test(sentinel): POM compliance across Playwright suite (non-Dashboards) (#13727)
## What & why

Sentinel (Council of Agents) audit-driven **Page Object Model
compliance** across the Playwright suite. Many specs (a lot added
recently, some AI-generated) had raw `page.locator(...)` /
`page.getBy*(...)` selectors directly in spec files — including inside
`expect(...)` — which the Sentinel flags as CRITICAL. This PR relocates
those selectors into their page objects and calls page-object
methods/getters instead.

A full audit of **all 256 specs** was generated first (stored locally
under `tests/ui-testing/MD_Files/sentinel-audit-2026-08-10/`, which is
gitignored). Original totals: **1,609** raw selectors, **190** inside
assertions, plus console/testLogger items.

## Scope of THIS PR (non-Dashboards)

Every non-Dashboards spec is now **100% raw-selector clean** (verified:
0 occurrences). Shards covered:

- **GeneralTests, Logs (Core/Builder-Advanced/Features/Regression),
Traces (+Reg), Streams (+Reg), Metrics (+Reg), Pipelines, Reports
(+Reg), Anomaly, Login/auth, auth-warm, and the unmatched Alerts
specs.**
- `console.*` → `testLogger` where it was Node-context (kept `console.*`
**inside `page.evaluate()`** — that's browser context; `testLogger`
doesn't exist there).
- `testLogger` import/use added where missing.
- **`waitForTimeout` intentionally left as-is** (logged in the audit,
not rewritten — per direction).

## Deferred to a follow-up PR

The **heavy Dashboards shards** (Variables 693, Config-Settings 255,
Tables 127, Charts 81, Core 79, Visualize 65, Settings 52,
Panel-DateTime 55, Dashboard-Regression 52 raw selectors) are **not** in
this PR — they're the bulk of the work and will be a separate, focused
pass. (dashboard-streaming console cleanup is included here.)

## Verification

Fixes were applied and executed **shard by shard** against a local env,
gated green before commit where the env allowed:

| Group | Local result |
|-------|--------------|
| GeneralTests (edited specs) | 52 passed / 11 skipped / 0 failed |
| Logs (shareLink, logsQuickPick, indexquery) | 21 passed |
| Traces / Streams / Metrics | 49 passed / 2 skipped / 0 failed |
| Pipelines | 56 passed / 17 skipped / 0 failed |
| logs-bugs :548, dashboard-streaming | verified not regressed
(isolation) |

**Alerts create-wizard specs** (Alerts shard, Alerts-Regression,
unmatched Alerts) could not be gated locally — the alert-creation
wizard's stream popover times out on this env **on unmodified code too**
(reproduced on original, test `:363`), so those refactors are 1:1
selector→method mappings, syntax-clean (`node --check`), and rely on CI
to gate.

Every changed `.js` passes `node --check`. `waitForTimeout` unchanged;
no behavior changes intended.

## Stats
51 files changed. Selectors moved into page objects, not deleted.
2026-08-10 15:30:21 +00:00
Ashish Kolhe b3e6a77270 fix(correlation): service-streams P2 behavioral fixes + discovered services flat table (#13710)
Correlation P2 round: behavioral/security fixes across the
service-streams backend and correlation FE, plus the Discovered Services
UX rework and the correlation e2e suites.

**Companion enterprise PR (must merge together):**
openobserve/o2-enterprise#2381 — the enterprise side calls the new 3-arg
`put(org, record, max_streams_per_type)` introduced here.

## Commit 1 — behavioral fixes (F2–F38)
**Backend**
- F25/F26: RBAC on `list_services` (`service_streams` GET — the one
previously-unenforced endpoint in the module) + validate
`distinguish_by` ids on identity-config save
- F2: validate trace filter param before WHERE-clause interpolation
- F6: `_reset` invalidates caches on all nodes via reload event; org
deletion clears service-streams caches
- F8: shared coverage-based identity-set ranking for ingest and read
- F10: purge rows of removed/changed identity sets on config save
- F19: `put` returns deleted orphan keys for cache eviction
- F28: discriminate no-match from failure; stop aliasing 404 to no-match
- F32: cap DB-side stream union at `max_streams_per_type`
- `all_dimensions` unions on put so late-tracked dimensions surface
- F14: `StreamInfo.dropped_dimensions` contract field; allow empty
`tracked_alias_ids` when identity sets exist

**Frontend**
- F35/F36/F31: per-stream filter-edit resolution via semantic groups;
dimension edits in both key spaces; subject overrides never guess fields
- F27/F30: echo `source_stream`/`source_type`; stop guessing another
stream's filters; chip dedup
- F2/F38: SQL field/value escaping via shared `quoteSqlLiteral` helper

## Commit 2 — Discovered Services UX + e2e
- Flat table (one row per instance), same-name services merge their name
cell (OTable `pivotRowColumns`); optional per-service collapse with
aggregated summary row; search/filters override collapse
- Fixes an OTable pivot-merge bug (value-keyed merge map blanked
single-column runs) + regression test
- Semantic Field Groups: category tabs with counts + cross-category
search with match highlighting
- Correlation Phase-1 API + Phase-2 UI Playwright suites

## ⚠️ Release note (enterprise + RBAC deployments)
Viewing Discovered Services now requires the **Service Streams**
permission (previously unenforced). Root/admin users are unaffected;
custom roles may need a one-time grant via the role editor (resource
already exists in the OFGA model).

## Checks
- `cargo fmt --all --check` ✅ · `cargo clippy --all-targets` ✅
enterprise + OSS feature sets (0 warnings)
- prettier ✅ · eslint 0 errors · 207 unit tests on touched specs ✅
- Compiles with paired enterprise branch ✅
2026-08-10 12:43:47 +00:00
Shrinath RaoandShrinath-O2 fbe558b463 test(autoe2e): generated E2E tests for #13652 (stream-schema-timezone) (#13657)
🤖 Auto-generated E2E tests for #13652 — **healed to passing** against a
live OpenObserve before this PR was opened.

- Branch `autoe2e/pr-13652` (stacked on `main`), so the tests run
against the feature code and pass before it merges.
- Spec:
`tests/ui-testing/playwright-tests/Logs/streamSchemaTimezone.spec.js`

The repo Playwright CI re-validates here. Review is for **quality +
coverage** — the tests already pass.

_Generated by the E2E Council pipeline._

---------

Co-authored-by: Shrinath-O2 <214651540+Shrinath-O2@users.noreply.github.com>
2026-08-06 07:00:06 +00:00
Shrinath Rao 4d91f91a41 test(logs): fix alpha1 unflattened drawer-close detach flake (#13656)
## Problem

On the **alpha1 (cloud)** e2e run, the **Logs-Core** shard failed and
did not recover across all 3 retries. The single hard failure was:

`Logs/unflattened.spec.js:220 › Unflattened testcases › stream to toggle
store original data toggle and display o2 id`

### Root cause

After switching to the **unflattened** tab, the test closed the
log-detail drawer with a bare `closeDialog.waitFor()` +
`closeDialog.click()`. Switching that tab re-renders the drawer, so the
close-button node **detaches mid-click** — Playwright logs `element was
detached from the DOM, retrying` and the click hangs for the full 45s,
failing every retry identically. It's a deterministic race, which is why
retries never helped. The secondary retry-failure signature (JSON detail
panel lagging behind tab activation) is the same drawer instability,
wider on the slower shared alpha env.

## Fix

- Close the drawer via the file's existing resilient
`closeLogDetailDrawerIfOpen()` helper (Escape fallback +
wait-for-hidden) in **both** the failing test and its identical
quick-mode sibling (`unflattened.spec.js` lines ~283 and ~426).
- Harden `openJsonDetailTab()` (`pages/logsPages/unflattened.js`) to
re-assert the JSON tab and re-wait once when the panel content lags,
then fall back to the original throwing wait so a genuine non-render
still fails loudly.

Test-only change; no product code touched.

## Verification

Seeded the **Run E2E Tests on Alpha1 (Cloud)** workflow against this
branch (`o2_opensource_repo=test/alpha1-unflatten-drawer-close-flake`,
enterprise on `main`): [run
31067277452](https://github.com/openobserve/o2-enterprise/actions/runs/31067277452)
— Logs-Core and the overall run passed green.
2026-08-06 04:49:28 +00:00
ktx-akshay 7999fd33f3 test: enhance logs visualization error handling and persistence tests (#13591)
## Summary

Adds **10 E2E tests** covering the two defects fixed in #13244, plus the
`SELECT *` behaviour change that shipped alongside them. Also introduces
per-shard backend configuration so the `SELECT *` tests can actually run
in CI.

## Test coverage

### `logsVisualizePersistence.spec.js` — 7 tests (quick mode **off**)

| # | Test | Defect | Fix code exercised |
|---|---|---|---|
| 1 | Renders without the false required-fields error | A |
`convertPanelData.ts` `!query?.customQuery` |
| 2 | Restores chart type, query and chart after URL refresh (h-bar) | B
| `setupLogsTab` re-run + `isInitialVisualizeRestore` |
| 3 | Re-renders after reload with the default chart type | B |
permanent No-Data half |
| 4 | Restores a non-default chart type (area) after refresh | B |
`restoreVisualizationFromUrlOnLoad()` |
| 5 | Chart still renders after reload with a VRL function applied | B |
`prepareVisualizeMode()` VRL copy |
| 6 | Never shows required-fields error toggling Visualize → Logs →
Visualize | A | manual-toggle rebuild path |
| 7 | No `SELECT *` toast opening Visualize with no stream in the URL |
B | page-load ordering guard |

**Defect A** — false "Please select required fields to render the chart"
on the custom-query Timechart panel.
**Defect B** — URL refresh produced a `SELECT *` toast plus permanent No
Data.

### `logsVisualizeSelectStar.spec.js` — 3 tests (quick mode **on**,
dedicated shard)

| # | Test | Behaviour verified | Call site |
|---|---|---|---|
| 8 | Table chart on `SELECT *` → toast shown **and** chart type reverts
| Table is blocked | `Index.vue:2265` (watcher) |
| 9 | Histogram chart on `SELECT *` → no toast, renders |
Line/bar/area/scatter allowed | entry path |
| 10 | `SELECT *` line chart survives browser refresh → no toast, state
restored | Restore path doesn't re-emit | `Index.vue:2465` (restore) |

## Infrastructure changes

| File | Change | Why |
|---|---|---|
| `ci_matrix.json` | New `Logs-SelectStar` shard with
`quick_mode_enabled: "true"` | `isSelectStarForTable()` only exists when
the server runs with quick mode on |
| `playwright.yml` | Per-shard `ZO_QUICK_MODE_ENABLED` env on `Start
OpenObserve` | The flag is read once at server start — a shard is the
smallest unit that can vary it |
| `build-ci-matrix.js` | Emit `quick_mode_enabled` (defaults `"false"`)
| The field was being silently stripped by the emit whitelist |
| `logsPage.js` | 13 assertion helpers + fixed chart-type detection |
Detection read `data-selected` off the wrong element and matched retired
CSS classes, so it always returned `null` |

All 24 existing shards are unaffected — they omit the field and default
to `false`.

## Notes on test quality

- Every negative assertion ("no toast", "no error") is sequenced after a
deterministic positive end-state, and gated on a precondition so it
cannot pass vacuously.
- Toast absence is proved with a MutationObserver recorder installed
before the navigation under test, since toasts auto-dismiss.
- The quick-mode precondition is a hard assertion, not `test.skip` — a
misconfigured shard fails loudly instead of silently reporting
"skipped".
2026-08-04 12:09:26 +00:00
Shrinath Rao cc759bb6e0 test(e2e): fix Alpha1 shard failures (Alerts SSRF, sanity time-range, lazy Monaco, traces settle) (#13614)
## Alpha1 (Cloud) E2E — shard-by-shard failure fixes

Fixes real, root-caused failures from Alpha1 run
[30876689608](https://github.com/openobserve/o2-enterprise/actions/runs/30876689608)
(5 red shards, 16 hard failures). Each root cause was reproduced live
against alpha via Playwright MCP. **8 of 16 hard failures are fixed here
in code**; the remaining 8 are environment/data-timing driven (backend
instability during the run's 04:15–04:18 ingest window) and need a
re-run, not a code change.

### Fixes

| Shard | Fix | Root cause |
|---|---|---|
| **Alerts** (4) | `alerts-advanced.spec.js` destination URL →
`https://example.com/webhook` | The self-host URL
`${ZO_BASE_URL}/…/alerts_notify_sink/_json` resolves to a **private IP**
on cloud, so the backend **SSRF guard rejects the save** → the New
Destination form never closes → `createDestination()` times out, failing
all 4 Alerts-Advanced tests. Verified live: private-IP URL is blocked,
`example.com` (public, IANA-reserved, never delivered to) saves and
closes the form. |
| **GeneralTests** (2 + 2 flaky) | sanity `beforeEach` →
`setDateTimeToPast1Hour()` (+ new `logsPage` helper) | The
result-summary/pagination tests query the default **Past 15 Minutes**.
`e2e_automate` ingestion is bursty on shared/cloud envs — **0 rows in
15m vs 7,850 in 1h** (confirmed via API) — so the result table never
renders. This is exactly the failed-vs-flaky split seen on the run. |
| **Logs-Features** (1) | `monaco-query-prefill.spec.js` → poll
`getQueryEditorTextWhenReady()` | Lazy Monaco prefills its model
asynchronously after a saved view is applied on a fresh page load. A
one-shot read after a fixed 2s caught an empty editor (`Received: ""`).
Now polls until the query lands. Non-masking: if it never prefills, the
poll still times out and the test fails. |
| **Traces** (1 of 2) | `tracesSearch.spec.js` → poll for a settled
results/no-results state | The "no stream selected state" test read
`hasTraceResults()`/`isNoResultsVisible()` once each; the async search
settle left both momentarily false. Now polls until one terminal state
renders. |

### Not changed (deliberately)

- **Traces `traceQueryEditor.spec.js:151`** — the detail-tree check
already waits 10s; its failure means the error-trace detail didn't open,
which needs error-trace data in-window to validate. Weakening the
assertion would mask real behavior.
- **GeneralTests `enrichment.spec.js:101`, `logoManagement.spec.js:18`**
— ran during the backend-instability window and can't be reproduced
live. `[name='home']` is **not** stale (present live) and `_meta` access
is fine for the test user. Env/timing.
- **Pipelines (all 5)** — UI-click timeouts (`…-update-pipeline` /
`Explore` button not found) because pipeline creation / stream data was
unavailable while the backend returned *"No online node" / "Proxy
request" / "Expected N records, got 0"*. Same selectors 42 passing tests
in the shard use. Env-driven → re-run to confirm.

### Validation
- All fixes reproduced/verified live on alpha via Playwright MCP
(`e2etest1@o2-qa.com`, `auto_org_1`).
- All 4 edited specs parse and list (`playwright test --list`).
- Full local runs are blocked by an unrelated issue: the Dex login UI
changed (new "Continue with Email" flow) so `global-setup.js` can't
authenticate locally; CI uses the shared-auth artifact. (Worth a
separate fix.)
2026-08-04 07:44:15 +00:00
Shrinath Rao 503eca6264 fix(e2e): deflake logs autocomplete value-suggestion capture (#13593)
## Problem

In [o2-enterprise run
30791574230](https://github.com/openobserve/o2-enterprise/actions/runs/30791574230)
the **Logs-Features** shard logged **2 failed, 6 flaky, 3 skipped, 63
passed** with **52 retries**. Seven of the eight troubled tests are in
`logs-autocomplete-suggestions.spec.js` (the eighth `code`-field test
shares the cause), and every one dies on the identical assertion:

```
Error: Expected to find a field with captured values
expect(received).not.toBeNull()
Received: null
```

— i.e. the shared `findFieldWithStringValues()` helper returned `null`.

## Root cause

A **click-time race**, not missing data (the `e2e_automate` stream holds
3848 rows ingested at shard start). The helper clicked a field's sidebar
expand button and then polled IndexedDB for 10s — but the 10s window
started at **click time** and raced the `/_values_stream` fetch. In the
failing run the runner was slow (a perf assertion showed queries ~2.6×
over baseline: 1055ms vs <403ms). The values response landed **after**
the IndexedDB poll had already given up, so the record read as `null`
and the assertion failed hard. Because `findFieldWithStringValues()` is
shared across ~8 tests, one slow window knocked out the whole cluster,
and each burned up to 4 attempts → 52 retries.

An intended fix (`clickFieldExpandAndWaitValues`, a deterministic
`/_values_stream` response wait) already existed in the file but was
**never wired in**.

## Fix

- **`expandFieldAndCaptureValues()`** — anchor the IndexedDB
confirmation **after** the actual `/_values_stream` response instead of
racing it from click time; re-click to re-expand if a prior collapse
meant no fetch fired. Replaces the dead `clickFieldExpandAndWaitValues`
helper and the bare click+poll in the `code`-field test.
- **`findFieldWithStringValues()`** — scan via the anchored capture,
with a bounded refresh-and-retry round so a transient empty `/_values`
response self-heals rather than failing the test.
- **Readiness gate** — add `waitForStreamData()` to every `beforeEach`
so freshly-ingested data is searchable before the UI drives value
capture (WAL → index lag). Best-effort so an already-warm shared stream
never blocks.

## Testing

- `node --check` passes; no linter is configured for the suite.
- The slow-runner condition can't be reproduced deterministically
locally; the change is a test-harness reliability fix (deterministic
response-anchoring + readiness gate) that removes the timing dependency
that caused the flake. Will confirm green via the ENT playwright
regression this PR dispatches.
2026-08-03 11:27:33 +00:00
6fb5eecdc5 fix: table migration to same components (#13451)
## What changed

Every table in the app now renders through the shared `OTable`
(`web/src/lib/core/Table`). Both legacy implementations are deleted —
`components/TenstackTable.vue` and `plugins/logs/TenstackTable.vue` —
for ~7,000 lines removed and one table behaviour contract instead of
three.

To get there, `OTable` gained: per-cell hover actions, per-column value
filter, opt-in column close "x", sticky pivot total row + right-pinned
total columns, pivot row-field cell merge, caller-owned pagination bar,
delegated scroll (shared scroller with the logs/traces histogram), and
variable-height virtual rows.

## Tables migrated

| Area | Tables |
| --- | --- |
| Logs | Search results grid, correlated logs |
| Traces | Search results grid, trace details sidebar (attributes /
events / links), service graph node panel |
| Dashboards | Table panel + pivot (incl. PromQL), panel pagination
controls, import error panel |
| RUM | Session player traces tab |
| Pipelines | Scheduled pipeline SQL preview |

## Tested

775 unit tests across the 12 affected suites, all passing.

Manually verified per table:

- **Columns** — resize, reorder, close "x", persistence across reload;
horizontal scroll on wide grids; wrap toggle with virtual scroll; client
+ 3-state server sort
- **Pagination** — custom records-per-page, enabling pagination after
mount, scroll-to-top on page change, no duplicate pager
- **Logs** — FTS highlighting, row expand → JSON preview and its
actions, hover actions + AI button, cell font / row density / status
spine, histogram pinned while scrolling sideways
- **Dashboards** — pivot multi-level headers, cell merge, sticky totals
staying aligned under horizontal scroll, cell colouring (auto palette /
value mapping / conditional rules / overrides), CSV + JSON export
- **Traces, RUM, Pipelines** — events table expansion, error-row border,
row click → trace navigation, SQL preview copy + send-to-AI

---------

Co-authored-by: ktx-vaidehi <134508096+ktx-vaidehi@users.noreply.github.com>
Co-authored-by: ktx-vaidehi <vaidehi.akhani@kiara.tech>
Co-authored-by: Shrinath Rao <shnath@openobserve.ai>
2026-07-30 12:18:23 +00:00
Shrinath RaoandClaude Opus 4.8 c6b2829a5e test(autoe2e): generated E2E tests for #13025 (logs-stream-quick-pick) (#13030)
🤖 Auto-generated E2E tests for #13025 — **healed to passing** against a
live OpenObserve before this PR was opened.

- Branch `autoe2e/pr-13025` (stacked on `issue-ent-2038`), so the tests
run against the feature code and pass before it merges.
- Spec: `tests/ui-testing/playwright-tests/Logs/logsQuickPick.spec.js`

The repo Playwright CI re-validates here. Review is for **quality +
coverage** — the tests already pass.

_Generated by the E2E Council pipeline._


**Test cases added / changed:**

| Test case | Type | What it verifies |
|---|---|---|
| `should quick pick a stream from the sidebar` | new | clicking a
sidebar quick pick button selects the stream and loads the field list |
| `should show hero state on fresh arrival with no stream selected` |
new | the main content area shows both hero action cards when no stream
is selected |
| `should open stream dropdown when clicking select stream card` | new |
clicking the "Select a stream" hero card opens the stream dropdown
popover |
| `should reappear quick pick after deselecting and re-select works` |
new | after deselecting a stream the quick pick reappears and
re-selection works correctly |
| `should show more footer when org has more than 8 streams` | new | the
quick pick more footer is visible with the correct remaining count when
org has > 8 streams (skips otherwise) |
| `should select stream via hero recent chip` | new | clicking a
recent-stream chip in the hero state selects the stream and triggers
field list loading |
| `should open query guide documentation in new tab` | new | clicking
the "Read the query guide" card opens the OpenObserve docs in a new
browser tab |

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 16:40:14 +00:00
BhargavandClaude Opus 4.8 ef2efdf5fc fix: logs sidebar table will be default view and draggable tabs (#13368)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 06:53:13 +00:00
Shrinath RaoandClaude Opus 4.8 415d781941 test: remove redundant networkidle waits in Logs-Features specs (alpha stability + speed) (#13383)
## Why

The **Logs-Features** alpha1 shard runs 18–23 min and intermittently
trips *"self-hosted runner lost communication"* — a **duration-driven
infra flake**, not a test failure (the tests were passing right up to
the runner death). A long job keeps the self-hosted runner under
sustained load, raising the odds it drops off the network. Shrink the
runtime and the flake probability drops with it.

A large part of that runtime is `waitForLoadState('networkidle')`.
`networkidle` means "wait for 500ms of zero network activity" — but the
cloud SPA is constantly chattering (telemetry / RUM / streaming search),
so that quiet moment basically never comes. Each call therefore runs to
its **full 30s ceiling**, then `.catch(() => {})` throws the result
away. Locally there's no background traffic, so the same line returns in
<1s — which is exactly why these specs fly locally but crawl on alpha.

## What

In `monaco-query-prefill.spec.js`, all **10** `networkidle` calls sit
right after a `page.goto()` (which already awaits the `load` event)
**and** right before a deterministic gate:
`selectStream`, `waitForQueryEditorContent`,
`waitForQueryEditorVisible`, or `waitForRedirectedQueryEditorContent`.

They add nothing to correctness — the following targeted wait is the
real readiness signal — so they're removed. No new timers introduced;
the existing targeted waits do the gating.

## Verified on alpha (live env, full spec)

| | Runtime | Result |
|---|---|---|
| **Before** (original) | 5.1m | 1 flaky failure (P2), last test skipped
(serial mode) |
| **After** (this change) | 4.3m | **5/5 passed** |

The after-run ran **more** tests (all 5) in **less** time, and was fully
green. A second confirmation run is in progress and will be posted
below.

## Scope

Pilot for the same cleanup. The heavy file is `searchPatterns.spec.js`
(**46** of these waits); this validates the pattern on a small,
well-understood spec first before rolling out.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 01:10:36 +00:00
Vamsi Karthik RandClaude Opus 4.8 30b736e6e4 test: stabilize alpha1 Logs-Queries & Logs-Features shards on cloud (monolithic download-test split + share-link redirect hydration + SQL-commit reliability) (#13241)
## What

Stabilizes the **Logs-Queries** and **Logs-Features** shards of the
alpha1 cloud E2E
suite to green. Test-infra + page-object changes only; **no product
code** (5 files
under `tests/ui-testing/`).

> **Stacked on #13240** (Logs-Core). Base is `fix/logs-core-alpha1-e2e`
— please merge
> #13240 first; GitHub will then retarget this PR to `main`. The diff
here is only the
> Logs-Queries/Features work (5 files).

## Root causes & fixes

### Logs-Queries

**`logsDownloads.spec.js` — monolithic test exceeded the test timeout
(hard failure).**
All 14 download scenarios ran sequentially in **one** `test()` (each a
full `page.reload`
+ re-setup), needing ~7–8 min against a 360s budget. It hit 360s
mid-run, Playwright tore
the page down, and the remaining scenarios failed with **"Target
page/context closed"** (a
cascade, not a download bug). A `try/catch` wrapper also swallowed
per-scenario errors and
rethrew an aggregate, hiding the real stack. → **Split into 14 isolated
per-scenario tests.**
The `beforeEach` already yields a fresh, query-loaded page, so no
per-scenario reload is
needed; each test is short, isolated (one failing download can't close
the page for the
others), and parallelizes. Removed the error-swallowing wrapper;
`@downloadAll` tag preserved.

**`searchpartition.spec.js` — Reka OSwitch state asserted within a
hardcoded 5s (flaky).**
`verifyHistogramState` waits for the histogram OSwitch
`data-state="unchecked"` element, but
the Reka switch animates the checked→unchecked transition and the
settled state can appear
>5s after the toggle+execute under CI load. → Raised the poll ceiling to
15s (still asserts
the real end-state, no sleep).

### Logs-Features

All the share-link failures were **flaky, not product bugs** — the
redirect fully restores
every param; the tests raced the SPA under CI load.

**Reading UI/URL state before the short-URL redirect finished
hydrating.** `getQueryEditorText()`
returned `""` (lazy Monaco visible but not yet pre-filled) and
`captureCurrentState()` read
`show_histogram=null` (the SPA rewrites URL params in stages). → New
page-object helpers
`waitForQueryEditorContent`, `waitForUrlParam`, and URL-stabilization
inside
`waitForRedirectComplete` (`_waitForUrlStable`). No fixed
`waitForTimeout`.

**Bare `clickRefresh()` cancelled the in-flight SQL-mode auto-search**
("Running query
cancelled" toast), so `sql_mode`/query never committed to the short URL
→ empty editor after
redirect. → Commit via `runQueryAndWaitForResults()` (waits for the
Cancel state to clear
first), then confirm `sql_mode` is in the URL before sharing.

**SQL setup itself was unreliable.** `enableSqlModeIfNeeded` (Vue
`meta.sqlMode` flag)
didn't always stick, and `clearAndFillQueryEditor`'s focus-sensitive
`Ctrl+A` select-all
silently appended in headless CI (**doubled query**). → New
`setupSqlQueryForShare(query)`:
sets the Vue flag + writes the exact query via Monaco `executeEdits`
(verified) +
`runQueryAndWaitForResults`, then confirms `sql_mode` committed to the
URL — **retries once,
then strict-asserts** (writing SELECT text alone does **not** flip
`meta.sqlMode`; the flag
is what the app serializes to `sql_mode`). `waitForUrlParam` gained a
`required` mode that
throws instead of silently letting a bad state through to the share.

**Residual Monaco lazy-mount race after the short-URL hop** — the editor
occasionally
mounted without applying the query from the (resolved) URL. →
`waitForRedirectedQueryEditorContent`
self-heals with **one** reload of the resolved URL (the reliable
URL-param prefill path).

**Share success toast strict-mode violation** — the "Link Copied
Successfully!" toast
coexisted with the cancelled-query info toast, so the broad selector
matched 2 elements. →
Match the share-result toast by message with `.first()` in the share
helpers.

**`searchPatterns.spec.js` — async pattern extraction still
empty/timeout after 60s** under
alpha indexing load. → `setupPatternsView` re-runs the query and waits
once more before giving
up (resilience for the data dependency; callers still assert the
returned state).

## Scope / safety

- **5 files:** `pages/logsPages/logsPage.js` + specs `logsDownloads`,
`monaco-query-prefill`,
  `shareLink`, `searchPatterns`. **No product code.**
- **No tests deleted, no `.only`, no unconditional skips, no assertions
removed.**
- Every fix replaces a fixed sleep / wrong assumption with a
deterministic wait on the real
  condition — no `waitForTimeout`, no `force`, no retry-based masking.

## Validation

- Local on cloud alpha (`retries:0`, stricter than CI's `retries:1`):
- `logsDownloads` **14/14** (`--workers=3`) — no timeouts, no "Target
page closed".
- Previously-flaky share-link / SQL / searchpartition tests **12/12**
under `--repeat-each=3`
(`sql_mode` committed on the first attempt every time; retry never
needed).
- Full `shareLink` + `monaco-query-prefill` files **15/15** — no
regressions.
- alpha1 Logs-Queries + Logs-Features CI: green —
https://github.com/openobserve/o2-enterprise/actions/runs/29539009573


🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 09:27:04 +00:00
9c32b03b34 test: stabilize alpha1 Logs-Core shard on cloud (quick-mode detection + search-toolbar sync + scheduler-list hidden-button recovery) (#13240)
## What

Stabilizes the **Logs-Core** shard of the alpha1 cloud E2E suite to
green, running
**fully parallel** (`--workers=5`). Test-infra + page-object changes
only; **no product
code** (7 files under `tests/ui-testing/`). 

## Root causes & fixes

### Quick mode / interesting fields (7 tests)
- **`enableQuickModeIfDisabled` treated the wrong element as the
quick-mode signal.** It
returned early whenever the field-list **user-defined-schema toggle
group** was visible —
but `FieldListPagination` renders that group whenever a stream exposes a
UDS (always true
on cloud), independent of `searchObj.meta.quickMode`. The per-field
interesting (star)
buttons are gated purely on `quickMode`, so they never rendered and
every
`ensureFieldIsInteresting` call timed out. Now verifies the **actual**
Quick Mode switch
state via the utilities menu and confirms by waiting for a per-field
interesting button.
- **`sqlModeOrderBy` hung on `waitForLoadState('networkidle')`** —
streaming keeps the
network busy so it never settles; switched to `domcontentloaded` (the
editor assertion is
  the real readiness gate).

### Search-toolbar synchronization (logspage / histogram flakes)
- **`clickRefreshButton` / `clickRefresh` clicked the refresh button
mid-state-swap.** The
Run-query button swaps to a "Cancel query" variant (and briefly
detaches/disables) while a
prior/auto search is in flight; clicking then cancelled that search or
hit a
  not-visible/detached node (`element is not visible`), and a subsequent
`waitForResponse('/_search')` never fired (60s timeout). Both now wait
for the run-mode
button to be **visible AND idle** (not Cancel, not disabled/`aria-busy`)
before clicking —
  no `force`.
- **`clickLiveMode5Sec` + `clickRelative6WeeksButton` popovers shifted
mid-click.** The
refresh-interval dropdown and the date picker are popovers anchored to
the toolbar; while a
search is in flight the toolbar reflows and the popover repositions, so
the target never
reaches Playwright's "stable" state (~45s click timeout) or the click
misses (date range
  stayed "Past 15 Minutes"). Both now wait for the toolbar to settle
(`_waitForQueryButtonIdle`) first; the date preset additionally verifies
its trigger label
  and retries once.

### Histogram error-handling
- **Query-propagation race** — `clearAndFillQueryEditor` fills Monaco
but the value reaches
the store on a debounce, so `clickRefresh()` could run the **previous**
query and the
no-events/error state never appeared. Now waits for the Monaco model to
reflect the new
  query (`waitForQueryEditorValue`) before running.

### Logs-table field management
- **Fixed `waitForTimeout(2000)` in `beforeEach` →
`waitForFieldListReady()`** — the
expandable field rows only render once the stream's fields have indexed
**values**, and
cloud indexing after ingestion lags under parallel load, so the sidebar
was empty
(`fieldCount === 0`, "field expand button not found"). Gates on the
data-backed field list
  (60s, matching the global-setup indexing budget).
- **Severity-colors** read status bars after a fixed 3s → poll until
they render.
- **Case-insensitivity** counted matching fields after a fixed 500ms →
`expect.poll`.
- **Persist-after-refresh (app timing)** — the added column survives
reload only via the
`logFilterField` localStorage entry, written **after** the column
renders; reloading before
that commit lost it (now waits for the localStorage write). The restore
is then
intermittently slow/dropped on the first reload under cloud load, so it
reloads up to 2×
  and polls for the restored column.

### jobSearch — scheduler-list hidden button (app defect, worked around)
- **App defect:** the scheduler list renders under
`v-show="showSearchScheduler"`, and the
logs page **resets that flag whenever the URL query loses the
`action=search_scheduler`
param** (`updateUrlQueryParams` strips it after a search). The "Get
Jobs" button is then in
the DOM but `display:none` and never recovers — the whole jobSearch CRUD
suite timed out.
`_getJobRowIndex` now **re-navigates to the scheduler-list URL**
(restores the param →
re-shows the list) and retries; validated firing and recovering live on
alpha. Written up
  for a frontend fix (`fix/search-scheduler-job-issue`).
- **`validateAddJob` "Job added successfully" toast made best-effort** —
it's transient and
`searchSchedulerSubmit` already awaited the POST (returned the jobId),
so the toast can
auto-dismiss before the assertion runs; creation is already confirmed by
the jobId + the
scheduler-list lookup. Same re-open recovery applied to its Get-Jobs
click.

## Scope / safety

- **7 files:** `Logs` page-objects (`logsPage`, `logsQueryPage`,
`logsPageEP`,
`jobScheduler`) + Logs specs (`logshistogram`, `logsquickmode`,
`logstable`). **No product
  code.**
- **No tests deleted, no `.only`, no unconditional skips, no assertions
removed.**
- Every fix replaces a fixed sleep / wrong assumption with a
deterministic wait on the real
  condition — no `waitForTimeout`, no `force` in the touched paths.

## Validation

- Local on cloud alpha: `logsquickmode` 8/8, `logshistogram` 5/5,
`logspage` 23/23,
`logstable` field-management + persist (`--repeat-each` clean),
jobSearch scheduler-list
  recovery observed firing and recovering live.
- alpha1 Logs-Core CI: green —
https://github.com/openobserve/o2-enterprise/actions/runs/29471282407


🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Shrinath Rao <shnath@openobserve.ai>
2026-07-17 07:30:01 +00:00
ktx-kirtan 00b910a382 fix: remove quasar leftovers (#13180) 2026-07-14 11:35:46 +00:00
12f8e134ff test(autoe2e): generated E2E tests for #11813 (logs-visualize-persistence) (#13010)
🤖 Auto-generated E2E tests for #11813 — **healed to passing** against a
live OpenObserve before this PR was opened.

- Branch `autoe2e/pr-11813` (stacked on `main`), so the tests run
against the feature code and pass before it merges.
- Spec:
`tests/ui-testing/playwright-tests/Logs/logsVisualizePersistence.spec.js`

The repo Playwright CI re-validates here. Review is for **quality +
coverage** — the tests already pass.

_Generated by the E2E Council pipeline._


**Test cases added / changed:**

| Test case | Type | What it verifies |
|---|---|---|
| `should persist live mode / auto-run toggle across navigation` |
extend | live-mode toggle state-guard added before navigation to catch
silent no-op when auto_query_enabled is false |

---------

Co-authored-by: Shrinath-O2 <214651540+Shrinath-O2@users.noreply.github.com>
Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2026-07-10 10:12:34 +00:00
ktx-akshay 39c1d8ae83 test: reduce Logs-Builder-Basic e2e runtime by removing dead waits and duplicate setup (#13080)
## Reduce `Logs-Builder-Basic` e2e shard runtime — ~10 min → ~5 min

### 🎯 Result (measured on CI)

| Metric | Before | After | Saved |
|--------|--------|-------|-------|
| **`Logs-Builder-Basic` shard** | **10m 05s** | **5m 12s** | **~4m 53s
(≈48% faster)** |

The shard runtime is cut roughly in half. Most of the old time was fixed
sleeps, waits that always ran their full timeout, and duplicated
per-test setup — not actual test logic. **No test cases, steps, or
assertions were removed.**

### What we changed

| # | Area | Before | After | Saving |
|---|------|--------|-------|--------|
| 1 | `initQueryBuilderTest` setup | Logs page loaded twice (helper
`goto` + `selectStream` navigates again) | Navigate once | 1 page load ×
~41 tests |
| 2 | `waitForBuildTabLoaded` | Always waited up to 10s for editor to
fill, even when it's meant to be empty | Skip when SQL mode is off |
~10s dead wait on many tests |
| 3 | `enableSqlModeIfNeeded` | 2s watcher wait + 500ms sleep, even
where the watcher never fires | Gated to Build tab; waits on real signal
| ~2.5s × ~35 tests |
| 4 | `disableSqlModeIfNeeded` | Fixed 500–600ms sleeps | Deterministic
wait on editor update | Blind sleeps removed |
| 5 | `applyQueryButton` | Clicked Run blindly | Waits for button ready
first | Fewer early-click retries |
| 6 | `pagination.spec` | Fresh stream ingest + index-wait per test (9×)
| One ingest per worker, reused | 8 redundant ingests + waits |
| 7 | `pagination.spec` | Dead `waitForTimeout(2000)` per streaming test
| Removed | ~2s × 5 tests |
| 8 | `unflattened.spec` | Search run twice with 3s + 1s sleeps | Single
run | ~5s × ~8 calls |
| 9 | `unflattened` row scan | Fixed 3s sleep per row | Wait for content
to render | 15-row scan: ~97s → seconds |
| 10 | `unflattened.spec` | Blind sleep after ingest | Poll until stream
queryable | No over-waiting |

### Bonus

Items 2–5 live in the shared `logsPage` page object, so
`Logs-Builder-Advanced`, `Logs-Core`, and `Logs-Features` shards get
faster for free too.

### Notes

| Item | Detail |
|------|--------|
| `playwright.yml` | Unchanged — shard layout stays as-is |
| Assertions | Preserved everywhere (e.g. pagination still checks the
same record counts) |
| Validation | All 52 tests still discovered by `playwright --list`;
shard confirmed green on CI at 5m 12s |
2026-07-08 09:47:08 +00:00
Shrinath RaoandClaude Opus 4.8 62a8f3f30b ci: gate Playwright + API tests behind an 'e2e' label + auto-bypass non-code changes (#13014)
## What

Gate the full **Playwright (UI)** and **API** test suites on PRs behind
a single **`e2e` label**, and **auto-bypass** PRs that only touch files
which can't affect those suites. Covers `playwright.yml` and
`api-testing.yml`.

## Behaviour (both suites)

| Situation | build/test jobs | summary check (`playwright_summary` /
`api_tests_summary`) | Mergeable? |
|---|---|---|---|
| PR with `e2e` label | full suite runs | green if tests pass | ✅ if
green |
| PR, no label, relevant code changed | skipped | **fails** ("add `e2e`
label") | ❌ blocked |
| PR, no label, docs/meta only | skipped | **passes** (auto-bypass) | ✅
|
| Remove the `e2e` label | skipped (fresh run) | **fails** again | ❌
until re-added |
| push to `main` / merge queue / dispatch | full suite runs | green if
tests pass | n/a |

One `e2e` label runs **both** UI + API. `push`, `merge_group`, and
`workflow_dispatch` are never label-gated.

## Why the gate lives in the summary job

A job that `if:`-skips reports `skipped`, which branch protection treats
as **pass**. So a no-label PR can't be blocked by merely skipping jobs —
the summary job **actively fails** when the change is relevant and the
`e2e` label is absent.

## Auto-bypass (`check_changes`)

No label needed for: `*.md/.mdx/.markdown/.rst/.adoc`, `docs/`,
images/media, `LICENSE/NOTICE/AUTHORS/CONTRIBUTORS/CHANGELOG/.mailmap`,
`CODEOWNERS`, GitHub issue/PR/funding templates,
`dependabot`/`renovate`,
`.gitignore/.gitattributes/.editorconfig/.gitkeep/.husky/.vscode/.idea`.
The **API** workflow additionally bypasses `web/` + UI-test dirs
(frontend changes don't affect API tests).

**Not** bypassed (still trigger): `.github/workflows/**` (incl. these
workflow files), source, `package*.json`/lockfiles, configs, `*.txt`.

## Rollout prerequisites

- Create the **`e2e`** label in this repo.
- Required status checks = **`playwright_summary`** and
**`api_tests_summary`** — the individual shard jobs must NOT be required
(they legitimately skip and would auto-pass).

Sibling PR on the other repo uses the same branch `ci/e2e-label-gate`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 08:41:01 +00:00
f4ba2e2dd6 test(autoe2e): generated E2E tests for #12857 (fts-default-column) (#12902)
🤖 Auto-generated E2E tests for #12857 — **healed to passing** against a
live OpenObserve before this PR was opened.

- Branch `autoe2e/pr-12857` (stacked on `main`), so the tests run
against the feature code and pass before it merges.
- Spec:
`tests/ui-testing/playwright-tests/Logs/ftsDefaultColumn.spec.js`

The repo Playwright CI re-validates here. Review is for **quality +
coverage** — the tests already pass.

_Generated by the E2E Council pipeline._


**Test cases added / changed:**

| Test case | Type | What it verifies |
|---|---|---|
| `should clear FTS selection on stream change and re-resolve for new
stream` | extend | switching streams clears the carried-over FTS default
selection, then re-resolves the FTS default column for the new stream on
the next search |
| `should clear FTS default on field reset and re-resolve on next
search` | extend | clicking the field-list reset icon clears the
auto-picked FTS default column from the table, then running a new search
re-resolves it |

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Shrinath-O2 <214651540+Shrinath-O2@users.noreply.github.com>
2026-06-26 10:31:30 +00:00
f5a14afbe9 chore: logs page displays fts default columns (#12857)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Shrinath Rao <shnath@openobserve.ai>
2026-06-25 14:13:33 +00:00
Shrinath RaoandClaude Opus 4.8 a0bdebb711 test: reduce e2e flakes — pipelines ingest keep-alive, dashboard chartJson popup, logs _o2_id (#12813)
Reduces three independent e2e flakes. All test-infra only; no product
code.

## 1. Pipelines — `ingestData` "Premature close" (the original failure)
`LogsPage.ingestData` failed all records with `Failed to ingest N out of
N`. Server returned HTTP 200 and ingested every record, but node-fetch
2.7.0 reused a keep-alive socket the server closed during the 500ms
inter-record gap → "Premature close" reading the body (0/384 succeeded).
Fix: disable keep-alive (fresh connection per request, per-protocol
agent) + per-record retry. Verified: Pipelines shard green.

## 2. Dashboards-Core — `dashboard-chartJson.spec.js` popup flake
Custom-query tests (1 failed + 3 flaky) failed at the JSON/non-timestamp
checkbox with "popper intercepts pointer events" / detached timeouts.
Root cause (reproduced 100% locally): the field-property ODropdown
auto-closes within ~300ms when opened right after the panel's first
render — a late field-list re-render dismisses it. `toBeVisible()`
passes at t=0 but the checkbox is gone by click time. Fix:
`openFieldPropertyPopup` now opens, confirms the popup STAYS open, and
re-opens if it auto-closed (throws if it never stays open — no masking).
Verified locally across repeated runs.

## 3. Logs-Builder — `unflattened.spec.js` `_o2_id` readiness
Failed with `Failed to find _o2_id field after 3 attempts`; CI log shows
the UI detail was empty (`fields: []`) — re-ingested data wasn't
search-visible yet on the contended runner. The readiness gate existed
but its result was ignored, so the test fell through to a doomed UI scan
and burned all 4 retries (~26 min). Fix: respect the gate's result (on
timeout, wait once more and log), and widen the UI row scan 10→15. The
final assertion is unchanged — a genuinely absent `_o2_id` still throws.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 13:47:10 +00:00
ktx-akshayandAbhay Padamani bc5303eb54 test(logs): add SQL queries test cases for inline comments handling (#12663)
## Summary

- Add E2E test coverage for SQL queries containing `--` inline comments
in the Logs search page
- Fix verified: queries like `-- comment\nSELECT _timestamp FROM stream`
no longer produce `SQL ParserError("Expected: end of statement, found:
_timestamp")`
- Add two reusable page object methods to `logsPage.js` for asserting
SQL error state

## What Was Broken

SQL queries with `--` style comments followed by a `SELECT` statement
were failing with:
> `SQL error: ParserError("Expected: end of statement, found: _timestamp
at Line: 1, Column: 45")`

The parser was not stripping comment lines before executing the query,
causing it to misread the `SELECT` column list as a second statement.

## Test Scenarios Covered

| # | Scenario | Tag |
|---|----------|-----|
| 1 | Single-line comment before SELECT | `@P0 @smoke` |
| 2 | Multiple comment lines before SELECT | `@P1` |
| 3 | Inline comment at end of a line (`SELECT ... -- comment`) | `@P1`
|
| 4 | Comment in the middle of a multi-line SQL query | `@P1` |
| 5 | Comment + WHERE clause using `str_match_ignore_case` | `@P1` |
| 6 | Comment-only query — must NOT produce `_timestamp` parser error
(edge case) | `@P2` |

## Files Changed

-
`tests/ui-testing/playwright-tests/Logs/logsqueries.sql-comments.spec.js`
← new spec file
- `tests/ui-testing/pages/logsPages/logsPage.js` ← two new assertion
methods added
- `.github/workflows/playwright.yml` ← spec registered in CI pipeline

---------

Co-authored-by: Abhay Padamani <141122205+ktx-abhay@users.noreply.github.com>
2026-06-17 07:17:38 +00:00
Shrinath RaoandClaude Opus 4.8 097deb4ee9 test(logs): fix flaky unflattened timeout via _o2_id readiness gate (#12650)
## Problem

The **Logs-Builder-Basic** e2e shard is frequently flaky — it times out
on `unflattened.spec.js` and, because it's a big shard, a single timeout
re-runs the whole thing. Example: [run
27521591530](https://github.com/openobserve/openobserve/actions/runs/27521591530/job/81341218030).

In that run:
- `unflattened.spec.js:205` — hard failure, **timed out (300s) on all 3
retries**
- `unflattened.spec.js:100` and `logsQueryBuilder-chart.spec.js:148` —
flaky (passed on retry)

## Root cause

The failures are **timeouts, not assertion bugs**. The unflattened
tests:
1. Slept **~76s of fixed `waitForTimeout`** across the file (pure dead
time).
2. Ran a retry loop that **re-ingested 3,848 records up to 5×/test**
while waiting for the `_o2_id` field to index after enabling *Store
Original Data*.

Each test + setup is ~80s on a fast local machine; CI runners are ~3-4×
slower **and** run all 4 specs in the shard in parallel against one
backend. That pushes individual tests right onto the 300s/test ceiling.
The re-ingestion balloon also hammered the shared backend, slowing the
other specs (`logsQueryBuilder`, `pagination`) — which is why they
flaked as collateral.

## Fix

- Add `waitForO2IdQueryable()` to the unflattened page object: **polls
the search API until `_o2_id` is actually queryable** instead of
sleeping a fixed interval and hoping indexing caught up.
- Gate the UI scan on that readiness signal, removing the 15s/5s blind
schema-propagation sleeps.
- Turn the expensive **re-ingest** retry loop into a cheap **re-query**
loop (attempts 5 → 3) — the gate guarantees the data is already in the
backend, so a UI miss is only render lag.

No change to what the tests actually assert.

## Verification (local, against self-hosted OpenObserve)

| Check | Result |
|---|---|
| Unflattened solo ×2 (cleanup between) | 2 passed each, `_o2_id` on
**row 0 / attempt 1** every time, **2.3m** (was 2.8m) |
| `logsQueryBuilder-chart:148` isolated ×5 | **5/5 passed** → not
independently flaky (collateral) |
| **Full 4-spec shard, 4 workers (CI scenario)** | **52 passed, 0
failed, 0 flaky** |

The retry loop now never fires — the readiness gate makes the first UI
scan succeed every run, killing both the timeout and the cross-spec
contention.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 07:22:05 +00:00
Bhargavandgithub-actions[bot] 957d7714a0 fix: incident page status filter added (#12613)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-12 02:56:06 +00:00
3e89667b13 test: add edition-features documentation validation spec (#12573)
## Summary
- Adds a single GeneralTests spec (`edition-features.spec.js`) that
validates the header edition button, the `EnterpriseUpgradeDialog`,
every enterprise feature card, and the `o2.ws/*` documentation links
each card opens.
- Two tests live in the spec; exactly one runs per environment. The
active edition is detected from the rendered header button label (most
direct signal of what the user sees, tolerates frontend/backend
build-flag mismatches like an OSS frontend served by an ENT backend).
- Pairs with the same-named branch on `openobserve/o2-enterprise` so ENT
CI tree-merges this spec in and runs the ENT variant.

## What the spec validates
- Header button label per edition (`Get OpenObserve Enterprise (Free)`
vs `Edition: Enterprise`)
- Hero panel (title, badge, primary button, features title, Learn More
button)
- 20 enterprise feature cards (presence + external-link icon + BETA/HA
badges)
- Cloud-only `Bring Your Own Bucket` card stays hidden outside Cloud
- Every feature card click opens a popup that lands on the expected
`openobserve.ai` doc page
- Hero external link buttons (`Download Now`/`Learn More` on OSS, `Learn
More` on ENT) — `Get Free License` intentionally not clicked because it
switches the active org to the meta org

## Files
-
`tests/ui-testing/playwright-tests/GeneralTests/edition-features.spec.js`
(new)
- `tests/ui-testing/pages/generalPages/editionFeaturesPage.js` (new —
page object + truth table of slugs / expected doc paths)
- `tests/ui-testing/pages/page-manager.js` (register
`pm.editionFeaturesPage`)

## Test plan
- [x] OSS local run: 1 passed, 1 skipped (~2.0m)
- [x] ENT local run: 1 passed, 1 skipped (~2.0m)
- [x] Sentinel audit passed (POM compliance, no raw selectors in spec,
no hardcoded secrets, no console.log)
- [ ] OSS CI green on this PR
- [ ] ENT CI green on companion PR

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-11 01:14:55 +00:00
4ca7a04864 test: model pricing E2E tests (13 journey flows) + Build tab timing fix (#12525)
## Summary

- **13 Playwright E2E journey tests** for the Model Pricing feature
(\`/settings/model_pricing\`), consolidating all P0–P2 scenarios into
journey-based flows
- New page object \`ModelPricingPage\` under \`pages/generalPages/\`
- API cleanup integrated into the centralized \`APICleanup\` class and
called from \`cleanup.spec.js\`
- CI matrix updated: \`ZO_MODEL_PRICING_ENABLED=true\` env var added;
\`model-pricing.spec.js\` added to the \`GeneralTests\` job
- **Bug fix**: \`waitForBuildTabLoaded\` now polls the Monaco editor for
non-empty content (Phase 3), fixing a timing race where Build tab SQL
tests read an empty query string on slower CI machines

## Test coverage

| Journey | Scenarios covered |
|---------|------------------|
| List, tabs & search | Controls, tab switching, search, built-in tab |
| Create & validation | All form validation cases + successful save |
| Edit, cancel & delete | Full lifecycle |
| Duplicate & clone | Org model duplicate + built-in clone |
| Bulk actions | Select, export JSON, bulk delete |
| Toggle | Disable/re-enable with correct visual state |
| Test match dialog | Empty state, no-result, clear, match result |
| Import | Valid JSON, correction flow, cancel |
| Editor features | Multi-tier, pricing template, pattern examples |
| Pricing drawer | Overflow link → drawer with all price keys |
| Empty state | CTA when org has no custom models |
| Cost applied | LLM span matched → cost stored correctly |
| No matching model | Unknown model name → zero cost stored |

## Bug fix: Build tab query editor timing

\`waitForBuildTabLoaded\`'s Phase 2 (chart-type-selected signal) fires
as soon as \`initializeFromQuery\` sets the chart type — before
\`makeAutoSQLQuery\` has run. On slower CI machines this left
\`queries[0].query\` empty when tests read the editor, causing the "SQL
ON + Auto mode" and "Auto → Custom" tests to receive \`""\` instead of
generated SQL.

Phase 3 polls the Monaco editor
(\`[data-test="logs-search-bar-query-editor"]\`) for non-empty content,
confirming \`onBuildQueryGenerated\` has been called and the query is
ready.

## Test plan

- [x] All 13 model pricing tests pass locally
- [x] \`logsQueryBuilder-editor.spec.js\` (23 tests) — all pass with
Phase 3 fix applied
- [x] Sentinel code audit passed (no blocking issues)
- [x] API cleanup added to \`cleanup.spec.js\` via
\`apiCleanup.cleanupModelPricingModels()\` — 404-safe for instances
where the feature is disabled

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-09 18:33:07 +00:00
44d8e56f0f fix: Fix/layout exp1 (#12521)
Co-authored-by: Kirtan Thakkar <kirtan@kiara.tech>
Co-authored-by: ktx-riya <riya.kukadiya@kiara.tech>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: ktx-vaidehi <134508096+ktx-vaidehi@users.noreply.github.com>
Co-authored-by: Subhra264 <chakrabortysubhradeep556@gmail.com>
Co-authored-by: ktx-mihir <mihir.patel@kiara.tech>
Co-authored-by: ktx-vaidehi <vaidehi.akhani@kiara.tech>
Co-authored-by: Ashish Kolhe <ashish.j.kolhe@gmail.com>
2026-06-09 16:28:08 +00:00
61aebff552 fix: refactor!: remove SQL mode toggle in favor of auto-detection (#12483)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Shrinath Rao <shnath@openobserve.ai>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-07 04:43:00 +00:00
ktx-akshay e890b83d2c test: fix flaky dashboard end-to-end tests (#12375) 2026-06-01 07:57:19 +00:00
Shrinath RaoandClaude Sonnet 4.6 0929fa5678 test: Sentinel audit fixes + parallelize Metrics E2E shard (~22 min → ~5-7 min) (#12367)
## Summary

Two independent improvements to the Playwright E2E test suite.

---

### Part 1 — Sentinel audit fixes (original PR scope)

Fixes from the Sentinel audit review of PR #12358 (selector drift
stabilization).

- **Dead code removal**: delete `clickJobID()` from `logsPageEP.js`
(unreachable code containing `console.log`); remove unused `chromium`
import
- **Critical fix**: replace `console.log`/`console.error` in
`decryptLogSQL()` with `testLogger` equivalents
- **POM compliance**: replace raw `page.locator()` call in
`alerts-ui-operations.spec.js` `beforeEach` with
`pm.alertsPage.isIncidentsFeatureEnabled()`; add that method to
`alertsPage.js`
- **POM compliance**: move per-test `const pm = new PageManager(page)`
into `beforeEach` in `service-graph.spec.js`; replace raw
`page.waitForLoadState()` with
`pm.serviceGraphPage.waitForGraphReload()`; add `waitForGraphReload()`
to `serviceGraphPage.js`
- **Inline selector cleanup**: move metrics tab inline string literals
in `serviceGraphPage.js` into constructor properties
- **Tagging**: add
`@cipherKeys/@enterprise/@P1/@P2/@negative/@validation` to all 6 tests
in `cipherKeys.spec.js` (were untagged); add `@P1/@P2` to all 5 tests in
`regexPatternManagement.spec.js`
- **ESM fix**: correct `export const path = require('path')` → `import
path from 'path'` in `logoManagementPage.js`
- **Deduplication**: consolidate
`createFirstFunction`/`createSecondFunction` into shared
`createFunction(name, vrlCode)` in `pipelinesEP.js`

---

### Part 2 — Parallelize Metrics E2E shard

**Problem**: The `e2e / Metrics` CI shard was consistently the slowest
job at ~22 minutes per PR run, while all other shards complete in ~5-7
minutes.

**Root cause**: 9 of 11 Metrics spec files used
`test.describe.configure({ mode: 'serial' })` because they shared a
describe-scope `let pm` variable reassigned in `beforeEach`. This forced
every test in those files onto a single Playwright worker, eliminating
all parallelism despite `fullyParallel: true` and 5 workers being
configured.

**Fix applied to all 9 affected files** (`metrics.spec.js`,
`metrics-config.spec.js`, `metrics-config-tabs.spec.js`,
`metrics-visualizations.spec.js`,
`metrics-promql-query-persistence.spec.js`,
`metrics-table-column-order.spec.js`, `metrics-queries.spec.js`,
`metrics-aggregations.spec.js`, `metrics-advanced.spec.js`):
- Remove `test.describe.configure({ mode: 'serial' })`
- Replace shared `let pm` + `beforeEach` pattern with a `setupTest(page,
testInfo)` helper that creates and returns a fresh `PageManager` per
test — the same pattern already used in `metrics-promql-builder.spec.js`
(the one file that was already parallel)
- `metrics-table-column-order.spec.js`: pass `pm` explicitly into
`setupTableChart(pm, page, mode)` since it can no longer close over a
describe-scope variable
- Split consolidated mega-tests (for-loops over multiple independent
scenarios) in `metrics-queries`, `metrics-aggregations`, and
`metrics-advanced` into individual `test()` blocks so Playwright can
distribute them across workers

**No test assertions, selectors, query logic, or validation changed.**

| File | Tests before | Tests after |
|---|---|---|
| `metrics.spec.js` | 10 (serial) | 10 (parallel) |
| `metrics-config.spec.js` | 2 (serial) | 2 (parallel) |
| `metrics-config-tabs.spec.js` | 3 (serial) | 3 (parallel) |
| `metrics-visualizations.spec.js` | 4 (serial) | 4 (parallel) |
| `metrics-promql-query-persistence.spec.js` | 6 (serial) | 6 (parallel)
|
| `metrics-table-column-order.spec.js` | 20 (serial) | 20 (parallel) |
| `metrics-queries.spec.js` | 4 mega-tests (serial) | 12 individual
(parallel) |
| `metrics-aggregations.spec.js` | 3 mega-tests (serial) | 10 individual
(parallel) |
| `metrics-advanced.spec.js` | 4 mega-tests (serial) | 12 individual
(parallel) |

**Expected impact**: ~1300s (~22 min) → ~300-400s (~5-7 min) wall-clock
time.

---

## Test plan
- [ ] All 40 tests in the 4 Sentinel-audit spec files enumerate cleanly
via `npx playwright test --list`
- [ ] Tag filters `@cipherKeys`, `@P2`, `@sdr` match expected tests
- [ ] All Metrics spec files enumerate cleanly with no serial mode
warnings
- [ ] Metrics shard CI time drops to ~5-7 min on next PR run

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 02:31:44 +00:00