Wasm cpp bazel (#446)

This commit is contained in:
Hinsteny Hisoka
2023-07-26 10:55:56 +08:00
committed by GitHub
parent 3b78a0eb62
commit 3700ada7e6
14 changed files with 690 additions and 46 deletions

View File

@@ -16,6 +16,7 @@ package test
import (
"flag"
"strings"
"testing"
"github.com/stretchr/testify/require"
@@ -29,6 +30,8 @@ import (
)
var isWasmPluginTest = flag.Bool("isWasmPluginTest", false, "")
var wasmPluginType = flag.String("wasmPluginType", "GO", "")
var wasmPluginName = flag.String("wasmPluginName", "", "")
func TestHigressConformanceTests(t *testing.T) {
flag.Parse()
@@ -53,8 +56,18 @@ func TestHigressConformanceTests(t *testing.T) {
var higressTests []suite.ConformanceTest
if *isWasmPluginTest {
higressTests = []suite.ConformanceTest{
tests.WasmPluginsRequestBlock,
if strings.Compare(*wasmPluginType, "CPP") == 0 {
m := make(map[string]suite.ConformanceTest)
m["request_block"] = tests.CPPWasmPluginsRequestBlock
m["key_auth"] = tests.CPPWasmPluginsKeyAuth
higressTests = []suite.ConformanceTest{
m[*wasmPluginName],
}
} else {
higressTests = []suite.ConformanceTest{
tests.WasmPluginsRequestBlock,
}
}
} else {
higressTests = []suite.ConformanceTest{