Skip to content

OBSINTA-1505: improve OLS timeseries Cypress test stability - #1122

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
tremes:ols-test-improvements
Aug 13, 2026
Merged

OBSINTA-1505: improve OLS timeseries Cypress test stability#1122
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
tremes:ols-test-improvements

Conversation

@tremes

@tremes tremes commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Target first Perses panel element to avoid ambiguity when multiple panels exist. Replace cy.wait() calls with proper Cypress assertions and timeouts. Improve dashboard creation verification by checking breadcrumb and edit mode buttons instead of page load helper.

Assisted-by: Claude Code:claude-opus-4-6

Summary by CodeRabbit

  • Tests
    • Improved automated coverage for time-series panels, including chart rendering and SVG content.
    • Added validation for dashboard creation, breadcrumb navigation, and edit mode.
    • Made end-to-end checks more reliable by waiting for responses and visible UI elements instead of fixed delays.
    • Enhanced validation of adding panels to dashboards through AI responses.

Target first Perses panel element to avoid ambiguity when
multiple panels exist. Replace cy.wait() calls with proper
Cypress assertions and timeouts. Improve dashboard creation
verification by checking breadcrumb and edit mode buttons
instead of page load helper.

Signed-off-by: Tomáš Remeš <tremes@redhat.com>
Assisted-by: Claude Code:claude-opus-4-6
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci
openshift-ci Bot requested review from etmurasaki and jgbernalp August 12, 2026 10:59
@jgbernalp

Copy link
Copy Markdown
Contributor

/lgtm

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Walkthrough

The Cypress show-timeseries test now scopes chart checks, validates dashboard creation with breadcrumb and edit-mode assertions, and replaces fixed waits with response-aware Add to Dashboard interactions.

Changes

Show-timeseries validation

