This is an automated email from the ASF dual-hosted git repository.

zhangke pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-infra-e2e.git


The following commit(s) were added to refs/heads/main by this push:
     new ef42a63  Polish some functions in setup and trigger
ef42a63 is described below

commit ef42a638ea6d201b16be0e2dc81dce93475209c7
Author: Humbert Zhang <[email protected]>
AuthorDate: Wed Apr 7 22:46:10 2021 +0800

    Polish some functions in setup and trigger
    
    * Add name for setup's step, so that we can know what step we are in.
    * Environment variables are supported in trigger url
---
 examples/simple/e2e.yaml            | 9 ++++++---
 internal/components/setup/kind.go   | 2 ++
 internal/components/trigger/http.go | 4 ++++
 internal/config/e2eConfig.go        | 1 +
 4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/examples/simple/e2e.yaml b/examples/simple/e2e.yaml
index 46505ee..7dc69f1 100644
--- a/examples/simple/e2e.yaml
+++ b/examples/simple/e2e.yaml
@@ -19,7 +19,8 @@ setup:
   env: kind
   file: kind.yaml
   steps:
-    - command: |
+    - name: install istio
+      command: |
         # kind k8s cluster is in $TMPDIR
         cp $TMPDIR/e2e-k8s.config ~/.kube/config
         export ISTIO_VERSION=1.9.1
@@ -28,12 +29,14 @@ setup:
             --set 
meshConfig.defaultConfig.envoyMetricsService.address=skywalking-oap.istio-system:11800
 \
             --set values.telemetry.v2.enabled=false
         kubectl label namespace default istio-injection=enabled
-    - path: busybox1.yaml,manifests
+    - name: setup manifests
+      path: busybox1.yaml,manifests
       wait:
         - namespace: default
           resource: pod
           for: condition=Ready
-    - command: |
+    - name: setup nginx deployment
+      command: |
         kubectl create deployment nginx1 --image=nginx
       wait:
         - namespace: default
diff --git a/internal/components/setup/kind.go 
b/internal/components/setup/kind.go
index 3108f58..1c8e0f1 100644
--- a/internal/components/setup/kind.go
+++ b/internal/components/setup/kind.go
@@ -89,6 +89,8 @@ func KindSetup(e2eConfig *config.E2EConfig) error {
        timeNow := time.Now()
 
        for _, step := range e2eConfig.Setup.Steps {
+               logger.Log.Infof("processing setup step [%s]", step.Name)
+
                if step.Path != "" && step.Command == "" {
                        manifest := config.Manifest{
                                Path:  step.Path,
diff --git a/internal/components/trigger/http.go 
b/internal/components/trigger/http.go
index 5c602de..5a4e308 100644
--- a/internal/components/trigger/http.go
+++ b/internal/components/trigger/http.go
@@ -20,6 +20,7 @@ package trigger
 import (
        "fmt"
        "net/http"
+       "os"
        "strings"
        "time"
 
@@ -45,6 +46,9 @@ func NewHTTPAction(intervalStr string, times int, url, method 
string) Action {
                return nil
        }
 
+       // there can be env variables in url, say, 
"http://${GATEWAY_HOST}:${GATEWAY_PORT}/test";
+       url = os.ExpandEnv(url)
+
        return &httpAction{
                interval: interval,
                times:    times,
diff --git a/internal/config/e2eConfig.go b/internal/config/e2eConfig.go
index 4758473..dfbc617 100644
--- a/internal/config/e2eConfig.go
+++ b/internal/config/e2eConfig.go
@@ -40,6 +40,7 @@ type Cleanup struct {
 }
 
 type Step struct {
+       Name    string `yaml:"name"`
        Path    string `yaml:"path"`
        Command string `yaml:"command"`
        Waits   []Wait `yaml:"wait"`

Reply via email to