forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add ability to override/add extra helm flags for ginkgo tests.
This adds -cilium.install-helm-overrides flag which provides a way to add or override test flags without modifying the test code. This is useful for forked projects to extend testing by providing their own custom flags to the test program. For example, you could extend the tests by doing: -cilium.install-helm-overrides="foo=bar,\"zap={a,b,c}\"" which would add: --set foo=bar and --set zap={a,b,c} to the cilium install params. Signed-off-by: Tom Hadlaw <tom.hadlaw@isovalent.com>
- Loading branch information
1 parent
b189c57
commit 2aabd55
Showing
3 changed files
with
65 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright Authors of Cilium | ||
|
||
package helpers | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func Test_parseHelmOverrides(t *testing.T) { | ||
// This should be able to parse key value pairs, including those | ||
// where the value has commas but is delimited by quotes. | ||
overridesStr := "key1=value1,\"key2={a,b,c}\",\"key3={}\"" | ||
expected := map[string]string{ | ||
"key1": "value1", | ||
"key2": "{a,b,c}", | ||
"key3": "{}", | ||
} | ||
overrides := map[string]string{} | ||
parseHelmOverrides(overridesStr, overrides) | ||
assert.Equal(t, expected, overrides) | ||
} |