generated from hashicorp/terraform-provider-scaffolding-framework
-
Notifications
You must be signed in to change notification settings - Fork 4
205 lines (199 loc) · 8.41 KB
/
testacc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: Acceptance Tests
# In the future, we will need to figure out how we want to run acceptance tests
# since creation of deployments and clusters are costly
on:
pull_request:
push:
branches:
- main
paths-ignore:
- 'README.md'
schedule:
- cron: '30 21 * * 1' # Runs every Monday at 2:30PST for stage environment
- cron: '30 21 * * 2,5' # Runs every Tuesday and Friday at 2:30PST for dev environment
# Testing only needs permissions to read the repository contents.
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: 'go.mod'
cache: true
- run: go mod download
- run: go build -v .
testacc:
# This job runs on push to main branch.
name: Terraform Provider Acceptance Tests
needs: build
timeout-minutes: 180 # 3 hours since cluster creation and cluster updates can take a while
strategy:
fail-fast: true
matrix:
# list whatever Terraform versions here you would like to support
terraform:
- latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: 'go.mod'
cache: true
- uses: hashicorp/setup-terraform@651471c36a6092792c552e8b1bef71e592b462d8 # v3.1.1
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false
- run: go mod download
- name: Determine if expensive tests should run
run: |
git fetch --all
echo "CHECKING FILES FOR SKIP LOGIC..."
SKIP_TESTS="True"
FILES_TO_CHECK=(
"internal/provider/schemas/deployment.go"
"internal/provider/schemas/cluster.go"
"internal/provider/models/deployment.go"
"internal/provider/models/cluster.go"
"internal/provider/resources/resource_cluster.go"
"internal/provider/resources/resource_cluster_test.go"
"internal/provider/resources/resource_deployment.go"
"internal/provider/resources/common_cluster.go"
)
for file in "${FILES_TO_CHECK[@]}"; do
if git diff --name-only remotes/origin/${{ github.base_ref }} remotes/origin/${{ github.head_ref }} | grep -q "$file"; then
SKIP_TESTS="False"
break
fi
done
echo "SKIP_CLUSTER_RESOURCE_TESTS=$SKIP_TESTS"
echo "SKIP_CLUSTER_RESOURCE_TESTS=$SKIP_TESTS" >> $GITHUB_ENV
- env:
TF_ACC: "1"
HYBRID_ORGANIZATION_API_TOKEN: ${{ secrets.DEV_HYBRID_ORGANIZATION_API_TOKEN }}
HYBRID_ORGANIZATION_ID: clx44v7op01nf01m5iohqjkk6
HOSTED_ORGANIZATION_API_TOKEN: ${{ secrets.DEV_HOSTED_ORGANIZATION_API_TOKEN }}
HOSTED_ORGANIZATION_ID: clx42kkcm01fo01o06agtmshg
HOSTED_SCIM_ORGANIZATION_API_TOKEN: ${{ secrets.DEV_HOSTED_SCIM_ORGANIZATION_API_TOKEN }}
HOSTED_SCIM_ORGANIZATION_ID: clz3bcmd3003m01qemptnfenp
HYBRID_CLUSTER_ID: clxkqfzvm001d01ncr9rs80si
HYBRID_DRY_RUN_CLUSTER_ID: clxko4djp008601njcuoxt4z5
HYBRID_NODE_POOL_ID: clxkqfzvm001c01nc1eosyxzg
ASTRO_API_HOST: https://api.astronomer-dev.io
SKIP_CLUSTER_RESOURCE_TESTS: ${{ env.SKIP_CLUSTER_RESOURCE_TESTS }}
HOSTED_TEAM_ID: clx44rvzr01nc01o06pze6qb7
HOSTED_USER_ID: clz3a4ymt004x01on8w5ydq8j
HOSTED_DUMMY_USER_ID: clzawipbm00bm01qw98vzzoca
HOSTED_DEPLOYMENT_ID: cm1zkps2a0cv301ph39benet6
HOSTED_STANDARD_DEPLOYMENT_ID: cm070pg0r00wd01qgnskk0dir
HOSTED_WORKSPACE_ID: clx42sxw501gl01o0gjenthnh
HOSTED_API_TOKEN_ID: clxm4836f00ql01me3nigmcr6
TESTARGS: "-failfast"
run: make testacc
testacc-stage:
# This job runs every Monday.
name: Terraform Provider Acceptance Tests - Stage
needs: build
if: github.event_name == 'schedule' && github.event.schedule == 'cron(30 21 * * 1)'
timeout-minutes: 180 # 3 hours since cluster creation and cluster updates can take a while
strategy:
fail-fast: true
matrix:
terraform:
- latest
provider_version:
- v0.3.1
- v0.2.1
- v0.1.0-alpha
- main
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
ref: ${{ matrix.provider_version }}
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: 'go.mod'
cache: true
- uses: hashicorp/setup-terraform@651471c36a6092792c552e8b1bef71e592b462d8 # v3.1.1
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false
- run: go mod download
- env:
TF_ACC: "1"
HYBRID_ORGANIZATION_API_TOKEN: ${{ secrets.STAGE_HYBRID_ORGANIZATION_API_TOKEN }}
HYBRID_ORGANIZATION_ID: clx46ca4y061z01jleyku7sr6
HOSTED_ORGANIZATION_API_TOKEN: ${{ secrets.STAGE_HOSTED_ORGANIZATION_API_TOKEN }}
HOSTED_ORGANIZATION_ID: clx46acvv060e01ilddqlbsmc
HOSTED_SCIM_ORGANIZATION_API_TOKEN: ${{ secrets.STAGE_HOSTED_SCIM_ORGANIZATION_API_TOKEN }}
HOSTED_SCIM_ORGANIZATION_ID: clz3blqb500lh01mtkwu9zk5z
HYBRID_CLUSTER_ID: clxm3xg9e05bl01ixsrhxje4e
HYBRID_DRY_RUN_CLUSTER_ID: clxm3y54805bs01ix5owqhfff
HYBRID_NODE_POOL_ID: clxm3xg9e05bk01ixrqk52cob
ASTRO_API_HOST: https://api.astronomer-stage.io
HOSTED_TEAM_ID: clx486hno068301il306nuhsm
HOSTED_USER_ID: clz3a95hw00j301jj5jfmcgwd
HOSTED_DUMMY_USER_ID: clzawlsb701vv01ikvsqz5mws
HOSTED_DEPLOYMENT_ID: cly6exz4a00zd01k18t5bo1vf
HOSTED_STANDARD_DEPLOYMENT_ID: cm077ee2807g301kpjkqdoc15
HOSTED_WORKSPACE_ID: clx480rvx068u01j9mp7t7fqh
HOSTED_API_TOKEN_ID: clxm46ged05b301neuucdqwox
TESTARGS: "-failfast"
run: make testacc
testacc-dev:
# This job runs every Friday and Tuesday.
name: Terraform Provider Acceptance Tests - Dev
needs: build
if: github.event_name == 'schedule' && (github.event.schedule == 'cron(30 21 * * 2,5)')
timeout-minutes: 180 # 3 hours since cluster creation and cluster updates can take a while
strategy:
fail-fast: true
matrix:
terraform:
- latest
provider_version:
- v0.3.1
- v0.2.1
- v0.1.0-alpha
- main
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
ref: ${{ matrix.provider_version }}
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: 'go.mod'
cache: true
- uses: hashicorp/setup-terraform@651471c36a6092792c552e8b1bef71e592b462d8 # v3.1.1
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false
- run: go mod download
- env:
TF_ACC: "1"
HYBRID_ORGANIZATION_API_TOKEN: ${{ secrets.DEV_HYBRID_ORGANIZATION_API_TOKEN }}
HYBRID_ORGANIZATION_ID: clx44v7op01nf01m5iohqjkk6
HOSTED_ORGANIZATION_API_TOKEN: ${{ secrets.DEV_HOSTED_ORGANIZATION_API_TOKEN }}
HOSTED_ORGANIZATION_ID: clx42kkcm01fo01o06agtmshg
HOSTED_SCIM_ORGANIZATION_API_TOKEN: ${{ secrets.DEV_HOSTED_SCIM_ORGANIZATION_API_TOKEN }}
HOSTED_SCIM_ORGANIZATION_ID: clz3bcmd3003m01qemptnfenp
HYBRID_CLUSTER_ID: clxkqfzvm001d01ncr9rs80si
HYBRID_DRY_RUN_CLUSTER_ID: clxko4djp008601njcuoxt4z5
HYBRID_NODE_POOL_ID: clxkqfzvm001c01nc1eosyxzg
ASTRO_API_HOST: https://api.astronomer-dev.io
HOSTED_TEAM_ID: clx44rvzr01nc01o06pze6qb7
HOSTED_USER_ID: clz3a4ymt004x01on8w5ydq8j
HOSTED_DUMMY_USER_ID: clzawipbm00bm01qw98vzzoca
HOSTED_DEPLOYMENT_ID: cm1zkps2a0cv301ph39benet6
HOSTED_STANDARD_DEPLOYMENT_ID: cm070pg0r00wd01qgnskk0dir
HOSTED_WORKSPACE_ID: clx42sxw501gl01o0gjenthnh
HOSTED_API_TOKEN_ID: clxm4836f00ql01me3nigmcr6
TESTARGS: "-failfast"
run: make testacc