Skip to content

Conversation

@DavidRajnoha
Copy link
Contributor

Summary

Adds AI commands and links incident detection testing documentation to support automated generation and refactoring of Cypress regression tests for the Incidents page.

Changes

Testing Documentation Submodule

  • Add test-docs submodule containing test flows and requirements documentation
  • Provides structured test specifications for AI-driven test generation

AI Commands (.cursor/commands/)

  • generate-regression-test.md - Generates Cypress regression tests from test documentation
    • Parses test requirements and creates complete test files
    • Manages fixture creation and validation
    • Follows established page object patterns
  • refactor-regression-test.md - Refactors existing tests for improved readability
    • Extracts duplicate code into helper functions
    • Makes test bodies read like user stories
    • Suggests page object additions for reusability

Testing Guidelines (.cursor/rules/)

  • incidents-testing-guidelines.mdc - Development standards for Incidents page tests
    • E2E testing philosophy (comprehensive user flows over isolated tests)
    • Page Object Model usage patterns
    • Fixture management and code quality standards

Benefits

  • Consistency: Standardized test structure across all regression tests
  • Efficiency: Automated test generation from documentation
  • Quality: Enforces e2e best practices and maintainability
  • Clarity: Clear examples and patterns to follow

AI-Usage

Co-developed with Cursor using Claude 4.5 model.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 31, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 31, 2025

@DavidRajnoha: This pull request references OBSINTA-858 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 task to target the "4.21.0" version, but no target version was set.

In response to this:

Summary

Adds AI commands and links incident detection testing documentation to support automated generation and refactoring of Cypress regression tests for the Incidents page.

Changes

Testing Documentation Submodule

  • Add test-docs submodule containing test flows and requirements documentation
  • Provides structured test specifications for AI-driven test generation

AI Commands (.cursor/commands/)

  • generate-regression-test.md - Generates Cypress regression tests from test documentation
  • Parses test requirements and creates complete test files
  • Manages fixture creation and validation
  • Follows established page object patterns
  • refactor-regression-test.md - Refactors existing tests for improved readability
  • Extracts duplicate code into helper functions
  • Makes test bodies read like user stories
  • Suggests page object additions for reusability

Testing Guidelines (.cursor/rules/)

  • incidents-testing-guidelines.mdc - Development standards for Incidents page tests
  • E2E testing philosophy (comprehensive user flows over isolated tests)
  • Page Object Model usage patterns
  • Fixture management and code quality standards

Benefits

  • Consistency: Standardized test structure across all regression tests
  • Efficiency: Automated test generation from documentation
  • Quality: Enforces e2e best practices and maintainability
  • Clarity: Clear examples and patterns to follow

AI-Usage

Co-developed with Cursor using Claude 4.5 model.

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.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 31, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 31, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 31, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

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

@DavidRajnoha DavidRajnoha marked this pull request as ready for review October 31, 2025 14:45
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 31, 2025
@DavidRajnoha
Copy link
Contributor Author

/retest

@etmurasaki
Copy link
Contributor

@DavidRajnoha I would love to learn/get to know more about your thought process, criteria, templates, examples, to create this kind of documentation!

@jgbernalp
Copy link
Contributor

/retest

1 similar comment
@zhuje
Copy link
Contributor

zhuje commented Nov 24, 2025

/retest

@zhuje
Copy link
Contributor

zhuje commented Nov 25, 2025

@DavidRajnoha The tests are failing because of a permission issue with the URL you added in the .gitmodule, [email protected]:drajnoha/cat-test-docs.git. When I've used gitlab.cee.redhat, it requires vpn, not sure if you can configure the CI pipeline to use some SSH key to allow it access. Alternatively, can your submodule be public?

 create mode 100644 .gitmodules
 create mode 160000 web/cypress/fixtures/incidents/test-docs
$ PWD=/home/prow/go/src/github.com/openshift/monitoring-plugin  **git submodule update --init --recursive** (runtime: 221.634269ms)
Submodule 'web/cypress/fixtures/incidents/test-docs' ([email protected]:drajnoha/cat-test-docs.git) registered for path 'web/cypress/fixtures/incidents/test-docs'
Cloning into '/home/prow/go/src/github.com/openshift/monitoring-plugin/web/cypress/fixtures/incidents/test-docs'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
**fatal: clone of '[email protected]:drajnoha/cat-test-docs.git' into submodule path** '/home/prow/go/src/github.com/openshift/monitoring-plugin/web/cypress/fixtures/incidents/test-docs' failed
Failed to clone 'web/cypress/fixtures/incidents/test-docs'. Retry scheduled
Cloning into '/home/prow/go/src/github.com/openshift/monitoring-plugin/web/cypress/fixtures/incidents/test-docs'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:drajnoha/cat-test-docs.git' into submodule path '/home/prow/go/src/github.com/openshift/monitoring-plugin/web/cypress/fixtures/incidents/test-docs' failed
Failed to clone 'web/cypress/fixtures/incidents/test-docs' a second time, aborting
# Error: exit status 1
# Final SHA: 
# Total runtime: 0s

@DavidRajnoha
Copy link
Contributor Author

@zhuje Our intention was to keep this repository private, as there is a possibility of including customer specific information there. However, we will discuss this within a team and see whether it would be viable to make it also public.

@zhuje
Copy link
Contributor

zhuje commented Nov 25, 2025

@DavidRajnoha Sounds good! Let us know what your team decides.
You probably already know this, but the other solution might be to configure the CI to use a secret/key to access gitlab.cee.redhat.com.

Here are the CI docs: https://docs.ci.openshift.org/.
Here's the monitoring-plugin CI configurations https://github.com/openshift/release/tree/master/ci-operator/config/openshift/monitoring-plugin

@DavidRajnoha DavidRajnoha force-pushed the cypress-incidents-cursor-commands branch from 75400f2 to 827a3b6 Compare December 2, 2025 12:53
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 2, 2025
@DavidRajnoha DavidRajnoha force-pushed the cypress-incidents-cursor-commands branch from 827a3b6 to c1c3590 Compare December 2, 2025 13:10
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 2, 2025
@DavidRajnoha DavidRajnoha force-pushed the cypress-incidents-cursor-commands branch 2 times, most recently from 3409711 to 935471c Compare December 2, 2025 13:33
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 2, 2025

@DavidRajnoha: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-aws-ovn 75400f2 link false /test okd-scos-e2e-aws-ovn

Full PR test history. Your PR dashboard.

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.

@DavidRajnoha DavidRajnoha force-pushed the cypress-incidents-cursor-commands branch from 935471c to 17900d0 Compare December 2, 2025 13:47
@DavidRajnoha
Copy link
Contributor Author

@zhuje I have decided to adopt a slightly different approach. As the submodule is needed only when developing incident detection tests (small portion of devs pulling this), I have removed the submodule from the default .gitmodules and added a script that can set it up locally when needed. In this way, the CI has no issues with not being able to clone it.

@DavidRajnoha DavidRajnoha force-pushed the cypress-incidents-cursor-commands branch from 17900d0 to e4d8612 Compare December 2, 2025 13:55
@etmurasaki
Copy link
Contributor

@jgbernalp not sure if you also want to take a look at this approach, from last time you, @svetsa-rh were commenting about gitlab, etc.

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

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants