Skip to content

Adapt ztiwm e2e generator generically#14

Merged
swghosh merged 1 commit intomainfrom
e2e-generator
Feb 16, 2026
Merged

Adapt ztiwm e2e generator generically#14
swghosh merged 1 commit intomainfrom
e2e-generator

Conversation

@swghosh
Copy link
Collaborator

@swghosh swghosh commented Feb 16, 2026

Adapt the ZTIWM e2e generator generically based on: cert-manager-operator, external-secrets-operator and sscsi-operator too.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added /oape:e2e-generate command to generate end-to-end test artifacts for OpenShift operators based on repository analysis and code changes.
    • Extended support to work with any OpenShift operator repository, not limited to specific projects.
  • Documentation

    • Added comprehensive e2e test patterns and examples for multiple testing frameworks.
    • Added detailed guidance on test scenario generation and operator testing workflows.
  • Chores

    • Removed legacy project-specific test generation commands and documentation.

Signed-off-by: Swarup Ghosh <swghosh@redhat.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

📝 Walkthrough

Walkthrough

This PR replaces ZTWIM-specific e2e test generation commands with a generic OpenShift operator e2e test generator. The new /oape:e2e-generate command supports multiple operator repositories through framework detection and repository discovery, removing four ZTWIM-specific commands and introducing comprehensive documentation, patterns, and fixture templates.

Changes

Cohort / File(s) Summary
Root Documentation
AGENTS.md, plugins/oape/README.md
Added /oape:e2e-generate command reference and new test repository entry; updated README from ZTWIM-specific to generic OpenShift operator e2e test generation documentation with framework detection and discovery-based approach.
Generic E2E Command Documentation
plugins/oape/commands/e2e-generate.md
New comprehensive command documentation describing a 7-phase workflow (prechecks, framework detection, diff analysis, test-case generation, execution-steps generation, code generation, output summary) for generating e2e test artifacts.
Deleted ZTWIM Commands
plugins/oape/commands/ztwim-generate-*.md
Removed 4 ZTWIM-specific command documentation files: ztwim-generate-all.md, ztwim-generate-e2e-from-pr.md, ztwim-generate-execution-steps.md, ztwim-generate-from-pr.md.
E2E Test Generator Documentation & Patterns
plugins/oape/e2e-test-generator/docs/e2e-patterns.md, plugins/oape/e2e-test-generator/fixtures/*
New documentation describing generic e2e patterns for both Ginkgo (controller-runtime) and Bash (library-go) frameworks, with fixture files for important test scenarios and sample test templates in both Go and Bash styles.
Skill Specifications
plugins/oape/skills/e2e-test-generator/SKILL.md, plugins/oape/skills/ztwim-test-case-generator/SKILL.md
Added new E2E Test Generator skill specification defining persona, framework detection logic, discovery protocol, scenario classification, and output guidelines; removed deprecated ZTWIM Test Case Generator skill specification.
Deleted ZTWIM Test Generator Assets
plugins/oape/ztwim-test-generator/docs/*, plugins/oape/ztwim-test-generator/fixtures/*
Removed ZTWIM-specific documentation (e2e-structure.md), fixtures (e2e-important-scenarios.md, e2e-sample_test.go.example, operator-install.yaml, ztwim-stack.yaml) as these are replaced by generic e2e-test-generator equivalents.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Adapt ztiwm e2e generator generically' accurately reflects the main objective of the PR: adapting the ZTIWM-specific e2e generator to work generically for multiple operators.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch e2e-generator

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@plugins/oape/skills/e2e-test-generator/SKILL.md`:
- Line 119: Update SKILL.md to correct three incorrect fixture links that
currently use ../e2e-test-generator/fixtures/ (which resolves to the same
directory) so they point to the real fixtures directory two levels up: replace
the three occurrences (lines referencing e2e-important-scenarios.md and the
other two fixture references) to use ../../e2e-test-generator/fixtures/ instead;
check the references in SKILL.md within the e2e-test-generator skill text to
ensure all three links are updated.
🧹 Nitpick comments (2)
plugins/oape/commands/e2e-generate.md (2)

46-50: Fragile argument parsing for --output option.

The current parsing using sed and awk could fail with edge cases (e.g., if --output appears in the base branch name, or with equals sign vs space). Consider a more robust approach.

Proposed fix using positional parsing
 # Parse optional --output
 OUTPUT_DIR="output"
-if echo "$@" | grep -q '\-\-output'; then
-  OUTPUT_DIR=$(echo "$@" | sed 's/.*--output[ =]*//' | awk '{print $1}')
-fi
+shift  # Remove base branch from args
+while [[ $# -gt 0 ]]; do
+  case "$1" in
+    --output)
+      OUTPUT_DIR="$2"
+      shift 2
+      ;;
+    --output=*)
+      OUTPUT_DIR="${1#*=}"
+      shift
+      ;;
+    *)
+      echo "Unknown option: $1"
+      exit 1
+      ;;
+  esac
+done

