kezhenxu94 commented on a change in pull request #3:
URL: https://github.com/apache/skywalking-infra-e2e/pull/3#discussion_r564290704
##########
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:
> I have a question about it, if i use e2e command in folder1 with
e2e.yaml, then i use e2e command in folder2 with another e2e.yaml, how could it
switch to the next e2e.yaml?
Hey, @Humbertzhang , "read the config only once, then the config could be
shared among commands" means that if you run `e2e` command, all the
sub-commands such as `e2e setup`, `e2e trigger`, `e2e verify` INSIDE THHIS
EXECUTION would share the same config without parsing again and again the same
`e2e.yaml`. If you switch to another folder, that's another execution of `e2e`
command.
The basic idea is that, we will compose `setup`, `trigger`, `verify`
sub-commands inside a single `e2e run` command, all the sub-commands needs the
same `e2e.yaml` config file. Make sense?
----------------------------------------------------------------
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]