Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MM-42] Fix CI error: implicit memory aliasing #429

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading