Documentation
¶
Index ¶
- Variables
- func AllCheck() error
- func CheckTestCaseGrpc() error
- func CheckTestCaseHttp() error
- func ExtractXpath(ctx context.Context, cmd *cli.Command) error
- func GenReportFileGrpc(testCasefilePath string, tcResultList []GrpcTestCaseResult, info *ResultInfo)
- func GenReportFileHttp(testCasefilePath string, tcResultList []HttpTestCaseResult, info *ResultInfo)
- func HandleSingleFileGrpc(workerNum int, filePath string) (*ResultInfo, []GrpcTestCaseResult)
- func HandleSingleFileHttp(workerNum int, filePath string) (*ResultInfo, []HttpTestCaseResult)
- func RenderTpl(fs embed.FS, key string, obj map[string]any, targetPath string) error
- func RunTestCases(ctx context.Context, cmd *cli.Command) error
- func ValidateBodyFields(testCaseId uint64, body, luaBody string) error
- func ValidateConfig(ctx context.Context, cmd *cli.Command) error
- func ValidateDependencies[T interface{ ... }](filePath string, testcases []T) error
- func ValidateTestCaseIDs[T model.IdItem](filePath string, testcases []T) error
- func ValidateXPath(testCaseId uint64, xpathStr string) error
- type CaseShow
- type EventHandler
- func (m *EventHandler) OnReceiveHeaders(md metadata.MD)
- func (m *EventHandler) OnReceiveResponse(msg proto.Message)
- func (m *EventHandler) OnReceiveTrailers(status *status.Status, md metadata.MD)
- func (m *EventHandler) OnResolveMethod(descriptor *desc.MethodDescriptor)
- func (m *EventHandler) OnSendHeaders(md metadata.MD)
- type GrpcTestCallable
- type GrpcTestCaseResult
- type HttpTestCallable
- type HttpTestCaseResult
- type ResultInfo
- type UnifiedTestResults
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CheckTestCaseGrpc ¶ added in v0.0.6
func CheckTestCaseGrpc() error
func CheckTestCaseHttp ¶ added in v0.0.6
func CheckTestCaseHttp() error
func GenReportFileGrpc ¶ added in v0.0.6
func GenReportFileGrpc(testCasefilePath string, tcResultList []GrpcTestCaseResult, info *ResultInfo)
func GenReportFileHttp ¶ added in v0.0.6
func GenReportFileHttp(testCasefilePath string, tcResultList []HttpTestCaseResult, info *ResultInfo)
func HandleSingleFileGrpc ¶ added in v0.0.6
func HandleSingleFileGrpc(workerNum int, filePath string) (*ResultInfo, []GrpcTestCaseResult)
func HandleSingleFileHttp ¶ added in v0.0.6
func HandleSingleFileHttp(workerNum int, filePath string) (*ResultInfo, []HttpTestCaseResult)
func ValidateBodyFields ¶ added in v0.2.1
ValidateBodyFields 验证body和luaBody字段
func ValidateDependencies ¶ added in v0.2.1
func ValidateDependencies[T interface {
GetID() uint64
GetDependOnIDs() []uint64
}](filePath string, testcases []T) error
ValidateDependencies 验证依赖关系
func ValidateTestCaseIDs ¶ added in v0.2.1
ValidateTestCaseIDs 验证测试用例ID是否重复
func ValidateXPath ¶ added in v0.2.1
ValidateXPath 验证XPath语法
Types ¶
type EventHandler ¶ added in v0.0.6
type EventHandler struct {
// contains filtered or unexported fields
}
func NewEventHandler ¶ added in v0.0.6
func NewEventHandler(formatter grpcurl.Formatter) *EventHandler
func (*EventHandler) OnReceiveHeaders ¶ added in v0.0.6
func (m *EventHandler) OnReceiveHeaders(md metadata.MD)
func (*EventHandler) OnReceiveResponse ¶ added in v0.0.6
func (m *EventHandler) OnReceiveResponse(msg proto.Message)
func (*EventHandler) OnReceiveTrailers ¶ added in v0.0.6
func (m *EventHandler) OnReceiveTrailers(status *status.Status, md metadata.MD)
func (*EventHandler) OnResolveMethod ¶ added in v0.0.6
func (m *EventHandler) OnResolveMethod(descriptor *desc.MethodDescriptor)
func (*EventHandler) OnSendHeaders ¶ added in v0.0.6
func (m *EventHandler) OnSendHeaders(md metadata.MD)
type GrpcTestCallable ¶ added in v0.0.6
type GrpcTestCallable struct {
// contains filtered or unexported fields
}
type GrpcTestCaseResult ¶ added in v0.0.6
type GrpcTestCaseResult struct {
State model.State
ID uint64
Desc string
Reason model.Reason
// actual request
Request config.RequestGrpc
TestCase *config.TestCaseGrpc
KeyValues map[string]any
Error error
Response *model.GrpcResp
}
func (*GrpcTestCaseResult) ReqDetail ¶ added in v0.1.6
func (t *GrpcTestCaseResult) ReqDetail() string
func (*GrpcTestCaseResult) RespDetail ¶ added in v0.1.6
func (t *GrpcTestCaseResult) RespDetail() string
type HttpTestCallable ¶
type HttpTestCallable struct {
// contains filtered or unexported fields
}
type HttpTestCaseResult ¶
type HttpTestCaseResult struct {
State model.State
ID uint64
Desc string
Reason model.Reason
// actual request
Request config.RequestHttp
TestCase *config.TestCaseHttp
KeyValues map[string]any
Error error
Response *resty.Response
}
func (*HttpTestCaseResult) ReqDetail ¶ added in v0.1.5
func (t *HttpTestCaseResult) ReqDetail() string
func (*HttpTestCaseResult) RespDetail ¶ added in v0.1.5
func (t *HttpTestCaseResult) RespDetail() string
type ResultInfo ¶
type UnifiedTestResults ¶ added in v0.2.1
type UnifiedTestResults struct {
TotalTests int
PassedTests int
FailedTests int
FailedCases []string
}
UnifiedTestResults 统一的测试结果
func CombineResults ¶ added in v0.2.1
func CombineResults(httpResults, grpcResults *UnifiedTestResults) *UnifiedTestResults
CombineResults 合并HTTP和gRPC测试结果
func GrpcAutomateTest ¶ added in v0.0.6
func GrpcAutomateTest(grpcTestCases map[string][]*config.TestCaseGrpc) *UnifiedTestResults
func HttpAutomateTest ¶
func HttpAutomateTest(httpTestCases map[string][]*config.TestCaseHttp) *UnifiedTestResults
Click to show internal directories.
Click to hide internal directories.