mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 04:37:31 +08:00
refactor(v2): upgrade module to github.com/alibaba/higress/v2 (#2922)
Signed-off-by: Xijun Dai <daixijun1990@gmail.com>
This commit is contained in:
@@ -20,7 +20,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/alibaba/higress/hgctl/cmd/hgctl/config"
|
||||
cfg "github.com/alibaba/higress/test/e2e/conformance/utils/config"
|
||||
cfg "github.com/alibaba/higress/v2/test/e2e/conformance/utils/config"
|
||||
"github.com/tidwall/gjson"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
)
|
||||
|
||||
@@ -27,8 +27,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/alibaba/higress/test/e2e/conformance/utils/config"
|
||||
"github.com/alibaba/higress/test/e2e/conformance/utils/roundtripper"
|
||||
"github.com/alibaba/higress/v2/test/e2e/conformance/utils/config"
|
||||
"github.com/alibaba/higress/v2/test/e2e/conformance/utils/roundtripper"
|
||||
)
|
||||
|
||||
type Assertion struct {
|
||||
@@ -200,7 +200,7 @@ func MakeRequestAndExpectEventuallyConsistentResponse(t *testing.T, r roundtripp
|
||||
|
||||
if expected.Request.ActualRequest.Body != nil && len(expected.Request.ActualRequest.Body) > 0 {
|
||||
if len(expected.Request.ActualRequest.ContentType) == 0 {
|
||||
t.Error(`please set Content-Type in ActualRequest manually if you want to send a request with body.
|
||||
t.Error(`please set Content-Type in ActualRequest manually if you want to send a request with body.
|
||||
For example, \"ContentType: http.ContentTypeApplicationJson\"`)
|
||||
}
|
||||
}
|
||||
@@ -309,7 +309,7 @@ func WaitForConsistentResponse(t *testing.T, r roundtripper.RoundTripper, req ro
|
||||
// CompareTarget为Response时,不支持设定ExpectedRequest断言,ExpectedResponse中设置的所有断言均支持。支持任意backend,如echo-body
|
||||
if expected.Meta.CompareTarget == CompareTargetRequest {
|
||||
if expected.Response.ExpectedResponse.Body != nil {
|
||||
t.Logf(`detected CompareTarget is Request, but ExpectedResponse.Body is set.
|
||||
t.Logf(`detected CompareTarget is Request, but ExpectedResponse.Body is set.
|
||||
You can only choose one to compare between Response and Request.`)
|
||||
return false
|
||||
}
|
||||
@@ -325,7 +325,7 @@ func WaitForConsistentResponse(t *testing.T, r roundtripper.RoundTripper, req ro
|
||||
}
|
||||
} else if expected.Meta.CompareTarget == CompareTargetResponse {
|
||||
if expected.Request.ExpectedRequest != nil {
|
||||
t.Logf(`detected CompareTarget is Response, but ExpectedRequest is set.
|
||||
t.Logf(`detected CompareTarget is Response, but ExpectedRequest is set.
|
||||
You can only choose one to compare between Response and Request.`)
|
||||
return false
|
||||
}
|
||||
@@ -728,6 +728,7 @@ func ParseFormUrlencodedBody(body []byte) (map[string][]string, error) {
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func ParseMultipartFormBody(body []byte, boundary string) (map[string][]string, error) {
|
||||
ret := make(map[string][]string)
|
||||
mr := multipart.NewReader(bytes.NewReader(body), boundary)
|
||||
@@ -755,7 +756,6 @@ func ParseMultipartFormBody(body []byte, boundary string) (map[string][]string,
|
||||
|
||||
// Get User-defined test case name or generate from expected response to a given request.
|
||||
func (er *Assertion) GetTestCaseName(i int) string {
|
||||
|
||||
// If TestCase name is provided then use that or else generate one.
|
||||
if er.Meta.TestCaseName != "" {
|
||||
return er.Meta.TestCaseName
|
||||
|
||||
@@ -17,7 +17,7 @@ package http
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/alibaba/higress/test/e2e/conformance/utils/roundtripper"
|
||||
"github.com/alibaba/higress/v2/test/e2e/conformance/utils/roundtripper"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -688,7 +688,7 @@ func TestCompareResponse(t *testing.T) {
|
||||
"X-header-test2": {"h2", "h22"},
|
||||
"Content-Type": {"application/json"},
|
||||
},
|
||||
Body: []byte(`
|
||||
Body: []byte(`
|
||||
{
|
||||
"X-body-test1":["b1"],
|
||||
"X-body-test2":["b2", "b22"]
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
ingress "github.com/alibaba/higress/test/e2e/conformance"
|
||||
ingress "github.com/alibaba/higress/v2/test/e2e/conformance"
|
||||
"github.com/stretchr/testify/require"
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
@@ -31,7 +31,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/util/yaml"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
|
||||
"github.com/alibaba/higress/test/e2e/conformance/utils/config"
|
||||
"github.com/alibaba/higress/v2/test/e2e/conformance/utils/config"
|
||||
)
|
||||
|
||||
// Applier prepares manifests depending on the available options and applies
|
||||
|
||||
@@ -14,5 +14,5 @@ limitations under the License.
|
||||
package kubernetes
|
||||
|
||||
import (
|
||||
_ "github.com/alibaba/higress/test/e2e/conformance/utils/flags"
|
||||
_ "github.com/alibaba/higress/v2/test/e2e/conformance/utils/flags"
|
||||
)
|
||||
|
||||
@@ -34,7 +34,7 @@ import (
|
||||
// ensure auth plugins are loaded
|
||||
_ "k8s.io/client-go/plugin/pkg/client/auth"
|
||||
|
||||
"github.com/alibaba/higress/test/e2e/conformance/utils/cert"
|
||||
"github.com/alibaba/higress/v2/test/e2e/conformance/utils/cert"
|
||||
)
|
||||
|
||||
// MustCreateSelfSignedCertSecret creates a self-signed SSL certificate and stores it in a secret
|
||||
|
||||
@@ -27,7 +27,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
|
||||
"github.com/alibaba/higress/test/e2e/conformance/utils/config"
|
||||
"github.com/alibaba/higress/v2/test/e2e/conformance/utils/config"
|
||||
)
|
||||
|
||||
// FilterStaleConditions returns the list of status condition whos observedGeneration does not
|
||||
|
||||
@@ -28,7 +28,7 @@ import (
|
||||
|
||||
"golang.org/x/net/http2"
|
||||
|
||||
"github.com/alibaba/higress/test/e2e/conformance/utils/config"
|
||||
"github.com/alibaba/higress/v2/test/e2e/conformance/utils/config"
|
||||
)
|
||||
|
||||
// RoundTripper is an interface used to make requests within conformance tests.
|
||||
|
||||
@@ -18,9 +18,9 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/alibaba/higress/test/e2e/conformance/utils/config"
|
||||
"github.com/alibaba/higress/test/e2e/conformance/utils/kubernetes"
|
||||
"github.com/alibaba/higress/test/e2e/conformance/utils/roundtripper"
|
||||
"github.com/alibaba/higress/v2/test/e2e/conformance/utils/config"
|
||||
"github.com/alibaba/higress/v2/test/e2e/conformance/utils/kubernetes"
|
||||
"github.com/alibaba/higress/v2/test/e2e/conformance/utils/roundtripper"
|
||||
"istio.io/istio/pkg/util/sets"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
)
|
||||
@@ -29,7 +29,7 @@ const (
|
||||
TestAreaAll = "all"
|
||||
TestAreaSetup = "setup"
|
||||
TestAreaRun = "run"
|
||||
TessAreaClean = "clean"
|
||||
TestAreaClean = "clean"
|
||||
)
|
||||
|
||||
// ConformanceTestSuite defines the test suite used to run Gateway API
|
||||
|
||||
Reference in New Issue
Block a user