Skip to content

Commit e708a7e

Browse files
committed
chore: fixed some test names and ensured tests always run in smoke tests
1 parent e388d0d commit e708a7e

File tree

2 files changed

+48
-10
lines changed

2 files changed

+48
-10
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 'Run Acceptance Tests'
2+
description: 'Run acceptance tests with validation that tests actually ran'
3+
inputs:
4+
test_pattern:
5+
description: 'Test pattern to pass to -run flag'
6+
required: true
7+
runs:
8+
using: 'composite'
9+
steps:
10+
- name: Run tests
11+
shell: bash
12+
run: |
13+
set -o pipefail
14+
EXECUTE_TESTS=true make testacc TESTARGS='-run="${{ inputs.test_pattern }}"' 2>&1 | tee test_output.txt
15+
if ! grep -q "=== RUN" test_output.txt; then
16+
echo "ERROR: No tests matched the pattern. Please check the -run argument."
17+
exit 1
18+
fi

.github/workflows/terraform_provider_pr.yml

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ jobs:
134134
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
135135
with:
136136
go-version-file: go.mod
137-
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudActiveActiveDatabase_CRUDI"'
137+
- uses: ./.github/actions/run-testacc
138+
with:
139+
test_pattern: TestAccResourceRedisCloudActiveActiveDatabase_CRUDI
138140

139141
go_test_smoke_aa_db_enable_default_user:
140142
name: go test smoke aa db enable default user
@@ -145,7 +147,9 @@ jobs:
145147
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
146148
with:
147149
go-version-file: go.mod
148-
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudActiveActiveDatabase_enableDefaultUser"'
150+
- uses: ./.github/actions/run-testacc
151+
with:
152+
test_pattern: TestAccResourceRedisCloudActiveActiveDatabase_enableDefaultUser
149153

150154
go_test_smoke_essentials_sub:
151155
name: go test smoke essentials sub
@@ -156,7 +160,9 @@ jobs:
156160
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
157161
with:
158162
go-version-file: go.mod
159-
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudEssentialsSubscription"'
163+
- uses: ./.github/actions/run-testacc
164+
with:
165+
test_pattern: TestAccResourceRedisCloudEssentialsSubscription
160166

161167

162168
go_test_smoke_essentials_db:
@@ -168,7 +174,9 @@ jobs:
168174
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
169175
with:
170176
go-version-file: go.mod
171-
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudEssentialsDatabase_CRUDI"'
177+
- uses: ./.github/actions/run-testacc
178+
with:
179+
test_pattern: TestAccResourceRedisCloudEssentialsDatabase_CRUDI
172180

173181
go_test_smoke_pro_db:
174182
name: go test smoke pro db
@@ -179,7 +187,9 @@ jobs:
179187
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
180188
with:
181189
go-version-file: go.mod
182-
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudProDatabase_CRUDI"'
190+
- uses: ./.github/actions/run-testacc
191+
with:
192+
test_pattern: TestAccResourceRedisCloudProDatabase_CRUDI
183193

184194

185195
go_test_smoke_misc:
@@ -191,7 +201,9 @@ jobs:
191201
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
192202
with:
193203
go-version-file: go.mod
194-
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloud(PrivateServiceConnect_CRUDI|AclRule_CRUDI)"'
204+
- uses: ./.github/actions/run-testacc
205+
with:
206+
test_pattern: TestAccResourceRedisCloud(PrivateServiceConnect_CRUDI|AclRule_CRUDI)
195207

196208
go_test_pro_db_upgrade:
197209
name: go test smoke pro db upgrade
@@ -202,7 +214,9 @@ jobs:
202214
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
203215
with:
204216
go-version-file: go.mod
205-
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudProDatabase_Upgrade"'
217+
- uses: ./.github/actions/run-testacc
218+
with:
219+
test_pattern: TestAccResourceRedisCloudProDatabase_Redis8_Upgrade
206220

207221
go_test_privatelink:
208222
name: go test smoke privatelink
@@ -213,7 +227,9 @@ jobs:
213227
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
214228
with:
215229
go-version-file: go.mod
216-
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudPrivateLink_CRUDI"'
230+
- uses: ./.github/actions/run-testacc
231+
with:
232+
test_pattern: TestAccResourceRedisCloudPrivateLink_CRUDI
217233

218234

219235
go_test_block_public_endpoints:
@@ -225,7 +241,9 @@ jobs:
225241
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
226242
with:
227243
go-version-file: go.mod
228-
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAcc(RedisCloudProDatabaseBlockPublicEndpoints|ActiveActiveSubscriptionDatabaseBlockPublicEndpoints)"'
244+
- uses: ./.github/actions/run-testacc
245+
with:
246+
test_pattern: TestAcc(RedisCloudProDatabase_BlockPublicEndpoints|ActiveActiveSubscriptionDatabase_BlockPublicEndpoints)
229247

230248
go_test_smoke_qpf:
231249
name: go test smoke query performance factor
@@ -236,7 +254,9 @@ jobs:
236254
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
237255
with:
238256
go-version-file: go.mod
239-
- run: EXECUTE_TESTS=true make testacc TESTARGS='-run="TestAccResourceRedisCloudProDatabase_qpf"'
257+
- uses: ./.github/actions/run-testacc
258+
with:
259+
test_pattern: TestAccResourceRedisCloudProDatabase_qpf
240260

241261
tfproviderlint:
242262
name: tfproviderlint

0 commit comments

Comments
 (0)