Skip to content

Commit

Permalink
[MM-42] Fix ci error: implicit memory aliasing (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
raghavaggarwal2308 authored Dec 20, 2023
1 parent d8fb001 commit 56d7a60
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions server/plugin/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ func TestSetDefaults(t *testing.T) {
for _, testCase := range []struct {
description string
isCloud bool
config Configuration
config *Configuration

shouldChange bool
outputCheck func(*testing.T, *Configuration)
errMsg string
}{
{
description: "noop",
config: Configuration{
config: &Configuration{
EncryptionKey: "abcd",
WebhookSecret: "efgh",
},
Expand All @@ -82,7 +82,7 @@ func TestSetDefaults(t *testing.T) {
},
}, {
description: "set encryption key",
config: Configuration{
config: &Configuration{
EncryptionKey: "",
},
shouldChange: true,
Expand All @@ -91,7 +91,7 @@ func TestSetDefaults(t *testing.T) {
},
}, {
description: "set webhook key",
config: Configuration{
config: &Configuration{
WebhookSecret: "",
},
shouldChange: true,
Expand All @@ -100,7 +100,7 @@ func TestSetDefaults(t *testing.T) {
},
}, {
description: "set webhook and encryption key",
config: Configuration{
config: &Configuration{
EncryptionKey: "",
WebhookSecret: "",
},
Expand All @@ -112,7 +112,7 @@ func TestSetDefaults(t *testing.T) {
}, {
description: "Should not set UsePreregisteredApplication in on-prem",
isCloud: false,
config: Configuration{
config: &Configuration{
EncryptionKey: "abcd",
WebhookSecret: "efgh",
UsePreregisteredApplication: false,
Expand All @@ -125,7 +125,7 @@ func TestSetDefaults(t *testing.T) {
}, {
description: "Should set UsePreregisteredApplication in cloud if no OAuth secret is configured",
isCloud: true,
config: Configuration{
config: &Configuration{
EncryptionKey: "abcd",
WebhookSecret: "efgh",
UsePreregisteredApplication: false,
Expand All @@ -140,7 +140,7 @@ func TestSetDefaults(t *testing.T) {
}, {
description: "Should set not UsePreregisteredApplication in cloud if OAuth secret is configured",
isCloud: true,
config: Configuration{
config: &Configuration{
EncryptionKey: "abcd",
WebhookSecret: "efgh",
UsePreregisteredApplication: false,
Expand All @@ -160,7 +160,7 @@ func TestSetDefaults(t *testing.T) {
changed, err := testCase.config.setDefaults(testCase.isCloud)

assert.Equal(t, testCase.shouldChange, changed)
testCase.outputCheck(t, &testCase.config)
testCase.outputCheck(t, testCase.config)

if testCase.errMsg != "" {
require.Error(t, err)
Expand Down

0 comments on commit 56d7a60

Please sign in to comment.