-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run system tests in parallel (#1909)
Adapt the code to be able to run the tests in parallel. Currently, it is just supported running in parallel tests for the system test runner. Added the required configuration files in some of the test packages to be able to test this parallelization. Moreover, it has been tried to decrease the log verbosity in some of the most repeated messages about container status and agent data.
- Loading branch information
Showing
25 changed files
with
522 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
// or more contributor license agreements. Licensed under the Elastic License; | ||
// you may not use this file except in compliance with the Elastic License. | ||
|
||
package testrunner | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
"os" | ||
"path/filepath" | ||
|
||
"github.com/elastic/go-ucfg" | ||
"github.com/elastic/go-ucfg/yaml" | ||
) | ||
|
||
type globalTestConfig struct { | ||
Asset GlobalRunnerTestConfig `config:"asset"` | ||
Pipeline GlobalRunnerTestConfig `config:"pipeline"` | ||
Policy GlobalRunnerTestConfig `config:"policy"` | ||
Static GlobalRunnerTestConfig `config:"static"` | ||
System GlobalRunnerTestConfig `config:"system"` | ||
} | ||
|
||
type GlobalRunnerTestConfig struct { | ||
Parallel bool `config:"parallel"` | ||
SkippableConfig `config:",inline"` | ||
} | ||
|
||
func ReadGlobalTestConfig(packageRootPath string) (*globalTestConfig, error) { | ||
configFilePath := filepath.Join(packageRootPath, "_dev", "test", "config.yml") | ||
|
||
data, err := os.ReadFile(configFilePath) | ||
if errors.Is(err, os.ErrNotExist) { | ||
return &globalTestConfig{}, nil | ||
} | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to read %s: %w", configFilePath, err) | ||
} | ||
|
||
var c globalTestConfig | ||
cfg, err := yaml.NewConfig(data, ucfg.PathSep(".")) | ||
if err != nil { | ||
return nil, fmt.Errorf("unable to load global test configuration file: %s: %w", configFilePath, err) | ||
} | ||
if err := cfg.Unpack(&c); err != nil { | ||
return nil, fmt.Errorf("unable to unpack global test configuration file: %s: %w", configFilePath, err) | ||
} | ||
|
||
return &c, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.