Layer / File(s) Summary
Test flow validation
web/cypress/e2e/coo/03.coo_lightspeed_show_timeseries.cy.ts
Perses assertions target the first panel and verify chart content. Dashboard checks validate the title, breadcrumb, visibility, and edit controls. Add to Dashboard interactions use the last AI response and confirm chat-panel closure.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: peteryurkovich

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The changed file uses Cypress describe/it, not Ginkgo. All titles are static and unchanged from HEAD^, with no dynamic values in titles.
Test Structure And Quality ✅ Passed The PR changes only a Cypress TypeScript test; no Ginkgo test code, It blocks, or cluster-wait assertions are changed, so this check is inapplicable.
Microshift Test Compatibility ✅ Passed The diff changes a Cypress TypeScript spec using describe/it, not a new Ginkgo test, and adds no MicroShift-incompatible API or resource usage.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR changes one Cypress TypeScript test only; it adds no Ginkgo Go test and makes no multi-node or HA cluster assumption.
Topology-Aware Scheduling Compatibility ✅ Passed The pull request changes only a Cypress test. It adds no deployment manifests, operator/controller code, replicas, affinity, topology spread, node selectors, or PDB scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The PR changes only one Cypress TypeScript file. It introduces no OTE binary, Go process-level setup, or stdout write; the check is not applicable.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The PR modifies an existing Cypress TypeScript test, not a new Ginkgo e2e test; added lines contain no IPv4 literals, URL construction, or external connectivity.
No-Weak-Crypto ✅ Passed The PR changes only a Cypress test's selectors, assertions, and waits; the added lines introduce no MD5, SHA1, DES, RC4, Blowfish, ECB, crypto, or secret comparison logic.
Container-Privileges ✅ Passed The HEAD^..HEAD diff changes only one Cypress TypeScript test and introduces no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, root, or allowPrivilegeEscalation configuration.
No-Sensitive-Data-In-Logs ✅ Passed The changed Cypress test adds no console, cy.log, or logger calls and introduces no passwords, tokens, API keys, PII, session IDs, hostnames, or customer data.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the OLS timeseries Cypress test and its stability improvements.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/cypress/e2e/coo/03.coo_lightspeed_show_timeseries.cy.ts`:
- Around line 157-165: Update the Add to dashboard interaction in the aiResponse
chain to expand the collapsed tool-call accordion first, then assert the
selected control is visible and enabled before clicking it. Remove force:true
and use a normal click so Cypress validates user actionability.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: b4cf2f11-5033-4cfa-98b5-948c370ed48d

📥 Commits

Reviewing files that changed from the base of the PR and between 4871cd7 and ec58ca9.

📒 Files selected for processing (1)
  • web/cypress/e2e/coo/03.coo_lightspeed_show_timeseries.cy.ts

Comment on lines +157 to +165
// Wait for the "Add to dashboard" button to appear once the streaming response stabilizes.
// The AI may return multiple show_timeseries tool calls, so pick the first one.
// The button may be inside a collapsed tool-call accordion in the OLS chat,
// so use force:true to click it regardless of visibility.
cy.get(SEL.aiResponse).last().find(SEL.addToDashboard).first().click({ force: true });
cy.get(SEL.aiResponse, { timeout: OLS_RESPONSE_TIMEOUT })
.last()
.find(SEL.addToDashboard, { timeout: OLS_RESPONSE_TIMEOUT })
.first()
.click({ force: true });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- changed-file summary ---'
git diff --stat
printf '%s\n' '--- target test ---'
cat -n web/cypress/e2e/coo/03.coo_lightspeed_show_timeseries.cy.ts | sed -n '1,210p'
printf '%s\n' '--- selector definitions and related accordion/button usage ---'
rg -n -C 3 "addToDashboard|aiResponse|accordion|Add to dashboard|force: true" web/cypress web --glob '*.{ts,tsx}' | head -n 300

Repository: openshift/monitoring-plugin

Length of output: 32089


🌐 Web query:

openshift-lightspeed Add to dashboard aria-label collapsed accordion show_timeseries OLS plugin

💡 Result:

The OpenShift Lightspeed (OLS) plugin for the OpenShift console includes functionality to visualize tool calls, such as the show_timeseries tool, which allows users to render time-series charts directly within the AI chat interface and add them to Perses dashboards [1][2]. Technical implementation details for these UI components include: - ShowTimeseries Component: This component is implemented in the OLS console plugin to handle tool visualization [1]. It uses helper functions and wrappers to manage the integration, including an AddToDashboardButton [1]. - Accessible UI Controls: Development work has specifically addressed accessibility and interaction patterns for these controls [1]. This includes setting descriptive aria-labels (e.g., "Add to dashboard") for action buttons and ensuring that decorative icons (such as ViewGridPlusIcon) are properly hidden from screen readers using aria-hidden={true} [1]. - Dashboard Integration: The "Add to dashboard" feature allows users to take a chart rendered by OLS and persist it into a new or existing Perses dashboard [2]. The integration workflow involves sending a prompt to OLS, receiving the chart, using the UI control to trigger the addition, and verifying the panel's persistence [2]. - Development and Testing: These components are part of the lightspeed-console plugin repository [3][4]. End-to-end tests for the show_timeseries integration are maintained within the plugin's Cypress test suite to ensure the "Add to dashboard" workflow functions correctly across dashboard creation and saving scenarios [2]. Developers working with these components should refer to the web/src/components/ols-tool-ui/ directory within the lightspeed-console project for the source implementation [1].

Citations:


🏁 Script executed:

#!/bin/bash
set -e
python3 - <<'PY'
import json, urllib.request

def get(url):
    req = urllib.request.Request(url, headers={"Accept": "application/vnd.github+json", "User-Agent": "review-verifier"})
    with urllib.request.urlopen(req, timeout=20) as r:
        return json.load(r)

for url in [
    "https://api.github.com/repos/openshift/monitoring-plugin/pulls/996/files?per_page=100",
    "https://api.github.com/repos/openshift/monitoring-plugin/pulls/797/files?per_page=100",
]:
    print(f"--- {url} ---")
    try:
        data = get(url)
    except Exception as e:
        print(type(e).__name__, e)
        continue
    for f in data:
        name = f.get("filename", "")
        if "lightspeed" in name.lower() or "coo_lightspeed" in name.lower() or "cypress" in name.lower():
            print(name, f.get("status"), f.get("additions"), f.get("deletions"))
            patch = f.get("patch")
            if patch:
                print(patch[:12000])
PY

Repository: openshift/monitoring-plugin

Length of output: 641


🏁 Script executed:

#!/bin/bash
set -e
python3 - <<'PY'
import json, urllib.request

def get(url):
    req = urllib.request.Request(url, headers={"Accept": "application/vnd.github+json", "User-Agent": "review-verifier"})
    with urllib.request.urlopen(req, timeout=20) as r:
        return json.load(r)

base = "https://api.github.com/repos/openshift/lightspeed-console/contents/web/src/components/ols-tool-ui"
try:
    entries = get(base)
    for e in entries:
        print(e["type"], e["path"])
except Exception as e:
    print(type(e).__name__, e)
PY

Repository: openshift/monitoring-plugin

Length of output: 309


🏁 Script executed:

#!/bin/bash
set -e
python3 - <<'PY'
import json, urllib.request

def get(url):
    req = urllib.request.Request(url, headers={"Accept": "application/vnd.github+json", "User-Agent": "review-verifier"})
    with urllib.request.urlopen(req, timeout=20) as r:
        return json.load(r)

url = "https://api.github.com/repos/openshift/lightspeed-console/git/trees/main?recursive=1"
try:
    data = get(url)
    for item in data.get("tree", []):
        path = item.get("path", "")
        if any(x in path.lower() for x in ("showtimeseries", "ols-tool-ui", "tool-ui", "toolcall", "accordion")):
            print(path)
except Exception as e:
    print(type(e).__name__, e)
PY

Repository: openshift/monitoring-plugin

Length of output: 309


🏁 Script executed:

#!/bin/bash
set -e
for url in \
  'https://api.github.com/repos/openshift/monitoring-plugin/pulls/996/files?per_page=100' \
  'https://api.github.com/repos/openshift/monitoring-plugin/pulls/797/files?per_page=100' \
  'https://api.github.com/repos/openshift/lightspeed-console/git/trees/main?recursive=1'
do
  echo "--- $url ---"
  curl -ksS -H 'Accept: application/vnd.github+json' -A review-verifier "$url" |
    python3 -c '
import json,sys
x=json.load(sys.stdin)
if isinstance(x,list):
  for f in x:
    n=f.get("filename","")
    if any(s in n.lower() for s in ("lightspeed","coo_lightspeed","cypress")):
      print(n, f.get("status"), f.get("additions"), f.get("deletions"))
      if f.get("patch"): print(f["patch"][:12000])
elif isinstance(x,dict):
  for i in x.get("tree",[]):
    p=i.get("path","")
    if any(s in p.lower() for s in ("showtimeseries","ols-tool-ui","tool-ui","toolcall","accordion")):
      print(p)
'
done

Repository: openshift/monitoring-plugin

Length of output: 446


🌐 Web query:

site:github.com/openshift/lightspeed-console "AddToDashboardButton" "show_timeseries"

💡 Result:

There is no evidence in the provided search results to support the existence of a component or function named AddToDashboardButton with a show_timeseries parameter within the OpenShift Lightspeed Console project. The available documentation for the OpenShift Lightspeed Console plugin focuses on its integration as an AI assistant, managing conversation state, and extension patterns for opening the OLS UI [1][2][3][4]. There is no mention of dashboard-specific buttons or time-series display functionality associated with that specific naming convention in the retrieved source materials [1][5][2][6][3][7][4].

Citations:


🏁 Script executed:

#!/bin/bash
set -e
url='https://api.github.com/repos/openshift/lightspeed-console/git/trees/main?recursive=1'
curl -ksS -H 'Accept: application/vnd.github+json' -A review-verifier "$url" |
  python3 -c '
import json,sys
x=json.load(sys.stdin)
for i in x.get("tree",[]):
    p=i.get("path","")
    if any(s in p.lower() for s in ("showtimeseries","ols-tool-ui","tool-ui","toolcall","accordion")):
        print(p)
'

Repository: openshift/monitoring-plugin

Length of output: 165


🏁 Script executed:

#!/bin/bash
set -e
for url in \
  'https://github.com/openshift/monitoring-plugin/pull/996.diff' \
  'https://github.com/openshift/monitoring-plugin/pull/797.diff'
do
  echo "--- $url ---"
  curl -ksSL "$url" | rg -n -C 4 \
    '03\.coo_lightspeed_show_timeseries|Add to dashboard|force: true|accordion|aiResponse' \
    | head -n 250 || true
done

Repository: openshift/monitoring-plugin

Length of output: 4083


🌐 Web query:

Cypress click force true bypasses actionability checks hidden disabled covered documentation

💡 Result:

In Cypress, passing { force: true } to an action command like.click acts as an "escape hatch" that bypasses Cypress's built-in actionability checks [1][2]. By default, Cypress performs several checks before an action to ensure the element can be interacted with as a real user would; using { force: true } tells Cypress to skip these checks and fire the event regardless of the element's state [1][3][4]. When you use { force: true }, Cypress will NOT perform the following checks [1][2]: - Ensure the element is visible [1][2] - Ensure the element is not covered by another element [1][2] - Ensure the element is not disabled [1][2] - Ensure the element is not animating [1][2] - Ensure the element is not detached from the DOM [1][2] - Ensure the element is not read-only [1][2] - Scroll the element into view [1][2] - Fire the event at a descendant [1][2] While this allows you to trigger events on elements that would otherwise fail these checks, it is generally discouraged because it can mask underlying issues where an element is truly inaccessible to a user (e.g., a button that is hidden or disabled) [3][5][4]. One notable exception is that passing { force: true } to the.select command does not override actionability checks for selecting a disabled or an option within a disabled element [1][2]. Citations: 1: https://docs.cypress.io/app/core-concepts/interacting-with-elements 2: https://docs.cypress.io/llm/markdown/app/core-concepts/interacting-with-elements.md 3: https://www.capocaccia.dev/posts/quickSnippetsForce 4: https://docs.cypress.io/app/references/error-messages 5: https://github.com/cypress-io/eslint-plugin-cypress/blob/HEAD/docs/rules/no-force.md Expand the tool-call accordion before clicking “Add to dashboard”. After the accordion is expanded, assert be.visible and be.enabled, then use .click() without { force: true }. Forced clicks bypass Cypress actionability checks and can pass without proving that a user can use the control. 🤖 Prompt for AI Agents Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/cypress/e2e/coo/03.coo_lightspeed_show_timeseries.cy.ts` around lines 157 - 165, Update the Add to dashboard interaction in the aiResponse chain to expand the collapsed tool-call accordion first, then assert the selected control is visible and enabled before clicking it. Remove force:true and use a normal click so Cypress validates user actionability.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 12, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-agnostic-cmo
/test e2e-management-api
/test e2e-monitoring

