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
Contributor

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
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 33.10%. Comparing base (d720a26) to head (10c5a82).
⚠️ Report is 20 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7014      +/-   ##
==========================================
+ Coverage   29.36%   33.10%   +3.74%     
==========================================
  Files         601        6     -595     
  Lines       64317      719   -63598     
==========================================
- Hits        18884      238   -18646     
+ Misses      43965      465   -43500     
+ Partials     1468       16    -1452     
Flag Coverage Δ
. ?
.-pkg-app-pipedv1-plugin-analysis ?
.-pkg-app-pipedv1-plugin-ecs ?
.-pkg-app-pipedv1-plugin-kubernetes ?
.-pkg-app-pipedv1-plugin-kubernetes_multicluster ?
.-pkg-app-pipedv1-plugin-scriptrun 54.83% <ø> (ø)
.-pkg-app-pipedv1-plugin-terraform ?
.-pkg-app-pipedv1-plugin-wait ?
.-pkg-app-pipedv1-plugin-waitapproval ?
.-pkg-plugin-sdk ?
.-tool-actions-gh-release ?
.-tool-actions-plan-preview 25.51% <ø> (ø)
.-tool-codegen-protoc-gen-auth ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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