Skip to content

Commit

Permalink
[MM-42] Fix CI error: implicit memory aliasing (#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
raghavaggarwal2308 authored Dec 20, 2023
1 parent 8130d66 commit 98fdf4f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion server/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ func TestAddWebhookCommand(t *testing.T) {
p.GitlabClient = mockedClient

conf := &model.Config{}
conf.ServiceSettings.SiteURL = &test.siteURL
conf.ServiceSettings.SiteURL = model.NewString(test.siteURL)

encryptedToken, _ := encrypt([]byte(testEncryptionKey), testGitlabToken)

Expand Down
18 changes: 9 additions & 9 deletions server/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,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 @@ -85,7 +85,7 @@ func TestSetDefaults(t *testing.T) {
},
}, {
description: "set encryption key",
config: configuration{
config: &configuration{
EncryptionKey: "",
},
shouldChange: true,
Expand All @@ -94,7 +94,7 @@ func TestSetDefaults(t *testing.T) {
},
}, {
description: "set webhook key",
config: configuration{
config: &configuration{
WebhookSecret: "",
},
shouldChange: true,
Expand All @@ -103,7 +103,7 @@ func TestSetDefaults(t *testing.T) {
},
}, {
description: "set webhook and encryption key",
config: configuration{
config: &configuration{
EncryptionKey: "",
WebhookSecret: "",
},
Expand All @@ -115,7 +115,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 @@ -128,7 +128,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 @@ -143,7 +143,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 @@ -163,7 +163,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 98fdf4f

Please sign in to comment.