Conversation
Signed-off-by: Swarup Ghosh <swghosh@redhat.com>
📝 WalkthroughWalkthroughThis PR replaces ZTWIM-specific e2e test generation commands with a generic OpenShift operator e2e test generator. The new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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--outputoption.The current parsing using
sedandawkcould fail with edge cases (e.g., if--outputappears 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>&1redirects stderr twice. The&>already redirects both stdout and stderr, so2>&1is 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; thenSame 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. |
There was a problem hiding this comment.
🧩 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 -30Repository: shiftweek/oape-ai-e2e
Length of output: 523
🏁 Script executed:
sed -n '119p;134p;145p' plugins/oape/skills/e2e-test-generator/SKILL.mdRepository: 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.
| 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.
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
/oape:e2e-generatecommand to generate end-to-end test artifacts for OpenShift operators based on repository analysis and code changes.Documentation
Chores