feat(test): set global info for suite tests (#219)

Signed-off-by: bitliu <bitliu@tencent.com>
This commit is contained in:
Xunzhuo
2023-02-27 17:04:30 +08:00
committed by GitHub
parent 691493e945
commit 8c95fd938e
11 changed files with 22 additions and 10 deletions

View File

@@ -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