Labsco
openshift logo

E2E Test Runner

โ˜… 527

by openshift ยท part of openshift/hypershift

Provides the ability to run and iterate on HyperShift e2e tests. Auto-applies when implementing features that require e2e validation, fixing e2e test failures, or working on tasks that need live cluster testing.

๐Ÿ”Œ This skill ships inside the hypershift plugin โ€” install the plugin and you also get 7 slash commands, 5 sub-agents.

This is the playbook your agent receives when the skill activates โ€” you don't need to read it to use the skill, but it's here to audit before installing.

HyperShift E2E Test Runner

This skill enables autonomous iteration on e2e tests - running tests, analyzing failures, making fixes, and re-running until tests pass.

When to Use This Skill

This skill automatically applies when:

  • Implementing a feature that needs e2e test validation
  • Fixing a failing e2e test
  • Working on a task where the user wants you to iterate until tests pass
  • Debugging test failures in the test/e2e/ directory
  • The user mentions running e2e tests or validating changes against a live cluster

Iteration Loop

When working autonomously on a task that requires e2e validation:

1. Initial Test Run

Run the test to establish baseline:

KUBECONFIG=$MGMT_KUBECONFIG ./bin/test-e2e -test.v -test.run "TestName" [flags...]

2. On Failure - Analyze

  • Read the test output carefully
  • Check artifacts in $E2E_ARTIFACT_DIR/ directory for:
    • Pod logs
    • Events
    • Resource states
  • Identify the root cause

3. Make Fixes

  • Edit the relevant code (test code, operator code, etc.)
  • If you modified test/e2e/*.go files, the binary will be rebuilt automatically on next run

4. Rebuild Images (If Needed)

If you modified control-plane-operator code: Use the build-cpo-image skill to build and push a new image.

$RUNTIME build -f Dockerfile.control-plane --platform linux/amd64 -t $CPO_IMAGE_REPO:NEW_TAG .
$RUNTIME push $CPO_IMAGE_REPO:NEW_TAG

5. Re-run Test

Run the test again with updated code/images. Repeat until passing.

Common Test Patterns

Test PatternDescription
TestNodePoolAll NodePool tests
TestNodePool/HostedCluster0/Main/TestSpotTerminationHandlerSpecific spot test
TestNodePool.*KarpenterAll Karpenter-related tests
TestCreateClusterCluster creation tests
TestUpgradeUpgrade tests

Analyzing Test Failures

Check Test Output

The test output includes:

  • Test name and status
  • Assertion failures with expected vs actual
  • Timeout information
  • Resource creation/deletion logs

Check Artifact Directory

After a test failure, examine:

ls -la $E2E_ARTIFACT_DIR/
# Contains: cluster manifests, pod logs, events, resource dumps

Common Failure Patterns

PatternLikely Cause
context deadline exceededResource didn't reach expected state in time
not foundResource wasn't created or was deleted prematurely
connection refusedService not ready or network issue
forbiddenRBAC or permission issue

Building Test Binary

When test code changes, rebuild:

make e2e

This compiles ./bin/test-e2e with all tests from test/e2e/.

Notes

  • Tests typically take 10-30+ minutes depending on complexity
  • Some tests create real AWS resources (costs money, needs cleanup on failure)
  • Use -test.timeout to set appropriate timeouts (default: 2h)
  • The artifact directory is overwritten on each run
  • For long tests, consider running in background and checking periodically