85-85: Redundant stderr redirection.

&> /dev/null 2>&1 redirects stderr twice. The &> already redirects both stdout and stderr, so 2>&1 is unnecessary.

Proposed fix
-if ! git rev-parse --is-inside-work-tree &> /dev/null 2>&1; then
+if ! git rev-parse --is-inside-work-tree &> /dev/null; then

Same applies to line 126:

-if ! git rev-parse --verify "$BASE_BRANCH" &> /dev/null 2>&1; then
+if ! git rev-parse --verify "$BASE_BRANCH" &> /dev/null; then

9. **OperatorCondition Upgradeable**: True when healthy, False when degraded, recovery
10. **Management state**: Managed/Unmanaged/Removed (if supported)

See [fixtures/e2e-important-scenarios.md](../e2e-test-generator/fixtures/e2e-important-scenarios.md) for detailed scenario descriptions.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the directory structure and correct relative paths
echo "=== File location ==="
fd -t f "SKILL.md" --full-path | grep -E "skills/e2e-test-generator"

echo ""
echo "=== Fixtures location ==="
fd -t f "e2e-important-scenarios.md" --full-path

echo ""
echo "=== Directory structure ==="
find plugins/oape -type d | sort | head -30

Repository: shiftweek/oape-ai-e2e

Length of output: 523


🏁 Script executed:

sed -n '119p;134p;145p' plugins/oape/skills/e2e-test-generator/SKILL.md

Repository: shiftweek/oape-ai-e2e

Length of output: 493


Incorrect relative paths to fixtures.

The relative path ../e2e-test-generator/fixtures/ is incorrect in this file. Since SKILL.md is at plugins/oape/skills/e2e-test-generator/, using ../e2e-test-generator/ resolves to plugins/oape/skills/e2e-test-generator/ (back to itself). The fixtures are actually at plugins/oape/e2e-test-generator/fixtures/, so all three references on lines 119, 134, and 145 should use ../../e2e-test-generator/fixtures/ instead.

Fixes
-See [fixtures/e2e-important-scenarios.md](../e2e-test-generator/fixtures/e2e-important-scenarios.md) for detailed scenario descriptions.
+See [fixtures/e2e-important-scenarios.md](../../e2e-test-generator/fixtures/e2e-important-scenarios.md) for detailed scenario descriptions.
-See [fixtures/e2e-sample-controller-runtime_test.go.example](../e2e-test-generator/fixtures/e2e-sample-controller-runtime_test.go.example) for reference.
+See [fixtures/e2e-sample-controller-runtime_test.go.example](../../e2e-test-generator/fixtures/e2e-sample-controller-runtime_test.go.example) for reference.
-See [fixtures/e2e-sample-library-go_test.sh.example](../e2e-test-generator/fixtures/e2e-sample-library-go_test.sh.example) for reference.
+See [fixtures/e2e-sample-library-go_test.sh.example](../../e2e-test-generator/fixtures/e2e-sample-library-go_test.sh.example) for reference.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
See [fixtures/e2e-important-scenarios.md](../e2e-test-generator/fixtures/e2e-important-scenarios.md) for detailed scenario descriptions.
See [fixtures/e2e-important-scenarios.md](../../e2e-test-generator/fixtures/e2e-important-scenarios.md) for detailed scenario descriptions.
🤖 Prompt for AI Agents
In `@plugins/oape/skills/e2e-test-generator/SKILL.md` at line 119, Update SKILL.md
to correct three incorrect fixture links that currently use
../e2e-test-generator/fixtures/ (which resolves to the same directory) so they
point to the real fixtures directory two levels up: replace the three
occurrences (lines referencing e2e-important-scenarios.md and the other two
fixture references) to use ../../e2e-test-generator/fixtures/ instead; check the
references in SKILL.md within the e2e-test-generator skill text to ensure all
three links are updated.

@swghosh swghosh merged commit 5de13f5 into main Feb 16, 2026
2 checks passed
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