mirror of
https://github.com/alibaba/higress.git
synced 2026-04-21 12:07:26 +08:00
@@ -27,4 +27,5 @@ var (
|
||||
WasmPluginType = flag.String("wasmPluginType", "GO", "Define wasm plugin type, currently supports GO, CPP")
|
||||
WasmPluginName = flag.String("wasmPluginName", "", "Define wasm plugin name")
|
||||
IsEnvoyConfigTest = flag.Bool("isEnvoyConfigTest", false, "Determine if run envoy config conformance test")
|
||||
TestArea = flag.String("test-area", "all", "Test area to run, like all to run setup/run/clean, setup to prepare test environment, run to run test cases, clean to clean test environment")
|
||||
)
|
||||
|
||||
@@ -206,7 +206,7 @@ func (a Applier) MustDelete(t *testing.T, c client.Client, timeoutConfig config.
|
||||
// }
|
||||
// }
|
||||
|
||||
t.Logf("🏗 Deleting %s %s %s", uObj.GetName(), uObj.GetKind(), uObj.GetNamespace())
|
||||
t.Logf("🚮 Deleting %s %s %s", uObj.GetName(), uObj.GetKind(), uObj.GetNamespace())
|
||||
err = c.Delete(ctx, uObj)
|
||||
require.NoErrorf(t, err, "error delete resource")
|
||||
}
|
||||
|
||||
@@ -24,6 +24,13 @@ import (
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
)
|
||||
|
||||
const (
|
||||
TestAreaAll = "all"
|
||||
TestAreaSetup = "setup"
|
||||
TestAreaRun = "run"
|
||||
TessAreaClean = "clean"
|
||||
)
|
||||
|
||||
// ConformanceTestSuite defines the test suite used to run Gateway API
|
||||
// conformance tests.
|
||||
type ConformanceTestSuite struct {
|
||||
@@ -159,7 +166,7 @@ func (suite *ConformanceTestSuite) Setup(t *testing.T) {
|
||||
t.Logf("🌱 Supported Features: %+v", suite.SupportedFeatures.UnsortedList())
|
||||
}
|
||||
|
||||
// RunWithTests runs the provided set of conformance tests.
|
||||
// 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 {
|
||||
@@ -169,6 +176,17 @@ func (suite *ConformanceTestSuite) Run(t *testing.T, tests []ConformanceTest) {
|
||||
}
|
||||
}
|
||||
|
||||
// Clean cleans up the base resources installed by Setup.
|
||||
func (suite *ConformanceTestSuite) Clean(t *testing.T) {
|
||||
if suite.Cleanup {
|
||||
t.Logf("🧹 Test Cleanup: Ensuring base resources have been cleaned up")
|
||||
|
||||
for _, baseManifest := range suite.BaseManifests {
|
||||
suite.Applier.MustDelete(t, suite.Client, suite.TimeoutConfig, baseManifest)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func globalConformanceTestsListInfo(tests []ConformanceTest) string {
|
||||
var cases string
|
||||
for index, test := range tests {
|
||||
|
||||
Reference in New Issue
Block a user