Skip to content

Add e2e test coverage spec for troubleshooting mode scenarios#2983

Open
JoaoFula wants to merge 1 commit into
openshift:mainfrom
JoaoFula:spec-changes-for-troubleshooting-tests
Open

Add e2e test coverage spec for troubleshooting mode scenarios#2983
JoaoFula wants to merge 1 commit into
openshift:mainfrom
JoaoFula:spec-changes-for-troubleshooting-tests

Conversation

@JoaoFula

@JoaoFula JoaoFula commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change

Related Tickets & Documents

  • Related Issue #
  • Closes #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

Summary by CodeRabbit

  • Documentation
    • Added guidance for end-to-end test coverage in troubleshooting mode.
    • Documented how scenario-based tests run against a live OpenShift cluster, including required access, test flow, and cleanup steps.
    • Noted where scenario definitions and test coverage live, plus a planned next step for response-quality evaluation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci openshift-ci Bot requested review from onmete and tisnik July 2, 2026 14:23
@openshift-ci

openshift-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign onmete for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This change adds a documentation section to agent-modes.md describing end-to-end test coverage for mode=troubleshooting, covering the cluster_scenario pytest marker, live-cluster requirements, test flow, scenario locations, and a planned lightspeed-eval quality evaluation follow-on.

Changes

Documentation Update

Layer / File(s) Summary
Add E2E test coverage section
.ai/spec/what/agent-modes.md
Documents troubleshooting mode E2E tests, gating marker, cluster requirements, test flow, scenario locations, and planned lightspeed-eval integration.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Estimated code review effort

1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the new end-to-end test coverage spec for troubleshooting mode scenarios.
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.
✨ 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 @.ai/spec/what/agent-modes.md:
- Around line 172-180: The troubleshooting test coverage description is out of
sync with the current code layout: it references a `cluster_scenario`-gated
`tests/e2e/test_troubleshooting_scenarios.py`, while the actual troubleshooting
eval entrypoint is still the commented-out `@pytest.mark.lseval` placeholder in
`tests/e2e/evaluation/test_lseval_troubleshooting.py`. Update the spec section
to match the current implementation and use the existing
`tests/e2e/evaluation/test_lseval_troubleshooting.py`/`@pytest.mark.lseval`
symbols, or explicitly label the scenario-based coverage as planned future work
so the documentation does not point to a non-existent test entrypoint.
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 30597a7e-4d3c-4701-8c94-c27f68f0acaf

📥 Commits

Reviewing files that changed from the base of the PR and between e2a260e and 7d6f2d5.

📒 Files selected for processing (1)
  • .ai/spec/what/agent-modes.md

Comment on lines +172 to +180
Scenario-based e2e tests verify that `mode=troubleshooting` produces structurally correct responses when diagnosing real cluster problems. Tests are gated behind the `cluster_scenario` pytest marker and require `oc` access to a live OpenShift cluster.

Each test:
1. Injects a broken cluster state via setup script
2. Queries OLS with `mode=troubleshooting`
3. Asserts HTTP 200, non-empty response, and presence of problem-domain keywords
4. Cleans up cluster state

Scenarios are defined under `eval/troubleshooting/scenarios/`. The test module is `tests/e2e/test_troubleshooting_scenarios.py`.

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
rg -n "cluster_scenario|lseval|test_troubleshooting_scenarios|test_lseval_troubleshooting" .ai/spec/what tests/e2e

Repository: openshift/lightspeed-service

Length of output: 5052


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n--- .ai/spec/what/agent-modes.md (lines 168-183) ---\n'
sed -n '168,183p' .ai/spec/what/agent-modes.md

printf '\n--- tests/e2e/evaluation/test_lseval_troubleshooting.py (lines 150-210) ---\n'
sed -n '150,210p' tests/e2e/evaluation/test_lseval_troubleshooting.py

printf '\n--- tests/e2e/pytest.ini ---\n'
sed -n '1,80p' tests/e2e/pytest.ini

Repository: openshift/lightspeed-service

Length of output: 3693


Clarify whether troubleshooting coverage is current or planned.
This section points to a cluster_scenario-gated tests/e2e/test_troubleshooting_scenarios.py, but the troubleshooting eval is still a commented-out @pytest.mark.lseval placeholder in tests/e2e/evaluation/test_lseval_troubleshooting.py. Update the spec to match the current layout, or mark this as planned future work so readers do not follow a non-existent entrypoint.

🤖 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 @.ai/spec/what/agent-modes.md around lines 172 - 180, The troubleshooting
test coverage description is out of sync with the current code layout: it
references a `cluster_scenario`-gated
`tests/e2e/test_troubleshooting_scenarios.py`, while the actual troubleshooting
eval entrypoint is still the commented-out `@pytest.mark.lseval` placeholder in
`tests/e2e/evaluation/test_lseval_troubleshooting.py`. Update the spec section
to match the current implementation and use the existing
`tests/e2e/evaluation/test_lseval_troubleshooting.py`/`@pytest.mark.lseval`
symbols, or explicitly label the scenario-based coverage as planned future work
so the documentation does not point to a non-existent test entrypoint.

@openshift-ci

openshift-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown

@JoaoFula: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant