Skip to content

test: add deterministic desktop E2E system - #265

Merged
Timpan4 merged 4 commits into
mainfrom
test/deterministic-kubecove-e2e
Jul 22, 2026
Merged

test: add deterministic desktop E2E system#265
Timpan4 merged 4 commits into
mainfrom
test/deterministic-kubecove-e2e

Conversation

@Timpan4

@Timpan4 Timpan4 commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • add fast WDIO browser-mock and isolated real Tauri + Kind test paths
  • add workspace-scoped dev Kind lifecycle, fixtures, diagnostics, and security validation
  • wire CI/release matrices and document E2E and Kubernetes support policies

Testing

  • bun run e2e:fast
  • bun run e2e:desktop-smoke
  • bun run e2e:real -- --kubernetes 1.35 --provider podman
  • bun run typecheck; bun run svelte:check; bun run lint
  • cargo check default and with e2e feature; focused Rust tests

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Timpan4, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 12 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 66b6ec70-4724-4b08-9e1c-91b63a3235ca

📥 Commits

Reviewing files that changed from the base of the PR and between 9966457 and 0367ba5.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (13)
  • .github/workflows/e2e.yml
  • .github/workflows/release.yml
  • docs/development-workflow.md
  • e2e/fixtures/all.yaml
  • e2e/lifecycle.ts
  • e2e/specs/desktop/smoke.e2e.ts
  • e2e/specs/real/inspection.e2e.ts
  • e2e/wdio.fast.conf.ts
  • e2e/wdio.real.conf.ts
  • package.json
  • src-tauri/src/commands/kubeconfig.rs
  • src-tauri/src/commands/streams/watch.rs
  • src-tauri/src/e2e.rs
📝 Walkthrough

Walkthrough

This PR adds deterministic fast, native, desktop, and Kubernetes-backed E2E suites, including Kind fixtures, Tauri E2E gating, strict kubeconfig validation, WDIO configurations, CI and release matrices, watch error tests, and documentation for the supported Kubernetes window.

Changes

Deterministic E2E Lab

