Skip to content

Skip kubernetes envtest when assets are missing#7014

Open
rootp1 wants to merge 1 commit into
pipe-cd:masterfrom
rootp1:fix/kubernetes-envtest-skip
Open

Skip kubernetes envtest when assets are missing#7014
rootp1 wants to merge 1 commit into
pipe-cd:masterfrom
rootp1:fix/kubernetes-envtest-skip

Conversation

@rootp1

@rootp1 rootp1 commented Jul 11, 2026

Copy link
Copy Markdown

What this PR does:

Adds an envtest asset preflight to TestExecutor_ensureSync so direct package tests skip with a clear message when etcd or kube-apiserver are unavailable, and adds focused unit coverage for the preflight helper.

Why we need it:

Direct go test on the Kubernetes executor package currently fails with an environment/setup error unless contributors use the Makefile wrapper that provisions envtest assets. This change makes that failure mode explicit and less misleading.

Which issue(s) this PR fixes:

Fixes #7013

Does this PR introduce a user-facing change?:

  • How are users affected by this change: Not applicable; test-only change for contributors.
  • Is this breaking change: No.
  • How to migrate (if breaking change): Not applicable.

Summary

  • add a preflight check for required envtest binaries before starting envtest.Environment
  • skip the envtest-dependent Kubernetes executor test with a clear message when assets are unavailable
  • add focused coverage for envtest binary detection

Linked Issue

Fixes #7013

What Changed

  • added requireEnvtestAssets and binary detection helpers in pkg/app/piped/executor/kubernetes/sync_test.go
  • gated TestExecutor_ensureSync behind the preflight check
  • added TestMissingEnvtestBinaries

Verification

  • go test ./pkg/app/piped/executor/kubernetes -run 'TestMissingEnvtestBinaries|TestEnsureSync|TestExecutor_ensureSync' -count=1 — passed
  • KUBEBUILDER_ASSETS='' go test ./pkg/app/piped/executor/kubernetes -run TestExecutor_ensureSync -count=1 -v — passed
  • make check — not run successfully: failed in build/web because yarn is not installed in this environment
  • make test/go MODULES=. — failed: upstream test suite currently fails in pkg/app/piped/executor/kubernetes and pkg/app/piped/platformprovider/kubernetes on this checkout
  • make check/dco — failed: upstream commit 25ae69937e55e8330bff96c34346718f3e5e7148 is missing a Signed-off-by line, so the repository DCO check does not pass cleanly on top of upstream/master

Scope

  • only pkg/app/piped/executor/kubernetes/sync_test.go was changed; unrelated files were not modified

Signed-off-by: rootp1 <arnav.iitr@gmail.com>
@rootp1
rootp1 requested a review from a team as a code owner July 11, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kubernetes executor direct tests fail without envtest assets

1 participant