Skip to content

kmesh: e2e: Add Playwright end-to-end tests against a KWOK cluster - #1254

Open
itvi-1234 wants to merge 1 commit into
headlamp-k8s:mainfrom
itvi-1234:feat/kmesh-e2e-testing
Open

itvi-1234 wants to merge 1 commit into
headlamp-k8s:mainfrom
itvi-1234:feat/kmesh-e2e-testing

Conversation

@itvi-1234

Copy link
Copy Markdown
Contributor

Summary

  • Adds Playwright end-to-end tests for the Kmesh plugin, running the production build inside Headlamp v0.43.0 against a local KWOK cluster — following the same pattern already used by ai-assistant/e2e.
  • Installs the real Gateway API CRD plus a minimal KmeshNodeInfo CRD, with fixtures: a Waypoint Gateway, and two KmeshNodeInfo nodes with a deliberate SPI mismatch.
  • Scenario covers: the Kmesh sidebar entry → Waypoints list rendering the fixture Waypoint → its detail page showing the Programmed condition → Node Security list correctly flagging the SPI mismatch between nodes.
  • Adds npm run e2e / npm run e2e:playwright scripts and the required devDependencies (@playwright/test, tsx, js-yaml); excludes e2e/** from the unit-test (vitest) run so they don't collide.

Signed-off-by: Sumit Goyal <rjsumit71@gmail.com>

Copilot AI left a comment

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.

Copilot review overview

🟡 Changes recommended

The Gateway status fixture is discarded and the new E2E suite is not executed by CI.

Review effort: Balanced
Findings: 2 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Adds a KWOK-backed Playwright E2E suite for validating Kmesh plugin workflows in Headlamp.

Changes:

  • Adds cluster setup, fixtures, and Headlamp container orchestration.
  • Tests Waypoints and Node Security views.
  • Adds Playwright dependencies and scripts.
File Description
kmesh/​package.json Adds E2E scripts and dependencies.
kmesh/​package-lock.json Locks new dependencies.
kmesh/​e2e/​run-kmesh-e2e.ts Orchestrates the E2E environment.
kmesh/​e2e/​README.md Documents E2E usage.
kmesh/​e2e/​playwright.config.ts Configures Playwright.
kmesh/​e2e/​kwok-fixtures.yaml Defines test resources.
kmesh/​e2e/​kmesh.spec.ts Implements UI scenarios.
kmesh/​e2e/​kmesh-crds.yaml Defines the Kmesh test CRD.
kmesh/​e2e/​gateway-crd.yaml Vendors the Gateway CRD.
kmesh/​e2e/​Dockerfile.headlamp Builds the test Headlamp image.
Files not reviewed (1)
  • kmesh/package-lock.json: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +67 to +71
status:
conditions:
- type: Programmed
status: 'True'
reason: Programmed
Comment thread kmesh/package.json
"storybook-build": "headlamp-plugin storybook-build",
"test": "headlamp-plugin test",
"test": "vitest run --config node_modules/@kinvolk/headlamp-plugin/config/vite.config.mjs --exclude \"**/node_modules/**\" --exclude \"e2e/**\"",
"e2e": "node --import tsx e2e/run-kmesh-e2e.ts",

export default defineConfig({
testDir: e2eDir,
outputDir: path.join(e2eDir, 'test-results'),
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.

2 participants