Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sharmaansh21 authored and Anshul Sharma committed Dec 7, 2023
1 parent e6b755c commit c0be8b4
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions pkg/kn/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,14 @@ func TestBootstrapConfig(t *testing.T) {
plugins:
directory: /tmp
profiles:
istio:
knative:
labels:
- name: environment

Check failure on line 41 in pkg/kn/config/config_test.go

View workflow job for this annotation

GitHub Actions / style / Golang / Lint

[trailing whitespace] reported by reviewdog 🐶 - name: environment Raw Output: pkg/kn/config/config_test.go:41: - name: environment
value: "test"
value: "knative"
annotations:
- name: sidecar.istio.io/inject
- name: sidecar.knative.io/inject

Check failure on line 44 in pkg/kn/config/config_test.go

View workflow job for this annotation

GitHub Actions / style / Golang / Lint

[trailing whitespace] reported by reviewdog 🐶 - name: sidecar.knative.io/inject Raw Output: pkg/kn/config/config_test.go:44: - name: sidecar.knative.io/inject
value: "true"
- name: sidecar.istio.io/rewriteAppHTTPProbers
value: "true"
- name: serving.knative.openshift.io/enablePassthrough
- name: sidecar.knative.io/rewriteAppHTTPProbers
value: "true"
eventing:
sink-mappings:
Expand Down Expand Up @@ -85,11 +83,21 @@ eventing:
Value: "true",
},
})
assert.Equal(t, len(GlobalConfig.Profile("istio").Labels), 1)
assert.DeepEqual(t, GlobalConfig.Profile("istio").Labels, []NamedValue{
assert.DeepEqual(t, GlobalConfig.Profile("knative").Annotations, []NamedValue{
{
Name: "sidecar.knative.io/inject",
Value: "true",
},
{
Name: "sidecar.knative.io/rewriteAppHTTPProbers",
Value: "true",
},
})
assert.Equal(t, len(GlobalConfig.Profile("knative").Labels), 1)
assert.DeepEqual(t, GlobalConfig.Profile("knative").Labels, []NamedValue{
{
Name: "environment",
Value: "test",
Value: "knative",
},
})
assert.DeepEqual(t, (GlobalConfig.SinkMappings())[0], SinkMapping{
Expand Down

0 comments on commit c0be8b4

Please sign in to comment.