-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into gen-plugin
- Loading branch information
Showing
22 changed files
with
273 additions
and
87 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
/* | ||
Copyright 2018 Heptio Inc. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package app | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/heptio/sonobuoy/pkg/client" | ||
"github.com/heptio/sonobuoy/pkg/config" | ||
"github.com/heptio/sonobuoy/pkg/plugin" | ||
) | ||
|
||
func TestGetConfigWithMode(t *testing.T) { | ||
defaultPluginSearchPath := config.New().PluginSearchPath | ||
tcs := []struct { | ||
name string | ||
mode client.Mode | ||
inputcm *SonobuoyConfig | ||
expected *config.Config | ||
}{ | ||
{ | ||
name: "Conformance mode when supplied config is nil (nothing interesting happens)", | ||
mode: client.Conformance, | ||
inputcm: &SonobuoyConfig{}, | ||
expected: &config.Config{ | ||
PluginSelections: []plugin.Selection{ | ||
plugin.Selection{Name: "e2e"}, | ||
plugin.Selection{Name: "systemd-logs"}, | ||
}, | ||
PluginSearchPath: defaultPluginSearchPath, | ||
}, | ||
}, | ||
{ | ||
name: "Quick mode and a non-nil supplied config", | ||
mode: client.Quick, | ||
inputcm: &SonobuoyConfig{ | ||
Config: config.Config{ | ||
Aggregation: plugin.AggregationConfig{ | ||
BindAddress: "10.0.0.1", | ||
}, | ||
}, | ||
// TODO(chuckha) consider exporting raw or not depending on it. | ||
raw: "not nil", | ||
}, | ||
expected: &config.Config{ | ||
PluginSelections: []plugin.Selection{ | ||
plugin.Selection{Name: "e2e"}, | ||
}, | ||
Aggregation: plugin.AggregationConfig{ | ||
BindAddress: "10.0.0.1", | ||
BindPort: config.DefaultAggregationServerBindPort, | ||
}, | ||
PluginSearchPath: defaultPluginSearchPath, | ||
}, | ||
}, | ||
{ | ||
name: "Conformance mode with plugin selection specified", | ||
mode: client.Conformance, | ||
inputcm: &SonobuoyConfig{ | ||
Config: config.Config{ | ||
PluginSelections: []plugin.Selection{ | ||
plugin.Selection{ | ||
Name: "systemd-logs", | ||
}, | ||
}, | ||
}, | ||
raw: "not empty", | ||
}, | ||
expected: &config.Config{ | ||
PluginSelections: []plugin.Selection{ | ||
plugin.Selection{ | ||
Name: "systemd-logs", | ||
}, | ||
}, | ||
PluginSearchPath: defaultPluginSearchPath, | ||
Aggregation: plugin.AggregationConfig{ | ||
BindAddress: config.DefaultAggregationServerBindAddress, | ||
BindPort: config.DefaultAggregationServerBindPort, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
for _, tc := range tcs { | ||
t.Run(tc.name, func(t *testing.T) { | ||
conf := GetConfigWithMode(tc.inputcm, tc.mode) | ||
if len(conf.PluginSelections) != len(tc.expected.PluginSelections) { | ||
t.Fatalf("expected %v plugin selections but found %v", tc.expected.PluginSelections, conf.PluginSelections) | ||
} | ||
for _, ps := range conf.PluginSelections { | ||
found := false | ||
for _, expectedPs := range tc.expected.PluginSelections { | ||
if ps.Name == expectedPs.Name { | ||
found = true | ||
} | ||
} | ||
if !found { | ||
t.Fatalf("looking for plugin selection %v but did not find it", ps) | ||
} | ||
} | ||
}) | ||
} | ||
} |
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,13 @@ | ||
# Release | ||
|
||
## Steps to cut a release | ||
|
||
1. Bump the version defined in the code. As of the time of writing it is in | ||
`pkg/buildinfo/version.go`. | ||
2. Commit and open a pull request. | ||
3. Create a tag after that pull request gets squashed onto master. `git tag -a | ||
v0.11.1`. | ||
4. Push the tag with `git push --tags` (note this will push all tags). To push | ||
just one tag do something like: `git push <remote> refs/tags/v0.11.1` where | ||
`<remote>` refers to github.com/heptio/sonobuoy (this might be something like | ||
`upstream` or `origin`). If you are unsure, use the first option. |
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
Oops, something went wrong.