@openshift-ci

openshift-ci Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jgbernalp, tremes

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 12, 2026
@etmurasaki

Copy link
Copy Markdown
Contributor

/label qe-approved

@openshift-ci openshift-ci Bot added the qe-approved Signifies that QE has signed off on this PR label Aug 12, 2026
@tremes tremes changed the title test: improve OLS timeseries Cypress test stability OBSINTA-1505: improve OLS timeseries Cypress test stability Aug 12, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 12, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 12, 2026

Copy link
Copy Markdown

@tremes: This pull request references OBSINTA-1505 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Target first Perses panel element to avoid ambiguity when multiple panels exist. Replace cy.wait() calls with proper Cypress assertions and timeouts. Improve dashboard creation verification by checking breadcrumb and edit mode buttons instead of page load helper.

Assisted-by: Claude Code:claude-opus-4-6

Summary by CodeRabbit

  • Tests
  • Improved automated coverage for time-series panels, including chart rendering and SVG content.
  • Added validation for dashboard creation, breadcrumb navigation, and edit mode.
  • Made end-to-end checks more reliable by waiting for responses and visible UI elements instead of fixed delays.
  • Enhanced validation of adding panels to dashboards through AI responses.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@etmurasaki

Copy link
Copy Markdown
Contributor

/test e2e-management-api

