You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/01/25 08:57:55 UTC

[GitHub] [skywalking-infra-e2e] wu-sheng commented on a change in pull request #3: Add setup and wait according to e2e.yaml

wu-sheng commented on a change in pull request #3:
URL: https://github.com/apache/skywalking-infra-e2e/pull/3#discussion_r563554117



##########
File path: commands/setup/setup.go
##########
@@ -49,9 +56,42 @@ var Setup = &cobra.Command{
 			if err := setup.KindSetupInCommand(); err != nil {
 				return err
 			}
+		} else if flags.Env == "" {
+			// setup according e2e.yaml
+			err := setupAccordingE2E()
+			if err != nil {
+				return err
+			}
 		} else {
 			return fmt.Errorf("no such env for setup: [%s]. should use kind or compose instead", flags.Env)
 		}
 		return nil
 	},
 }
+
+func setupAccordingE2E() error {
+	// setup according e2e.yaml
+	e2eFile := constant.E2EDefaultFile
+	logger.Log.Infof("reading e2e config file:%s", e2eFile)
+	data, err := ioutil.ReadFile(e2eFile)
+	if err != nil {
+		return err
+	}
+
+	e2eConfig := config.E2EConfig{}
+	err = yaml.Unmarshal(data, &e2eConfig)
+	if err != nil {
+		return err
+	}
+

Review comment:
       Once these settings are immutable, I think reading once is enough.




----------------------------------------------------------------
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:
users@infra.apache.org