Skip to content

Commit 2cc6376

Browse files
chore: Defines tests in CI for third_party_integration with minor fixes (#2215)
* fix: Define tests in CI for third_party_integration with minor fixes * allow tests to run in parallel * define changelog entry * revert change of making routing key required * fix assignments
1 parent aba23a3 commit 2cc6376

File tree

4 files changed

+386
-260
lines changed

4 files changed

+386
-260
lines changed

internal/service/thirdpartyintegration/data_source_third_party_integrations.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,24 @@ func flattenIntegrations(d *schema.ResourceData, integrations *matlas.ThirdParty
6565

6666
func integrationToSchema(d *schema.ResourceData, integration *matlas.ThirdPartyIntegration) map[string]any {
6767
integrationSchema := schemaToIntegration(d)
68+
6869
if integrationSchema.APIKey == "" {
6970
integrationSchema.APIKey = integration.APIKey
7071
}
7172
if integrationSchema.ServiceKey == "" {
72-
integrationSchema.APIKey = integration.ServiceKey
73+
integrationSchema.ServiceKey = integration.ServiceKey
7374
}
7475
if integrationSchema.APIToken == "" {
75-
integrationSchema.APIKey = integration.APIToken
76+
integrationSchema.APIToken = integration.APIToken
7677
}
7778
if integrationSchema.RoutingKey == "" {
78-
integrationSchema.APIKey = integration.RoutingKey
79+
integrationSchema.RoutingKey = integration.RoutingKey
7980
}
8081
if integrationSchema.Secret == "" {
81-
integrationSchema.APIKey = integration.Secret
82+
integrationSchema.Secret = integration.Secret
8283
}
8384
if integrationSchema.Password == "" {
84-
integrationSchema.APIKey = integration.Password
85-
}
86-
if integrationSchema.UserName == "" {
87-
integrationSchema.APIKey = integration.UserName
85+
integrationSchema.Password = integration.Password
8886
}
8987
if integrationSchema.URL == "" {
9088
integrationSchema.URL = integration.URL
@@ -97,11 +95,11 @@ func integrationToSchema(d *schema.ResourceData, integration *matlas.ThirdPartyI
9795
"service_key": integrationSchema.ServiceKey,
9896
"team_name": integration.TeamName,
9997
"channel_name": integration.ChannelName,
100-
"routing_key": integrationSchema.RoutingKey,
98+
"routing_key": integration.RoutingKey,
10199
"url": integrationSchema.URL,
102100
"secret": integrationSchema.Secret,
103101
"microsoft_teams_webhook_url": integrationSchema.MicrosoftTeamsWebhookURL,
104-
"user_name": integrationSchema.UserName,
102+
"user_name": integration.UserName,
105103
"password": integrationSchema.Password,
106104
"service_discovery": integration.ServiceDiscovery,
107105
"scheme": integration.Scheme,

internal/service/thirdpartyintegration/resource_third_party_integration_migration_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ import (
77
)
88

99
func TestMigThirdPartyIntegration_basic(t *testing.T) {
10-
mig.CreateAndRunTest(t, basicTestCase(t))
10+
// does not run in parallel to reuse same execution project
11+
mig.CreateAndRunTestNonParallel(t, basicPagerDutyTest(t))
1112
}

0 commit comments

Comments
 (0)