@openshift-ci

openshift-ci Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@etmurasaki: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

/test e2e-agnostic-cmo
/test e2e-monitoring
/test go-tests
/test images
/test lint
/test okd-scos-images
/test test-frontend-unit
/test translations
/test verify-deps

The following commands are available to trigger optional jobs:

/test e2e-alerts
/test e2e-aws-ovn
/test e2e-aws-ovn-upgrade
/test e2e-coo
/test e2e-dashboards
/test e2e-hypershift-conformance
/test e2e-incidents
/test e2e-metrics
/test e2e-monitoring-bvt
/test e2e-monitoring-dev
/test e2e-monitoring-reg
/test e2e-perses
/test e2e-perses-dev
/test e2e-perses-ivt
/test e2e-virtualization
/test okd-scos-e2e-aws-ovn
/test security

Use /test all to run the following jobs that were automatically triggered:

pull-ci-openshift-monitoring-plugin-main-go-tests
pull-ci-openshift-monitoring-plugin-main-images
pull-ci-openshift-monitoring-plugin-main-lint
pull-ci-openshift-monitoring-plugin-main-okd-scos-images
pull-ci-openshift-monitoring-plugin-main-security
pull-ci-openshift-monitoring-plugin-main-test-frontend-unit
pull-ci-openshift-monitoring-plugin-main-translations
pull-ci-openshift-monitoring-plugin-main-verify-deps
Details

In response to this:

/test e2e-management-api

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@etmurasaki

Copy link
Copy Markdown
Contributor

/override ci/prow/e2e-management-api

@openshift-ci

openshift-ci Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@etmurasaki: Overrode contexts on behalf of etmurasaki: ci/prow/e2e-management-api

Details

In response to this:

/override ci/prow/e2e-management-api

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci

openshift-ci Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@tremes: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 9e9ad7e into openshift:main Aug 13, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants