Skip to content

Commit 1e662a7

Browse files
author
Uddipaan Hazarika
committed
upgraded gorelease and tests
1 parent f9c89d3 commit 1e662a7

File tree

6 files changed

+448
-3
lines changed

6 files changed

+448
-3
lines changed

.goreleaser.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Visit https://goreleaser.com for documentation on how to customize this
22
# behavior.
3+
version: 2
34
env:
4-
- PROVIDER_VERSION=3.4.0
5+
- PROVIDER_VERSION=4.0.0
56
before:
67
hooks:
78
# this is just an example and not a requirement for provider building/publishing
89
- go mod tidy
910
snapshot:
10-
name_template: '{{ .Env.PROVIDER_VERSION }}'
11+
version_template: '{{ .Env.PROVIDER_VERSION }}'
1112
builds:
1213
- env:
1314
# goreleaser does not work with CGO, it could also complicate
@@ -41,7 +42,7 @@ builds:
4142
- CP_TARGET={{ .Target }}
4243
- CP_VERSION={{ .Env.PROVIDER_VERSION }}
4344
archives:
44-
- format: zip
45+
- formats: [ 'zip' ]
4546
name_template: '{{ .ProjectName }}_{{ .Env.PROVIDER_VERSION }}_{{ .Os }}_{{ .Arch }}'
4647
checksum:
4748
extra_files:

internal/provider/resource_appdata_dsource_test.go

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,33 @@ resource "delphix_appdata_dsource" "new_data_dsource" {
8585
sync_parameters = jsonencode({
8686
resync = true
8787
})
88+
tags {
89+
key = "dlpx"
90+
value = "acc-test"
91+
}
92+
ops_pre_sync {
93+
name = "string-change-opspresync22"
94+
command = "ls -lr"
95+
shell = "bash"
96+
credentials_env_vars {
97+
base_var_name = "mypass2t"
98+
password = "password_test"
99+
}
100+
credentials_env_vars {
101+
base_var_name = "mypass3t"
102+
password = "password_test"
103+
}
104+
}
105+
106+
ops_post_sync {
107+
name = "string-change-opspostsync22"
108+
command = "ls -lrta"
109+
shell = "bash"
110+
credentials_env_vars {
111+
base_var_name = "mypassopspostsynct"
112+
password = "password_test"
113+
}
114+
}
88115
}
89116
`, sourceId, groupId, name, environmentUser, stagingEnvironment, parameters)
90117
}
@@ -105,6 +132,33 @@ resource "delphix_appdata_dsource" "new_data_dsource" {
105132
sync_parameters = jsonencode({
106133
resync = true
107134
})
135+
tags {
136+
key = "dlpx"
137+
value = "acc-test"
138+
}
139+
ops_pre_sync {
140+
name = "string-change-opspresync22"
141+
command = "ls -lr"
142+
shell = "bash"
143+
credentials_env_vars {
144+
base_var_name = "mypass2t"
145+
password = "password_test"
146+
}
147+
credentials_env_vars {
148+
base_var_name = "mypass3t"
149+
password = "password_test"
150+
}
151+
}
152+
153+
ops_post_sync {
154+
name = "string-change-opspostsync22"
155+
command = "ls -lrta"
156+
shell = "bash"
157+
credentials_env_vars {
158+
base_var_name = "mypassopspostsynct"
159+
password = "password_test"
160+
}
161+
}
108162
}
109163
`, sourceId, groupId, name, environmentUser, stagingEnvironment, parameters)
110164
}

internal/provider/resource_database_postgresql_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ func testsourceBasic(repo_value string, name string) string {
5757
resource "delphix_database_postgresql" "new_dsource" {
5858
repository_value = "%s"
5959
name = "%s"
60+
tags {
61+
key = "dlpx"
62+
value = "acc-test"
63+
}
6064
}
6165
`, repo_value, name)
6266
}
@@ -89,6 +93,10 @@ func testsourceUpdate(repo_value string, name string) string {
8993
resource "delphix_database_postgresql" "new_dsource" {
9094
repository_value = "%s"
9195
name = "%s"
96+
tags {
97+
key = "dlpx"
98+
value = "acc-test"
99+
}
92100
}
93101
`, repo_value, name)
94102
}

