mirror of
https://github.com/alibaba/higress.git
synced 2026-06-05 10:37:28 +08:00
chore: some clean-up to e2e tests (#162)
Signed-off-by: bitliu <bitliu@tencent.com>
This commit is contained in:
@@ -27,7 +27,7 @@ func init() {
|
||||
|
||||
var HTTPRouteSimpleSameNamespace = suite.ConformanceTest{
|
||||
ShortName: "HTTPRouteSimpleSameNamespace",
|
||||
Description: "A single Ingress in the higress-conformance-infra namespace attaches to a Gateway in the same namespace",
|
||||
Description: "A single Ingress in the higress-conformance-infra namespace demonstrates basic routing ability",
|
||||
Manifests: []string{"tests/httproute-simple-same-namespace.yaml"},
|
||||
Test: func(t *testing.T, suite *suite.ConformanceTestSuite) {
|
||||
|
||||
|
||||
@@ -39,15 +39,8 @@ import (
|
||||
// them to the Kubernetes cluster.
|
||||
type Applier struct {
|
||||
NamespaceLabels map[string]string
|
||||
// ValidUniqueListenerPorts maps each listener port of each Gateway in the
|
||||
// manifests to a valid, unique port. There must be as many
|
||||
// ValidUniqueListenerPorts as there are listeners in the set of manifests.
|
||||
// For example, given two Gateways, each with 2 listeners, there should be
|
||||
// four ValidUniqueListenerPorts.
|
||||
// If empty or nil, ports are not modified.
|
||||
ValidUniqueListenerPorts []int
|
||||
|
||||
// IngressClass will be used as the spec.gatewayClassName when applying Gateway resources
|
||||
// IngressClass will be used as the spec.ingressClassName when applying Ingress resources
|
||||
IngressClass string
|
||||
}
|
||||
|
||||
|
||||
@@ -87,13 +87,6 @@ type Options struct {
|
||||
RoundTripper roundtripper.RoundTripper
|
||||
BaseManifests string
|
||||
NamespaceLabels map[string]string
|
||||
// ValidUniqueListenerPorts maps each listener port of each Gateway in the
|
||||
// manifests to a valid, unique port. There must be as many
|
||||
// ValidUniqueListenerPorts as there are listeners in the set of manifests.
|
||||
// For example, given two Gateways, each with 2 listeners, there should be
|
||||
// four ValidUniqueListenerPorts.
|
||||
// If empty or nil, ports are not modified.
|
||||
ValidUniqueListenerPorts []int
|
||||
|
||||
// CleanupBaseResources indicates whether or not the base test
|
||||
// resources such as Gateways should be cleaned up after the run.
|
||||
@@ -130,8 +123,7 @@ func New(s Options) *ConformanceTestSuite {
|
||||
BaseManifests: s.BaseManifests,
|
||||
GatewayAddress: s.GatewayAddress,
|
||||
Applier: kubernetes.Applier{
|
||||
NamespaceLabels: s.NamespaceLabels,
|
||||
ValidUniqueListenerPorts: s.ValidUniqueListenerPorts,
|
||||
NamespaceLabels: s.NamespaceLabels,
|
||||
},
|
||||
SupportedFeatures: s.SupportedFeatures,
|
||||
TimeoutConfig: s.TimeoutConfig,
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//go:build conformance
|
||||
// +build conformance
|
||||
|
||||
// Copyright (c) 2022 Alibaba Group Holding Ltd.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -30,8 +27,6 @@ import (
|
||||
"sigs.k8s.io/controller-runtime/pkg/client/config"
|
||||
)
|
||||
|
||||
var useUniquePorts = flag.Bool("use-unique-ports", true, "whether to use unique ports")
|
||||
|
||||
func TestHigressConformanceTests(t *testing.T) {
|
||||
flag.Parse()
|
||||
|
||||
@@ -43,28 +38,20 @@ func TestHigressConformanceTests(t *testing.T) {
|
||||
|
||||
require.NoError(t, v1.AddToScheme(client.Scheme()))
|
||||
|
||||
validUniqueListenerPorts := []int{
|
||||
80,
|
||||
443,
|
||||
}
|
||||
|
||||
if !*useUniquePorts {
|
||||
validUniqueListenerPorts = []int{}
|
||||
}
|
||||
|
||||
cSuite := suite.New(suite.Options{
|
||||
Client: client,
|
||||
IngressClassName: *flags.IngressClassName,
|
||||
Debug: *flags.ShowDebug,
|
||||
CleanupBaseResources: *flags.CleanupBaseResources,
|
||||
ValidUniqueListenerPorts: validUniqueListenerPorts,
|
||||
SupportedFeatures: map[suite.SupportedFeature]bool{},
|
||||
GatewayAddress: "localhost",
|
||||
Client: client,
|
||||
IngressClassName: *flags.IngressClassName,
|
||||
Debug: *flags.ShowDebug,
|
||||
CleanupBaseResources: *flags.CleanupBaseResources,
|
||||
SupportedFeatures: map[suite.SupportedFeature]bool{},
|
||||
GatewayAddress: "localhost",
|
||||
})
|
||||
|
||||
cSuite.Setup(t)
|
||||
higressTests := []suite.ConformanceTest{
|
||||
tests.HTTPRouteSimpleSameNamespace,
|
||||
tests.HTTPRouteHostNameSameNamespace,
|
||||
}
|
||||
|
||||
cSuite.Run(t, higressTests)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user