Layer / File(s) Summary
E2E runtime boundary and tooling
src-tauri/..., package.json, tsconfig.json, src-tauri/tauri.*.json
Adds an E2E Cargo feature, isolated Tauri configuration, strict loopback kubeconfig validation, feature-aware startup, and WDIO tooling.
Kind lifecycle and deterministic fixtures
e2e/lifecycle.ts, e2e/fixtures/*
Adds pinned tool provisioning, provider selection, owned Kind cluster lifecycle, RBAC, CRDs, workloads, Argo resources, Helm fixtures, diagnostics, and cleanup.
Browser, desktop, and native inspection suites
e2e/specs/*, e2e/wdio.*.ts
Adds fast browser-mock, desktop smoke, and native Kubernetes inspection tests with failure screenshots and artifact support.
Backend error and watch validation
src-tauri/src/commands/discovery.rs, src-tauri/src/commands/streams/watch.rs
Adds CRD error-mapping tests and verifies stale watch resource versions reset to zero on reconnect.
CI and release automation
.github/workflows/*, .gitignore, biome.json
Runs fast E2E in CI, adds scheduled/manual Kubernetes and desktop matrices, and makes release verification require E2E success.
E2E workflow and support documentation
README.md, docs/*
Documents lab commands, cleanup, security constraints, release gates, milestones, ADRs, and Kubernetes versions 1.34–1.36.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CI
  participant lifecycle as e2e/lifecycle.ts
  participant Kind
  participant Tauri
  participant WDIO
  CI->>lifecycle: Run e2e:real
  lifecycle->>Kind: Create and bootstrap cluster
  lifecycle->>Tauri: Build E2E application
  lifecycle->>WDIO: Launch native inspection suite
  WDIO->>Tauri: Invoke Kubernetes operations
  Tauri->>Kind: Read and modify fixture resources
  Kind-->>WDIO: Return discovery, watch, log, exec, and apply results
Loading

Possibly related PRs

Poem

I’m a bunny with tests in a Kind-built burrow,
Fast mocks hop by, while native checks scurry.
Kubeconfigs stay loopback-tight,
CI watches through the night.
Helm and Argo share the hay—
Clean clusters bound away!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly reflects the main change: adding a deterministic E2E testing system.
Description check ✅ Passed The description matches the changeset and summarizes the new E2E paths, CI wiring, and documentation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 11

🧹 Nitpick comments (2)
src-tauri/src/e2e.rs (1)

170-196: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Test-only serde_yaml usage.

Not a change to flag for this PR since it's confined to the #[cfg(test)] module, but worth noting serde_yaml was marked deprecated by its maintainer (its published version carries a +deprecated suffix). If new test dependencies are being added, a maintained fork (e.g. serde_yaml_ng or serde_norway) would be preferable going forward.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src-tauri/src/e2e.rs` around lines 170 - 196, Keep the test-only YAML parsing
in valid_config unchanged for this PR; no production dependency change is
required. For future new test dependencies, prefer a maintained serde_yaml fork
such as serde_yaml_ng or serde_norway.
e2e/lifecycle.ts (1)

113-115: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the hardcoded Podman fallback path.

/opt/podman/bin/podman embeds Unix path separators and is probed on every non-PATH Podman lookup. Use platform-gated, path-helper-based discovery or require podman on PATH.

As per coding guidelines, “All changes must work on macOS, Windows, and Linux; do not hardcode path separators, path-list separators, or home directories.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/lifecycle.ts` around lines 113 - 115, Remove the hardcoded
/opt/podman/bin/podman fallback from providerBinary. Make Podman discovery rely
on Bun.which or a platform-aware path helper that uses platform-native
separators, while preserving the existing providerEnvironment and ensureProvider
behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/e2e.yml:
- Line 61: Replace the mutable actions/upload-artifact@v7 reference with the
reviewed immutable commit SHA at .github/workflows/e2e.yml lines 61 and 114, and
.github/workflows/release.yml line 201; update all three uses consistently.

In `@docs/development-workflow.md`:
- Around line 57-63: Update the E2E runner lifecycle description near the
`--keep` examples to state that cluster deletion is skipped when `--keep` is set
locally. Preserve the existing behavior description for success, failure, and
signal paths when `--keep` is not used, and retain that `--keep` is rejected in
CI.

In `@e2e/fixtures/all.yaml`:
- Around line 29-44: Harden both Deployment container specs: in
e2e/fixtures/all.yaml lines 29-44 and 45-68, configure non-root execution,
disable privilege escalation, drop all capabilities, and enable a read-only root
filesystem. In the fixture-api Deployment at lines 45-68, additionally define an
emptyDir volume and mount it at /www so generated HTTP content remains writable.

In `@e2e/lifecycle.ts`:
- Around line 74-79: Update the Node version validation in the lifecycle flow
before the WDIO execute calls to reject versions below 18.20.0, including Node
16/17 and Node 18.0–18.19. Preserve the existing direct execution for supported
Node versions through 24 and the fnm fallback for newer versions, using the
parsed version data from the existing version check.

In `@e2e/specs/real/inspection.e2e.ts`:
- Around line 17-24: Restore typed Tauri command boundaries: in
e2e/specs/real/inspection.e2e.ts lines 17-24 replace the generic invoke helper
with typed command wrappers; update lines 33-44 with typed streaming-command
wrappers and return handles; and in e2e/specs/desktop/smoke.e2e.ts lines 7-10
call list_kube_contexts through its typed wrapper, ensuring no direct untyped
bridge invocation remains.
- Line 10: Validate KUBECOVE_E2E_CLUSTER once before constructing
cluster-related names, failing immediately when it is absent; then derive the
admin and other context names from the validated value. Update the cluster-name
initialization and its corresponding context at the referenced symbol so no
undefined-admin value can propagate.

In `@e2e/wdio.fast.conf.ts`:
- Line 18: Use the platform-safe path construction provided by path.join for the
screenshot destination in the saveScreenshot calls in e2e/wdio.fast.conf.ts
lines 18-18 and e2e/wdio.real.conf.ts lines 20-20, joining each artifacts
directory with its generated failure filename.

In `@e2e/wdio.real.conf.ts`:
- Line 16: Update the appBinaryPath fallback in the `@wdio/tauri-service`
configuration to select the platform-appropriate binary name, including the .exe
suffix on Windows, while preserving the KUBECOVE_E2E_BINARY override.

In `@src-tauri/src/commands/kubeconfig.rs`:
- Around line 85-91: The E2E kubeconfig path construction must ignore inherited
KUBECOVE_E2E_KUBECONFIG_SOURCE values. Add an E2E-only source constructor near
the existing from_settings flow that uses only crate::e2e::kubeconfig_path(),
update the E2E branch to call it, and add a regression test proving a preset
environment variable cannot override the validated E2E kubeconfig.

In `@src-tauri/src/commands/streams/watch.rs`:
- Around line 52-60: Update reset_resource_version_for_error to reset
resource_version to "0" only when the WatchEvent::Error status represents 410
Gone/Expired; return the error message without changing the cursor for other
failures such as 403, 429, or 5xx. Add a test verifying that a non-410 error
preserves an existing resource version of "55".

In `@src-tauri/src/e2e.rs`:
- Around line 45-75: Update required_absolute_path to stop comparing canonical
against the original path and remove the resulting “must be canonical”
rejection; after validating the path type, return the fs::canonicalize result
directly. Preserve the existing absolute-path, availability, and file/directory
validation behavior.

---

Nitpick comments:
In `@e2e/lifecycle.ts`:
- Around line 113-115: Remove the hardcoded /opt/podman/bin/podman fallback from
providerBinary. Make Podman discovery rely on Bun.which or a platform-aware path
helper that uses platform-native separators, while preserving the existing
providerEnvironment and ensureProvider behavior.

In `@src-tauri/src/e2e.rs`:
- Around line 170-196: Keep the test-only YAML parsing in valid_config unchanged
for this PR; no production dependency change is required. For future new test
dependencies, prefer a maintained serde_yaml fork such as serde_yaml_ng or
serde_norway.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2c21ab3a-7d1d-47a6-99cf-26dda9feee49

📥 Commits

Reviewing files that changed from the base of the PR and between 85f5682 and 9966457.

⛔ Files ignored due to path filters (2)
  • bun.lock is excluded by !**/*.lock
  • src-tauri/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (33)
  • .github/workflows/ci.yml
  • .github/workflows/e2e.yml
  • .github/workflows/release.yml
  • .gitignore
  • README.md
  • biome.json
  • docs/README.md
  • docs/decisions/0010-e2e-only-wdio-security-boundary.md
  • docs/decisions/0011-rolling-kubernetes-support.md
  • docs/development-workflow.md
  • docs/milestones.md
  • docs/release.md
  • e2e/fixtures/all.yaml
  • e2e/fixtures/argocd-crd.yaml
  • e2e/fixtures/chart/Chart.yaml
  • e2e/fixtures/chart/templates/configmap.yaml
  • e2e/fixtures/rbac.yaml
  • e2e/lifecycle.ts
  • e2e/specs/desktop/smoke.e2e.ts
  • e2e/specs/fast/browser-mocks.e2e.ts
  • e2e/specs/real/inspection.e2e.ts
  • e2e/wdio.fast.conf.ts
  • e2e/wdio.real.conf.ts
  • package.json
  • src-tauri/Cargo.toml
  • src-tauri/src/commands/discovery.rs
  • src-tauri/src/commands/kubeconfig.rs
  • src-tauri/src/commands/streams/watch.rs
  • src-tauri/src/e2e.rs
  • src-tauri/src/lib.rs
  • src-tauri/tauri.dev-kind.conf.json
  • src-tauri/tauri.e2e.conf.json
  • tsconfig.json

Comment thread .github/workflows/e2e.yml Outdated
Comment thread docs/development-workflow.md Outdated
Comment thread e2e/fixtures/all.yaml
Comment thread e2e/lifecycle.ts
Comment thread e2e/specs/real/inspection.e2e.ts Outdated
Comment thread e2e/wdio.fast.conf.ts Outdated
Comment thread e2e/wdio.real.conf.ts Outdated
Comment thread src-tauri/src/commands/kubeconfig.rs Outdated
Comment thread src-tauri/src/commands/streams/watch.rs
Comment thread src-tauri/src/e2e.rs
@codspeed-hq

codspeed-hq Bot commented Jul 22, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 36 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing test/deterministic-kubecove-e2e (0367ba5) with main (7911248)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Timpan4
Timpan4 merged commit 904e475 into main Jul 22, 2026
10 checks passed
@Timpan4
Timpan4 deleted the test/deterministic-kubecove-e2e branch July 22, 2026 10:59
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