diff --git a/cli/venom/run/cmd.go b/cli/venom/run/cmd.go index ee4f68dd..08c87b29 100644 --- a/cli/venom/run/cmd.go +++ b/cli/venom/run/cmd.go @@ -42,7 +42,6 @@ var ( outputDir string strict bool noCheckVars bool - parallel int stopOnFailure bool enableProfiling bool v *venom.Venom @@ -55,7 +54,6 @@ func init() { Cmd.Flags().BoolVarP(&strict, "strict", "", false, "Exit with an error code if one test fails") Cmd.Flags().BoolVarP(&stopOnFailure, "stop-on-failure", "", false, "Stop running Test Suite on first Test Case failure") Cmd.Flags().BoolVarP(&noCheckVars, "no-check-variables", "", false, "Don't check variables before run") - Cmd.Flags().IntVarP(¶llel, "parallel", "", 1, "--parallel=2 : launches 2 Test Suites in parallel") Cmd.PersistentFlags().StringVarP(&logLevel, "log", "", "warn", "Log Level : debug, info, warn or disable") Cmd.PersistentFlags().StringVarP(&outputDir, "output-dir", "", "", "Output Directory: create tests results file inside this directory") Cmd.PersistentFlags().BoolVarP(&enableProfiling, "profiling", "", false, "Enable Mem / CPU Profile with pprof") @@ -103,7 +101,6 @@ Notice that variables initialized with -var-from-file argument can be overrided v.LogLevel = logLevel v.OutputDir = outputDir v.OutputFormat = format - v.Parallel = parallel v.StopOnFailure = stopOnFailure if v.EnableProfiling { diff --git a/process.go b/process.go index 94bc569c..1a560238 100644 --- a/process.go +++ b/process.go @@ -7,7 +7,6 @@ import ( "os" "path/filepath" "strings" - "sync" nested "github.com/antonfisher/nested-logrus-formatter" "github.com/gosimple/slug" @@ -163,48 +162,26 @@ func (v *Venom) Process(ctx context.Context, path []string) (*Tests, error) { return nil, err } - chanEnd := make(chan *TestSuite, 1) - parallels := make(chan *TestSuite, v.Parallel) //Run testsuite in parrallel - wg := sync.WaitGroup{} testsResult := &Tests{} - wg.Add(len(v.testsuites)) - chanToRun := make(chan *TestSuite, len(v.testsuites)+1) - - go v.computeStats(testsResult, chanEnd, &wg) - go func() { - for ts := range chanToRun { - parallels <- ts - go func(ts *TestSuite) { - v.runTestSuite(ctx, ts) - chanEnd <- ts - <-parallels - }(ts) - } - }() - for i := range v.testsuites { - chanToRun <- &v.testsuites[i] + v.runTestSuite(ctx, &v.testsuites[i]) + v.computeStats(testsResult, &v.testsuites[i]) } - wg.Wait() - return testsResult, nil } -func (v *Venom) computeStats(testsResult *Tests, chanEnd <-chan *TestSuite, wg *sync.WaitGroup) { - for t := range chanEnd { - testsResult.TestSuites = append(testsResult.TestSuites, *t) - if t.Failures > 0 || t.Errors > 0 { - testsResult.TotalKO += (t.Failures + t.Errors) - } else { - testsResult.TotalOK += len(t.TestCases) - (t.Failures + t.Errors) - } - if t.Skipped > 0 { - testsResult.TotalSkipped += t.Skipped - } - - testsResult.Total = testsResult.TotalKO + testsResult.TotalOK + testsResult.TotalSkipped - wg.Done() +func (v *Venom) computeStats(testsResult *Tests, ts *TestSuite) { + testsResult.TestSuites = append(testsResult.TestSuites, *ts) + if ts.Failures > 0 || ts.Errors > 0 { + testsResult.TotalKO += (ts.Failures + ts.Errors) + } else { + testsResult.TotalOK += len(ts.TestCases) - (ts.Failures + ts.Errors) } + if ts.Skipped > 0 { + testsResult.TotalSkipped += ts.Skipped + } + + testsResult.Total = testsResult.TotalKO + testsResult.TotalOK + testsResult.TotalSkipped } diff --git a/venom.go b/venom.go index 75f041f3..27d61a41 100644 --- a/venom.go +++ b/venom.go @@ -39,7 +39,6 @@ type Venom struct { testsuites []TestSuite variables H IgnoreVariables []string - Parallel int EnableProfiling bool OutputFormat string