You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# For all other providers, install them directly from their origin provider
@@ -163,6 +164,16 @@ To make your contribution, follow these steps:
163
164
5. Create a pull request with your changes.
164
165
6. The pull request will be reviewed by the repo maintainers. If you need to make further changes, make additional commits to keep commit history. When the PR is merged, commits will be squashed.
165
166
167
+
> [!TIP]
168
+
>
169
+
> To ensure smooth review and integration of your code contributions, follow these guidelines:
170
+
>
171
+
> **Break down large changes into smaller PRs**: Separate new features or bigger changes into multiple smaller Pull Requests.
172
+
> This allows us to provide earlier feedback and makes it easier to review your PR.
173
+
>
174
+
> **Create a draft PR for early feedback**: If you want feedback during the implementation process, create a draft PR so we can have a look.
175
+
176
+
166
177
## Bug Reports
167
178
168
179
If you would like to report a bug, please open a [GitHub issue](https://github.com/stackitcloud/terraform-provider-stackit/issues/new).
Copy file name to clipboardExpand all lines: README.md
+52-6Lines changed: 52 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -207,22 +207,68 @@ If you don't need these fields, don't set the experiment flag `network`, to use
207
207
208
208
## Acceptance Tests
209
209
210
+
> [!WARNING]
211
+
> Acceptance tests will create real resources, which may incur in costs.
212
+
> Some resource may leftover after a test run. This could happen if the tests are modified, tests are stopped during the run or losing the network connection.
213
+
> These resource must be removed manually with the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli) or the STACKIT Portal.
214
+
210
215
Terraform acceptance tests are run using the command `make test-acceptance-tf`. For all services,
211
216
212
217
- The env var `TF_ACC_PROJECT_ID` must be set with the ID of the STACKIT test project to test it.
218
+
- The env var `TF_ACC_REGION` must be set with the region in which the tests should be run.
213
219
- Authentication is set as usual.
214
220
- Optionally, the env var `TF_ACC_XXXXXX_CUSTOM_ENDPOINT` (where `XXXXXX` is the uppercase name of the service) can be set to use endpoints other than the default value.
215
221
- There are some acceptance test where it is needed to provide additional parameters, some of them have default values in order to run normally without manual interaction. Those default values can be overwritten (see testutils.go for a full list.)
216
222
217
223
Additionally:
218
224
219
-
- For the Resource Manager service:
220
-
- A service account with permissions to create and delete projects is required
221
-
- The env var `TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_EMAIL` must be set as the email of the service account
222
-
- The env var `TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_TOKEN` must be set as a valid token of the service account. Can also be set in the credentials file used by authentication (see [Authentication](#authentication) for more details)
223
-
- The env var `TF_ACC_PROJECT_ID` is ignored
225
+
| Env var | Value | Example value | needed for Acc tests of the following services |
|`TF_ACC_ORGANIZATION_ID`| ID of the STACKIT test organization |`5353ccfa-a984-4b96-a71d-b863dd2b7087`|`authorization`, `iaas`|
228
+
|`TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_EMAIL`| Email of the STACKIT service account |`[email protected]`|`authorization`, `resourcemanager`|
229
+
|`TF_ACC_SERVER_ID`| ID of a STACKIT Server with STACKIT Server Agent enabled |`5353ccfa-a984-4b96-a71d-b863dd2b7087`|`serverbackup`, `serverupdate`|
230
+
|`TF_ACC_TEST_PROJECT_PARENT_CONTAINER_ID`| Container ID of the project parent container (folder within an organization or the organization itself) |`organization-d2b7087`|`resourcemanager`|
231
+
|`TF_ACC_TEST_PROJECT_PARENT_UUID`| UUID ID of the project parent container (folder within an organization or the organization itself) |`5353ccfa-a984-4b96-a71d-b863dd2b7087`|`resourcemanager`|
232
+
233
+
### Run Acceptance Tests of a single service
234
+
235
+
> [!WARNING]
236
+
> Acceptance tests will create real resources, which may incur in costs.
237
+
> Some resource may leftover after a test run. This could happen if the tests are modified, tests are stopped during the run or losing the network connection.
238
+
> These resource must be removed manually with the [STACKIT CLI](https://github.com/stackitcloud/stackit-cli) or the STACKIT Portal.
239
+
240
+
For running the acceptance tests of a single service, set the required env vars from above.
241
+
Set the env var `TF_ACC=1`, to enable the acceptance tests.
242
+
243
+
Start the acceptance tests:
244
+
245
+
1. Configure your env vars in a file, e.g.
246
+
```sh
247
+
# acc-tests.env
248
+
export TF_ACC="1"
249
+
export TF_ACC_REGION="eu01"
250
+
...
251
+
```
252
+
2. Read the env vars from the file
253
+
```sh
254
+
source acc-tests.env
255
+
```
256
+
3. Start the acceptance tests
257
+
```sh
258
+
$ go test -timeout=60m -v stackit/internal/services/<service>/<service>_acc_test.go
259
+
```
260
+
261
+
Alternative, set your env vars inline and start the acceptance test:
go test -timeout=60m -v stackit/internal/services/<service>/<service>_acc_test.go
268
+
```
269
+
224
270
225
-
**WARNING:** Acceptance tests will create real resources, which may incur in costs.
271
+
For some services the acceptance tests take more time. By setting the timeout via the flag `-timeout=` to a higher time, you ensure that the tests will not be stopped.
0 commit comments