internal/provider/resource_environment_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ func testAccCheckDctEnvConfigBasic(engineId string, username string, password st
127127
hostname = "%s"
128128
toolkit_path = "%s"
129129
}
130+
tags {
131+
key = "dlpx"
132+
value = "acc-test"
133+
}
130134
}
131135
`, engineId, escape(username), escape(password), env_name, escape(hostname), escape(toolkitPath))
132136
}
@@ -194,6 +198,10 @@ func testAccEnvUpdatePositive(engineId string, username string, password string,
194198
hostname = "%s"
195199
toolkit_path = "%s"
196200
}
201+
tags {
202+
key = "dlpx-changed"
203+
value = "acc-test-changed"
204+
}
197205
}
198206
`, engineId, escape(username), escape(password), escape(hostname), escape(toolkitPath))
199207
}
@@ -210,6 +218,10 @@ func testAccEnvUpdateNegative(engineId string, username string, password string,
210218
hostname = "%s"
211219
toolkit_path = "%s"
212220
}
221+
tags {
222+
key = "dlpx"
223+
value = "acc-test"
224+
}
213225
}
214226
`, engineId, escape(username), escape(password), env_name, escape(hostname), escape(toolkitPath))
215227
}

internal/provider/resource_oracle_dsource_test.go

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,45 @@ resource "delphix_oracle_dsource" "test_oracle_dsource" {
6969
name = "%s"
7070
source_value = "%s"
7171
group_id = "%s"
72+
tags {
73+
key = "dlpx"
74+
value = "acc-test"
75+
}
76+
ops_pre_sync {
77+
name = "string-change-opspresync22"
78+
command = "ls -lr"
79+
shell = "bash"
80+
credentials_env_vars {
81+
base_var_name = "mypass2t"
82+
password = "password_test"
83+
}
84+
credentials_env_vars {
85+
base_var_name = "mypass3t"
86+
password = "password_test"
87+
}
88+
}
89+
90+
ops_post_sync {
91+
name = "string-change-opspostsync22"
92+
command = "ls -lrta"
93+
shell = "bash"
94+
credentials_env_vars {
95+
base_var_name = "mypassopspostsynct"
96+
password = "password_test"
97+
}
98+
}
99+
100+
ops_pre_log_sync {
101+
name = "string-change-opsprelogsync22"
102+
command = "ls -lrt"
103+
shell = "shell"
104+
credentials_env_vars {
105+
base_var_name = "mypassopsprelogsynct"
106+
password = "password_test"
107+
}
108+
}
72109
}
110+
73111
`, name, sourceValue, groupId)
74112
}
75113

@@ -79,6 +117,43 @@ resource "delphix_oracle_dsource" "test_oracle_dsource" {
79117
name = "%s"
80118
source_value = "%s"
81119
description = "%s"
120+
tags {
121+
key = "dlpx"
122+
value = "acc-test"
123+
}
124+
ops_pre_sync {
125+
name = "string-change-opspresync22"
126+
command = "ls -lr"
127+
shell = "bash"
128+
credentials_env_vars {
129+
base_var_name = "mypass2t"
130+
password = "password_test"
131+
}
132+
credentials_env_vars {
133+
base_var_name = "mypass3t"
134+
password = "password_test"
135+
}
136+
}
137+
138+
ops_post_sync {
139+
name = "string-change-opspostsync22"
140+
command = "ls -lrta"
141+
shell = "bash"
142+
credentials_env_vars {
143+
base_var_name = "mypassopspostsynct"
144+
password = "password_test"
145+
}
146+
}
147+
148+
ops_pre_log_sync {
149+
name = "string-change-opsprelogsync22"
150+
command = "ls -lrt"
151+
shell = "shell"
152+
credentials_env_vars {
153+
base_var_name = "mypassopsprelogsynct"
154+
password = "password_test"
155+
}
156+
}
82157
}
83158
`, name, sourceValue, description)
84159
}

0 commit comments

Comments
 (0)