mirror of
https://github.com/alibaba/higress.git
synced 2026-04-21 20:17:29 +08:00
feat(test): set global info for suite tests (#219)
Signed-off-by: bitliu <bitliu@tencent.com>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
package suite
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/alibaba/higress/test/ingress/conformance/utils/config"
|
||||
@@ -164,6 +165,8 @@ func (suite *ConformanceTestSuite) Setup(t *testing.T) {
|
||||
|
||||
// Run runs the provided set of conformance tests.
|
||||
func (suite *ConformanceTestSuite) Run(t *testing.T, tests []ConformanceTest) {
|
||||
|
||||
t.Logf("Start Running %d Test Cases: \n\n%s", len(tests), globalConformanceTestsListInfo(tests))
|
||||
for _, test := range tests {
|
||||
t.Run(test.ShortName, func(t *testing.T) {
|
||||
test.Run(t, suite)
|
||||
@@ -171,6 +174,15 @@ func (suite *ConformanceTestSuite) Run(t *testing.T, tests []ConformanceTest) {
|
||||
}
|
||||
}
|
||||
|
||||
func globalConformanceTestsListInfo(tests []ConformanceTest) string {
|
||||
var cases string
|
||||
for index, test := range tests {
|
||||
cases += fmt.Sprintf("CaseNum: %d\nCaseName: %s\nScenario: %s\n\n", index+1, test.ShortName, test.Description)
|
||||
}
|
||||
|
||||
return cases
|
||||
}
|
||||
|
||||
// ConformanceTest is used to define each individual conformance test.
|
||||
type ConformanceTest struct {
|
||||
ShortName string
|
||||
|
||||
Reference in New Issue
Block a user