Skip to content

Commit

Permalink
support collecting all tests for a schedule to run by set Tests to *
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestjgq committed Jun 9, 2021
1 parent 9c9e3a4 commit 8c880ff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ type Schedule struct {
// Tests defined a test pipeline composed of one or more tests.
// For example: "test1[|test2[|test3...]]", where "test1", "test2", "test3"...
// are defined in Config.Tests.
//
// If you need execute all tests one by one, you may set Tests to "*" instead
// of specify them one by one explicitly. But note that the execute sequence
// is not defined.
Tests string

// TestBase is a special test that behavior like a super class of Tests, this is how
Expand Down
14 changes: 13 additions & 1 deletion internal/meter/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,19 @@ func loadConsumer(t *config.Test, cfg *config.Config) (consumer, error) {
func loadPlan(cfg *config.Config, s *config.Schedule) (*plan, error) {
var err error

tests := strings.Split(s.Tests, "|")
var tests []string
if s.Tests == "*" {
for k := range cfg.Tests {
if k == s.TestBase {
// ignore base test
continue
}
tests = append(tests, k)
}
} else {
tests = strings.Split(s.Tests, "|")
}

if len(tests) == 0 {
return nil, errors.Errorf("schedule %s contains no tests", s.Name)
}
Expand Down

0 comments on commit 8c880ff

Please sign in to comment.