-
Notifications
You must be signed in to change notification settings - Fork 129
Allow to define more than one service deployer and choose the deployer via configuration setting #2638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Allow to define more than one service deployer and choose the deployer via configuration setting #2638
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9668301
Include new configuration to use specific deployer
mrodm 3ef9cb9
Add test package
mrodm 924e8ad
Remove variants file
mrodm 85e4b24
Update readme new package
mrodm cd59c57
Override service name in system test configuration files
mrodm 1264d69
Add validation for deployer test system configuration
mrodm 6c1b880
Add comments
mrodm d4bdfa0
Add false positive test
mrodm 159c9ca
Fix findAgentDeployers
mrodm 3c764bd
Remove last new line from expected errors
mrodm ae4142b
Update regex in expected error
mrodm 358e938
Add another false positive error
mrodm 15e83cc
Fix regex for the error of the second false positive test
mrodm c48a988
Update docs about system testing
mrodm ba96214
Return just one element in findAgentDeployer
mrodm 02b4144
Fail agent setup if unexpected deployers are found
mrodm 97676f4
Update false positive tests for nginx_missing_deployer
mrodm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ import ( | |
| "os" | ||
| "path/filepath" | ||
| "regexp" | ||
| "slices" | ||
| "strings" | ||
| "time" | ||
|
|
||
|
|
@@ -24,7 +25,10 @@ import ( | |
| "github.com/elastic/elastic-package/internal/testrunner" | ||
| ) | ||
|
|
||
| var systemTestConfigFilePattern = regexp.MustCompile(`^test-([a-z0-9_.-]+)-config.yml$`) | ||
| var ( | ||
| systemTestConfigFilePattern = regexp.MustCompile(`^test-([a-z0-9_.-]+)-config.yml$`) | ||
| allowedDeployerNames = []string{"docker", "k8s", "tf"} | ||
jsoriano marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ) | ||
|
|
||
| type testConfig struct { | ||
| testrunner.SkippableConfig `config:",inline"` | ||
|
|
@@ -37,6 +41,8 @@ type testConfig struct { | |
| WaitForDataTimeout time.Duration `config:"wait_for_data_timeout"` | ||
| SkipIgnoredFields []string `config:"skip_ignored_fields"` | ||
|
|
||
| Deployer string `config:"deployer"` // Name of the service deployer to use for this test. | ||
|
|
||
| Vars common.MapStr `config:"vars"` | ||
| DataStream struct { | ||
| Vars common.MapStr `config:"vars"` | ||
|
|
@@ -129,6 +135,11 @@ func newConfig(configFilePath string, svcInfo servicedeployer.ServiceInfo, servi | |
| c.Agent.PreStartScript.Language = agentdeployer.DefaultAgentProgrammingLanguage | ||
| } | ||
|
|
||
| // Not included in package-spec validation for deployer name | ||
| if c.Deployer != "" && !slices.Contains(allowedDeployerNames, c.Deployer) { | ||
| return nil, fmt.Errorf("invalid deployer name %q in system test configuration file %q, allowed values are: %s", c.Deployer, configFilePath, strings.Join(allowedDeployerNames, ", ")) | ||
| } | ||
|
Comment on lines
+138
to
+141
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added validation here instead of package-spec. In package-spec this file has |
||
|
|
||
| return &c, nil | ||
| } | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used the same functions as in the
servicedeployermodule.