-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
翻译 4.10 Using envtest in integration tests #187
Conversation
Deploy succeeded Built with commit ed5a675 |
/review |
docs/book/src/reference/envtest.md
Outdated
[`controller-runtime`](http://sigs.k8s.io/controller-runtime) offers `envtest` ([godoc](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/envtest?tab=doc)), a package that helps write integration tests for your controllers by setting up and starting an instance of etcd and the Kubernetes API server, without kubelet, controller-manager or other components. | ||
## 在集成测试中使用 envtest | ||
|
||
[`controller-runtime`](http://sigs.k8s.io/controller-runtime) 提供 `envtest` ([godoc](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/envtest?tab=doc)),这个包可以帮助你为你在 etcd 和 Kubernetes API server 中设置并启动的 controllers 实例来写集成测试,不需要 kubelet,controller-manager 或者其他组件。 | ||
|
||
Using `envtest` in integration tests follows the general flow of: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
英文删掉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯嗯,这个删除了
| `KUBEBUILDER_ASSETS` | 目录路径 | 将集成测试指向一个包含所有二进制文件(api-server,etcd 和 kubectl)的目录。 | | ||
| `TEST_ASSET_KUBE_APISERVER`, `TEST_ASSET_ETCD`, `TEST_ASSET_KUBECTL` | 分别代表 api-server,etcd,和 kubectl 二进制文件的路径 | 和 `KUBEBUILDER_ASSETS` 相似,但是更细一点。指示集成测试使用非默认的二进制文件。这些环境变量也可以被用来确保特定的测试是在期望版本的二进制文件下运行的。| | ||
| `KUBEBUILDER_CONTROLPLANE_START_TIMEOUT` 和 `KUBEBUILDER_CONTROLPLANE_STOP_TIMEOUT` | [`time.ParseDuration`](https://golang.org/pkg/time/#ParseDuration) 支持的持续时间的格式 | 指定不同于测试控制面(分别)启动和停止的超时时间;任何超出设置的测试都会运行失败。| | ||
| `KUBEBUILDER_ATTACH_CONTROL_PLANE_OUTPUT` | boolean | 设置为 `true` 可以将控制面的标准输出和标准错误贴合到 os.Stdout 和 os.Stderr 上。这种做法在调试测试失败时是非常有用的,因为输出包含控制面的输出。| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
表格的表头在预览页面看是,一个是居中,另外两个是靠左对齐。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这是个模版问题,我改了一下,貌似不起作用。
ref: #98
[ ] Configuration Infrastructure
[x] Docs
[ ] Installation
[ ] Networking
[ ] Performance and Scalability
[ ] Policies and Telemetry
[ ] Security
[ ] Test and Release
[ ] User Experience
[ ] Developer Infrastructure