kezhenxu94 commented on a change in pull request #13:
URL:
https://github.com/apache/skywalking-infra-e2e/pull/13#discussion_r589267071
##########
File path: internal/config/e2eConfig.go
##########
@@ -53,6 +52,10 @@ type Run struct {
Waits []Wait `yaml:"wait"`
}
+func (r Run) GetRunCommand() string {
+ return r.Command
+}
Review comment:
If we don't need extra operations when getting a public field, let's use
`Run.Command` directly
##########
File path: internal/components/setup/common.go
##########
@@ -0,0 +1,117 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package setup
+
+import (
+ "fmt"
+ "io/ioutil"
+ "strings"
+ "time"
+
+ "github.com/apache/skywalking-infra-e2e/internal/config"
+ "github.com/apache/skywalking-infra-e2e/internal/logger"
+ "github.com/apache/skywalking-infra-e2e/internal/util"
+)
+
+// RunCommandsAndWait Concurrently run commands and wait for conditions.
+func RunCommandsAndWait(runs []config.Run, timeout time.Duration) error {
+ waitSet := util.NewWaitSet(timeout)
+
+ for idx := range runs {
+ run := runs[idx]
+ command := run.Command
+ if len(command) < 1 {
+ continue
+ }
+
+ commands := strings.Split(command, "\n")
Review comment:
I'm afraid this is buggy when the users configure the command like this
in yaml:
```yaml
setup:
runs:
- command: |
istioctl install --profile=demo -y \
--set values.xxxx=xxxx \
--set values.yyyy=yyyy
kubectl create deployment nginx1 --image=nginx
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]