mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-27 16:17:34 +00:00
Feat: optimize the e2e test case
Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
This commit is contained in:
@@ -955,6 +955,7 @@ options: {
|
||||
Expect(err).Should(BeNil())
|
||||
Expect(len(urls)).Should(Equal(len(endpoints)))
|
||||
for i, e := range endpoints {
|
||||
fmt.Println(e.String())
|
||||
Expect(urls[i]).Should(Equal(e.String()))
|
||||
}
|
||||
})
|
||||
|
||||
@@ -175,17 +175,22 @@ func (o *VelaPortForwardOptions) Init(ctx context.Context, cmd *cobra.Command, a
|
||||
fmt.Println("The Service you specified does not exist, please select it from the list.")
|
||||
}
|
||||
}
|
||||
if selectService == nil {
|
||||
selectService, o.targetPort, err = AskToChooseOneService(services, len(o.Args) < 2)
|
||||
if err != nil {
|
||||
return err
|
||||
if len(services) > 0 {
|
||||
if selectService == nil {
|
||||
selectService, o.targetPort, err = AskToChooseOneService(services, len(o.Args) < 2)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
if selectService != nil {
|
||||
o.targetResource.cluster = selectService.Cluster
|
||||
o.targetResource.name = selectService.Object.GetName()
|
||||
o.targetResource.namespace = selectService.Object.GetNamespace()
|
||||
o.targetResource.kind = selectService.Object.GetKind()
|
||||
if selectService != nil {
|
||||
o.targetResource.cluster = selectService.Cluster
|
||||
o.targetResource.name = selectService.Object.GetName()
|
||||
o.targetResource.namespace = selectService.Object.GetNamespace()
|
||||
o.targetResource.kind = selectService.Object.GetKind()
|
||||
}
|
||||
} else if o.ResourceName == "" {
|
||||
// If users do not specify the resource name and there is no service, switch to query the pod
|
||||
o.ResourceType = "pod"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -9,7 +9,9 @@ spec:
|
||||
type: webservice
|
||||
properties:
|
||||
image: crccheck/hello-world
|
||||
port: 8000
|
||||
ports:
|
||||
- port: 8000
|
||||
expose: true
|
||||
traits:
|
||||
- type: scaler
|
||||
properties:
|
||||
|
||||
@@ -9,7 +9,9 @@ spec:
|
||||
type: webservice
|
||||
properties:
|
||||
image: crccheck/hello-world
|
||||
port: 8000
|
||||
ports:
|
||||
- port: 8000
|
||||
expose: true
|
||||
traits:
|
||||
- type: scaler
|
||||
properties:
|
||||
|
||||
+9
-10
@@ -9,20 +9,19 @@ spec:
|
||||
type: webservice
|
||||
properties:
|
||||
image: crccheck/hello-world
|
||||
port: 8000
|
||||
ports:
|
||||
- port: 8000
|
||||
expose: true
|
||||
policies:
|
||||
- name: env-policy
|
||||
type: env-binding
|
||||
type: topology
|
||||
properties:
|
||||
envs:
|
||||
- name: test
|
||||
placement:
|
||||
clusterSelector:
|
||||
name: cluster-worker
|
||||
clusters:
|
||||
- cluster-worker
|
||||
workflow:
|
||||
steps:
|
||||
- name: deploy-test
|
||||
type: deploy2env
|
||||
type: deploy
|
||||
properties:
|
||||
policy: env-policy
|
||||
env: test
|
||||
policies:
|
||||
- env-policy
|
||||
|
||||
@@ -9,7 +9,9 @@ spec:
|
||||
type: webservice
|
||||
properties:
|
||||
image: crccheck/hello-world
|
||||
port: 8000
|
||||
ports:
|
||||
- port: 8000
|
||||
expose: true
|
||||
type: webservice
|
||||
traits:
|
||||
- type: rollout
|
||||
|
||||
Reference in New Issue
Block a user