You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
720 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package framework
import "k8s.io/client-go/rest"
// 1. 定义一个测试的入口函数Describe这里接收测试的描述以及contextFunc
// 1.1 这里边会调用context创建方法来创建context
// 1.2 这个context里面会有执行一些我们期望的行为
// 2. 这个contextFunc的签名符合func(ctx *TestContext, f *Framework)
// 3. 这个contextFunc的函数体就是测试函数的内容本身
// 4. 由于这个contextFunc的参数中有ctx入参那么在执行测试函数体的时候就可以使用ctx中的内容或方法。
type TestContext struct {
Name string
Namespace string
Config *rest.Config
MasterIP string
}
type ContextFunc func(ctx *TestContext, f *Framework)