From 415c9ef2e2e042fb0238055fa35517ec2b13930a Mon Sep 17 00:00:00 2001 From: Yvonnick Esnault Date: Thu, 16 Aug 2018 16:03:39 +0200 Subject: [PATCH] chore(venom): upgrade to 0.21.2 (#3208) Signed-off-by: Yvonnick Esnault --- Gopkg.lock | 8 +++++--- Gopkg.toml | 2 +- .../ovh/venom/executors/exec/executor.go | 8 ++++---- .../ovh/venom/executors/ovhapi/executor.go | 2 +- vendor/github.com/ovh/venom/process.go | 3 +-- vendor/github.com/ovh/venom/process_testsuite.go | 16 ++++++++++++++++ 6 files changed, 28 insertions(+), 11 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 797f2c6203..d366302a79 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1140,7 +1140,7 @@ revision = "02f7e9439689eda7ce4752c7f37e50cb678f2679" [[projects]] - digest = "1:36ecbd0dadbbfd1be08d278132ff90f045fcc31c8343cd44ef9cd9bbec88e69f" + digest = "1:738ac771d474430f5c1e60e203f90e61a5920a70441d6d880fe544ed7136797f" name = "github.com/ovh/venom" packages = [ ".", @@ -1160,8 +1160,8 @@ "executors/web", ] pruneopts = "NUT" - revision = "b18883989054a128a5a31d4099af2feed9adce8c" - version = "v0.21.1" + revision = "3229a223f0508cacfb55f28150194e89681e2901" + version = "v0.21.2" [[projects]] branch = "master" @@ -2118,7 +2118,9 @@ "go.opencensus.io/exporter/jaeger", "go.opencensus.io/exporter/prometheus", "go.opencensus.io/plugin/ochttp/propagation/b3", + "go.opencensus.io/stats", "go.opencensus.io/stats/view", + "go.opencensus.io/tag", "go.opencensus.io/trace", "go.opencensus.io/trace/propagation", "golang.org/x/crypto/openpgp", diff --git a/Gopkg.toml b/Gopkg.toml index 8f91fb4bbc..fbd2d6cd74 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -164,7 +164,7 @@ [[constraint]] name = "github.com/ovh/venom" - version = "0.21.1" + version = "0.21.2" [prune] non-go = true diff --git a/vendor/github.com/ovh/venom/executors/exec/executor.go b/vendor/github.com/ovh/venom/executors/exec/executor.go index 446b45c766..67ad284823 100644 --- a/vendor/github.com/ovh/venom/executors/exec/executor.go +++ b/vendor/github.com/ovh/venom/executors/exec/executor.go @@ -91,15 +91,15 @@ func (Executor) Run(testCaseContext venom.TestCaseContext, l venom.Logger, step // Create a tmp file tmpscript, errt := ioutil.TempFile(os.TempDir(), "venom-") if errt != nil { - return nil, fmt.Errorf("Cannot create tmp file: %s\n", errt) + return nil, fmt.Errorf("cannot create tmp file: %s\n", errt) } // Put script in file - l.Debugf("work with tmp file %s", tmpscript) + l.Debugf("work with tmp file %s", tmpscript.Name()) n, errw := tmpscript.Write([]byte(scriptContent)) if errw != nil || n != len(scriptContent) { if errw != nil { - return nil, fmt.Errorf("Cannot write script: %s\n", errw) + return nil, fmt.Errorf("cannot write script: %s\n", errw) } return nil, fmt.Errorf("cannot write all script: %d/%d\n", n, len(scriptContent)) } @@ -113,7 +113,7 @@ func (Executor) Run(testCaseContext venom.TestCaseContext, l venom.Logger, step //and add .PS1 extension newPath = newPath + ".PS1" if err := os.Rename(oldPath, newPath); err != nil { - return nil, fmt.Errorf("cannot rename script to add powershell Extension, aborting\n") + return nil, fmt.Errorf("cannot rename script to add powershell extension, aborting\n") } //This aims to stop a the very first error and return the right exit code psCommand := fmt.Sprintf("& { $ErrorActionPreference='Stop'; & %s ;exit $LastExitCode}", newPath) diff --git a/vendor/github.com/ovh/venom/executors/ovhapi/executor.go b/vendor/github.com/ovh/venom/executors/ovhapi/executor.go index 12af6bfceb..4d3dc802a8 100644 --- a/vendor/github.com/ovh/venom/executors/ovhapi/executor.go +++ b/vendor/github.com/ovh/venom/executors/ovhapi/executor.go @@ -134,7 +134,7 @@ func (Executor) Run(testCaseContext venom.TestCaseContext, l venom.Logger, step var contextHeader map[string]string err = ctx.GetComplex("headers", &contextHeader) - if err != nil && err != defaultctx.NotFound("headers") { + if err != nil && err.Error() != defaultctx.NotFound("headers").Error() { l.Warnf("fail to read headers from context : '%s'", err) } for key, value := range contextHeader { diff --git a/vendor/github.com/ovh/venom/process.go b/vendor/github.com/ovh/venom/process.go index 08a84151b3..d08add7bf9 100644 --- a/vendor/github.com/ovh/venom/process.go +++ b/vendor/github.com/ovh/venom/process.go @@ -44,8 +44,7 @@ func (v *Venom) Parse(path []string, exclude []string) error { extractedVars := []string{} for i := range v.testsuites { ts := &v.testsuites[i] - log.Info("Parsing testsuite", ts.Package) - + log.Info("Parsing testsuite ", ts.Package) tvars, textractedVars, err := v.parseTestSuite(ts) if err != nil { return err diff --git a/vendor/github.com/ovh/venom/process_testsuite.go b/vendor/github.com/ovh/venom/process_testsuite.go index 6b0d9ca834..df021ff257 100644 --- a/vendor/github.com/ovh/venom/process_testsuite.go +++ b/vendor/github.com/ovh/venom/process_testsuite.go @@ -4,6 +4,7 @@ import ( "fmt" "os" "runtime/pprof" + "strings" "time" "github.com/fatih/color" @@ -42,6 +43,21 @@ func (v *Venom) runTestSuite(ts *TestSuite) { ts.Templater.Add("", map[string]string{"venom.testsuite": ts.ShortName}) ts.Templater.Add("", map[string]string{"venom.testsuite.filename": ts.Filename}) + // we apply templater on current vars only + for index := 0; index < 10; index++ { + var toApply bool + for k, v := range ts.Templater.Values { + if strings.Contains(v, "{{") { + toApply = true + _, s := ts.Templater.apply([]byte(v)) + ts.Templater.Values[k] = string(s) + } + } + if !toApply { + break + } + } + totalSteps := 0 for _, tc := range ts.TestCases { totalSteps += len(tc.TestSteps)