Skip to content

Commit b6549a4

Browse files
author
lec-bit
committed
update2
Signed-off-by: lec-bit <glfhzmy@126.com>
1 parent 1892f47 commit b6549a4

File tree

4 files changed

+46
-20
lines changed

4 files changed

+46
-20
lines changed

test/e2e/baseline_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//go:build integ
2-
// +build integ
1+
//go:build integ || all
2+
// +build integ all
33

44
/*
55
* Copyright The Kmesh Authors.

test/e2e/main_test.go

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//go:build integ
2-
// +build integ
1+
//go:build integ || all
2+
// +build integ all
33

44
/*
55
* Copyright The Kmesh Authors.
@@ -24,9 +24,11 @@ import (
2424
"time"
2525

2626
"istio.io/api/label"
27-
"istio.io/istio/pkg/config/protocol"
2827
"istio.io/istio/pkg/test/framework"
2928
"istio.io/istio/pkg/test/framework/components/echo"
29+
"istio.io/istio/pkg/test/framework/components/echo/common/ports"
30+
"istio.io/istio/pkg/test/framework/components/echo/deployment"
31+
"istio.io/istio/pkg/test/framework/components/echo/match"
3032
"istio.io/istio/pkg/test/framework/components/namespace"
3133
"istio.io/istio/pkg/test/framework/resource"
3234
)
@@ -38,10 +40,14 @@ var (
3840
type EchoDeployments struct {
3941
Namespace namespace.Instance
4042
All echo.Instances
43+
44+
// The echo service which is enrolled to Kmesh without waypoint.
45+
EnrolledToKmesh echo.Instances
4146
}
4247

4348
const (
4449
ServiceName = "echo-service"
50+
ServiceName2 = "echo-service2"
4551
EnrolledToKmesh = "enrolled-to-kmesh"
4652
Timeout = 2 * time.Minute
4753
KmeshReleaseName = "kmesh"
@@ -76,16 +82,12 @@ func SetupApps(t resource.Context, apps *EchoDeployments) error {
7682
return err
7783
}
7884

79-
builder := echo.New(t).
85+
builder := deployment.New(t).
8086
WithClusters(t.Clusters()...).
8187
WithConfig(echo.Config{
82-
Service: ServiceName,
83-
Namespace: apps.Namespace,
84-
Ports: echo.Ports{{
85-
Name: "http",
86-
Protocol: protocol.HTTP,
87-
Port: 8080,
88-
}},
88+
Service: ServiceName,
89+
Namespace: apps.Namespace,
90+
Ports: ports.All(),
8991
ServiceAccount: true,
9092
Subsets: []echo.SubsetConfig{
9193
{
@@ -105,6 +107,30 @@ func SetupApps(t resource.Context, apps *EchoDeployments) error {
105107
},
106108
},
107109
},
110+
}).
111+
WithConfig(echo.Config{
112+
Service: ServiceName2,
113+
Namespace: apps.Namespace,
114+
Ports: ports.All(),
115+
ServiceAccount: true,
116+
Subsets: []echo.SubsetConfig{
117+
{
118+
Replicas: 1,
119+
Version: "v1",
120+
Labels: map[string]string{
121+
"app": ServiceName2,
122+
"version": "v1",
123+
},
124+
},
125+
{
126+
Replicas: 1,
127+
Version: "v2",
128+
Labels: map[string]string{
129+
"app": ServiceName2,
130+
"version": "v2",
131+
},
132+
},
133+
},
108134
})
109135

110136
echos, err := builder.Build()
@@ -113,5 +139,7 @@ func SetupApps(t resource.Context, apps *EchoDeployments) error {
113139
}
114140

115141
apps.All = echos
142+
143+
apps.EnrolledToKmesh = match.ServiceName(echo.NamespacedName{Name: ServiceName2, Namespace: apps.Namespace}).GetMatches(echos)
116144
return nil
117145
}

test/e2e/restart_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//go:build integ
2-
// +build integ
1+
//go:build integ || all
2+
// +build integ all
33

44
/*
55
* Copyright The Kmesh Authors.
@@ -41,8 +41,8 @@ import (
4141

4242
func TestKmeshRestart(t *testing.T) {
4343
framework.NewTest(t).Run(func(t framework.TestContext) {
44-
src := apps.All[0]
45-
dst := apps.All[1]
44+
src := apps.All
45+
dst := apps.EnrolledToKmesh
4646
options := echo.CallOptions{
4747
To: dst,
4848
Count: 1,

test/e2e/run_test.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,13 @@ fi
278278
kubectl config use-context "kind-$NAME"
279279
echo "Running tests in cluster '$NAME'"
280280

281-
281+
sed -i 's/dual-engine/kernel-native/g' $ROOT_DIR/deploy/charts/kmesh-helm/values.yaml
282282
# make sure the Kmesh local image is ready.
283283
if [[ -z "${SKIP_SETUP:-}" ]]; then
284284
setup_istio
285285
setup_kmesh
286286
fi
287287

288-
sed -i 's/dual-engine/kernel-native/g' $ROOT_DIR/deploy/charts/kmesh-helm/values.yaml
289-
290288
cmd="go test -v -tags=integ $ROOT_DIR/test/e2e/... -istio.test.kube.loadbalancer=false ${PARAMS[*]}"
291289

292290
bash -c "$cmd"

0 commit comments

Comments
 (0)