Skip to content

feat: add run-e2e-test shared skill for interactive e2e test replay#10143

Merged
nilo19 merged 3 commits intokubernetes-sigs:masterfrom
nilo19:e2e-skills
Apr 10, 2026
Merged

feat: add run-e2e-test shared skill for interactive e2e test replay#10143
nilo19 merged 3 commits intokubernetes-sigs:masterfrom
nilo19:e2e-skills

Conversation

@nilo19
Copy link
Copy Markdown
Contributor

@nilo19 nilo19 commented Apr 4, 2026

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds a new shared skill under .agents/skills/run-e2e-test/ that enables AI agents to interactively replay cloud-provider-azure e2e tests against a live cluster using kubectl and az CLI commands.

The skill workflow:

  1. Confirm cluster context (kube context + Azure subscription)
  2. Parse a Go e2e test file — extract Ginkgo structure (Describe/When/Context/It/BeforeEach/AfterEach) into a structured replay plan
  3. Present the plan for user review
  4. Execute setup (namespace, deployment, Azure resources)
  5. Execute test steps with interactive assertion handling
  6. Cleanup
  7. Report pass/fail results

Key features:

  • analyze_test.py — regex-based Go test parser that translates SDK calls to CLI equivalents; handles nested Describe blocks, When/Context scoping, and annotation resolution via a static map of 30+ Azure service annotations
  • check_context.py — displays current kube context + Azure subscription for user confirmation
  • patterns.md — comprehensive CLI command reference (396 lines) with manifest templates, polling patterns, and verification commands
  • INDEX.md — generated keyword index for token-efficient partial reads of patterns.md
  • gen_patterns_index.py — keeps INDEX.md line numbers in sync with patterns.md
  • Error handling with 5 error categories, retry policy (K8s/Azure 409/429/5xx), diagnostics table, resource tracking, and a priority-ordered failure flow waterfall
  • Interactive pause on assertion failure with 4 options: continue, pause for manual investigation, abort, or re-check
  • Batch mode escape after repeated failures to avoid prompt fatigue

Validated against all 12 e2e test files in tests/e2e/ (network, node, auth, autoscaling).

Which issue(s) this PR fixes:

NONE

Special notes for your reviewer:

  • The analyze_test.py parser uses regex-based pattern matching (not a full Go parser). It handles the standard Ginkgo patterns used in this repo but may need manual interpretation for unusual test structures.
  • All emitted CLI commands use POSIX-portable sed (no GNU grep -oP) for macOS compatibility.
  • The INDEX.md is generated — run python3 scripts/gen_patterns_index.py after editing patterns.md to keep line numbers in sync.

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


Add a new shared skill that parses Go e2e test files from tests/e2e/,
translates each step to kubectl and az CLI commands, and interactively
replays the test against a live Kubernetes+Azure cluster.

The skill includes:
- analyze_test.py: Ginkgo test parser that extracts Describe/When/
  Context/It/BeforeEach/AfterEach structure into a structured replay
  plan with kubectl and az CLI equivalents
- check_context.py: displays current kube context and Azure subscription
  for user confirmation before execution
- patterns.md: comprehensive reference mapping Go e2e test patterns to
  CLI commands with manifest templates and polling patterns
- INDEX.md: generated keyword index for token-efficient partial reads
  of patterns.md
- gen_patterns_index.py: generator script to keep INDEX.md line numbers
  in sync with patterns.md

/kind feature
@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. release-note-none Denotes a PR that doesn't merit a release note. labels Apr 4, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nilo19

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 4, 2026
@github-actions github-actions Bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Apr 4, 2026
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 4, 2026
@nilo19
Copy link
Copy Markdown
Contributor Author

nilo19 commented Apr 4, 2026

Part of #10054

Comment on lines +8 to +13
## When To Use

Use this skill when the user wants to manually replay a cloud-provider-azure e2e
test case against a live Kubernetes cluster. The skill parses the Go test source,
translates each step to CLI commands (`kubectl` / `az`), and guides interactive
execution.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should put the when to use in description. https://agentskills.io/specification#description-field

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added, as well as other skills.

nilo19 added 2 commits April 10, 2026 17:16
Update the run-e2e-test skill description to include activation
triggers ("Use when...") per the Agent Skills specification. Enrich
authoring.md with a new Description Field section documenting the
spec requirements: what-it-does + when-to-use structure, keyword
guidance, progressive disclosure token budgets, and examples. Update
the skill template placeholder to prompt for triggers.

Reference: https://agentskills.io/specification#description-field
Add "Use when..." activation triggers to the description field of all
five existing skills per the Agent Skills specification guidance added
in the previous commit. This helps agents match user requests to the
correct skill at startup.

Skills updated: cherry-pick-pr, create-release-tags,
create-release-note-doc-pr, release, fix-image-cves.
@nilo19 nilo19 merged commit 133554b into kubernetes-sigs:master Apr 10, 2026
18 of 19 checks passed
@nilo19 nilo19 deleted the e2e-skills branch April 10, 2026 12:11
nilo19 added a commit to nilo19/cloud-provider-azure that referenced this pull request Apr 10, 2026
feat: add run-e2e-test shared skill for interactive e2e test replay
nilo19 added a commit to nilo19/cloud-provider-azure that referenced this pull request Apr 10, 2026
feat: add run-e2e-test shared skill for interactive e2e test replay
nilo19 added a commit to nilo19/cloud-provider-azure that referenced this pull request Apr 10, 2026
feat: add run-e2e-test shared skill for interactive e2e test replay
nilo19 added a commit to nilo19/cloud-provider-azure that referenced this pull request Apr 10, 2026
feat: add run-e2e-test shared skill for interactive e2e test replay
nilo19 added a commit that referenced this pull request Apr 10, 2026
feat: add run-e2e-test shared skill for interactive e2e test replay
nilo19 added a commit that referenced this pull request Apr 10, 2026
feat: add run-e2e-test shared skill for interactive e2e test replay
nilo19 added a commit that referenced this pull request Apr 10, 2026
feat: add run-e2e-test shared skill for interactive e2e test replay
nilo19 added a commit that referenced this pull request Apr 10, 2026
feat: add run-e2e-test shared skill for interactive e2e test replay
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants