Kubernetes executor direct tests fail without envtest assets
维护者通常 2 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- go, kubernetes
- 领域
- devops, testing-qa
调研方向
从 pkg/app/piped/executor/kubernetes/sync_test.go 开始,重点查看 TestExecutor_ensureSync 及其 envtest.Environment 设置,然后比较 Makefile 中的资产配置和 make test/go 目标。在未设置 KUBEBUILDER_ASSETS 的情况下直接运行 go test 命令。当缺少 envtest 资产时产生清晰的跳过或设置消息,同时 make test/go 仍使用已配置的资产运行测试,即表示完成。
由索引模型根据 Issue 内容生成。
描述
What happened:
Direct package-level Go tests for the Kubernetes executor are not self-contained. Running go test ./pkg/app/piped/executor/kubernetes -run TestExecutor_ensureSync -count=1 without preinstalled envtest assets fails while starting envtest.Environment with exec: "etcd": executable file not found in $PATH or fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory.
What you expected to happen:
Direct package tests should either bootstrap envtest prerequisites automatically or skip with a clear message when the assets are unavailable, instead of failing as though the executor logic is broken.
How to reproduce it:
- Ensure
KUBEBUILDER_ASSETSis unset and no local envtest binaries are installed. - Run
go test ./pkg/app/piped/executor/kubernetes -run TestExecutor_ensureSync -count=1. - Observe
TestExecutor_ensureSyncfail whileenvtest.Environmentstarts. - Compare that with
make test/go, which installs and exports envtest assets viasetup-envtestinMakefilebefore running the Go tests.
Environment:
pipedversion: repository checkout on 2026-07-11 (upstream/masterfetched tod720a26aduring validation)control-planeversion: Not applicable- Others: reproduced locally during repository assessment
Summary
Direct Go tests for the Kubernetes executor rely on envtest binaries that are only provisioned by the Makefile wrapper.
Affected Area
pkg/app/piped/executor/kubernetes/sync_test.go, Makefile
Expected Behaviour
The test should either provision envtest requirements or skip with a clear environment-related message.
Actual Behaviour
The test fails at envtest startup when envtest binaries are not available.
Technical Evidence
pkg/app/piped/executor/kubernetes/sync_test.gocreatesenvtest.Environmentdirectly and callsStart().Makefileprovisionssetup-envtestand exportsKUBEBUILDER_ASSETSformake test/go.- Reproduced failure:
go test ./pkg/app/piped/executor/kubernetes -run TestExecutor_ensureSync -count=1Error: Received unexpected error: unable to start control plane itself: failed to start the controlplane. retried 5 times: exec: "etcd": executable file not found in $PATH
Suspected Root Cause
The test assumes envtest binaries are already available, but that prerequisite is encoded only in the Make target and not in the test itself.
Proposed Direction
Add an explicit envtest asset preflight in the test so it either uses available binaries or skips with a clear message when the environment is missing the required assets.
Acceptance Criteria
- Direct
go teston the package no longer reports a misleading functional failure when envtest assets are missing. make test/gocontinues to run the test unchanged when envtest assets are provisioned.- Contributors can distinguish environmental setup issues from real executor regressions immediately.
- 主要语言
- Go
- 星标
- 1.4k
- 派生
- 391
- 平均合并
- 4 天 1 小时
- 30 天内合并 PR
- 58
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pipe-cd/pipecd 的其他 Issue
-
Applications at the repository root are not triggered by new commits可能已有人在做 @Daksha1611 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 2 天内回复
-
pipedv1 kubernetes plugins ignore trafficRouting.istio.host in K8S_TRAFFIC_ROUTING可能已有人在做 @Dhirenderchoudhary 今天认领。 未关闭
难度 2/5 半天 新手友好度 74/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
pipectl transfer restore application drops backed-up labels可能已有人在做 @bhavishyajain545 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 2 天内回复
相似的 Issue
-
IsTextFile reads the whole file into memory (OOM on large files in the file watcher)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
gtsteffaniak/filebrowser#3395 ·
维护者通常 1 天内回复
-
effort:s impact:low raised-by:worker risk:low
难度 1/5 1 小时以内 新手友好度 70/100
medici-finance/assay#6496 · 1 条评论 ·
维护者通常 1 天内回复
-
kind/bug require/reproduce require/severity
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 60/100