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
Copy file name to clipboardExpand all lines: docs/hugo/content/contributing/testing.md
+15-16Lines changed: 15 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,33 +13,31 @@ Basic use: run `task controller:test-integration-envtest`.
13
13
| AZURE_SUBSCRIPTION_ID | The Azure Subscription ID | Yes | Yes (when recording) |
14
14
| AZURE_TENANT_ID | The Azure Tenant ID | Yes | Yes (when recording) |
15
15
| TEST_BILLING_ID | The Azure billing ID | No | Yes (when recording SubscriptionAlias tests) |
16
-
| CODECOV_TOKEN | The token to https://app.codecov.io/gh/Azure/azure-service-operator| Yes | No |
17
-
| GH_PAT | GitHub PAT, used for PR automation | Yes | No |
16
+
| CODECOV_TOKEN | The token to <https://app.codecov.io/gh/Azure/azure-service-operator>| Yes | No |
18
17
| REGISTRY_LOGIN | The Azure Container Registry to log in to (for az acr login --name {name}) | Yes | No |
19
18
| REGISTRY_PRERELEASE | The path to the container prerelease registry (right now this isn't used) | No | No |
20
19
| REGISTRY_PUBLIC | The path to the container release registry, used in --tag "{REGISTRY_PUBLIC}/{CONTROLLER_DOCKER_IMAGE}" | No | No |
21
20
22
-
23
21
### Record/replay
24
22
25
-
The task `controller:test-integration-envtest` runs the tests in a record/replay mode by default, so that it does not
26
-
touch any live Azure resources. (This uses the [go-vcr](https://github.com/dnaeon/go-vcr) library.) If you change the controller or other code in
23
+
The task `controller:test-integration-envtest` runs the tests in a record/replay mode by default, so that it does not
24
+
touch any live Azure resources. (This uses the [go-vcr](https://github.com/dnaeon/go-vcr) library.) If you change the controller or other code in
27
25
such a way that the required requests/responses from ARM change, you will need to update the recordings.
28
26
29
-
To do this, delete the recordings for the failing tests (under `{test-dir}/recordings/{test-name}.yaml`), and re-run
30
-
`controller:test-integration-envtest`. If the test passes, a new recording will be saved, which you can commit to
27
+
To do this, delete the recordings for the failing tests (under `{test-dir}/recordings/{test-name}.yaml`), and re-run
28
+
`controller:test-integration-envtest`. If the test passes, a new recording will be saved, which you can commit to
31
29
include with your change. All authentication and subscription information is removed from the recording.
32
30
33
-
To run the test and produce a new recording you will need to have set the required authentication environment variables
34
-
`AZURE_SUBSCRIPTION_ID` and `AZURE_TENANT_ID`, _and_ logged in via `az login` (or you just use the `task` commands
35
-
mentioned below and it will prompt you to `az login` if needed for that specific command).
31
+
To run the test and produce a new recording you will need to have set the required authentication environment variables
32
+
`AZURE_SUBSCRIPTION_ID` and `AZURE_TENANT_ID`, _and_ logged in via `az login` (or you just use the `task` commands
33
+
mentioned below and it will prompt you to `az login` if needed for that specific command).
36
34
Note that you must be `Owner` on the subscription to execute some tests in record mode.
37
35
38
-
A few tests also need the `TEST_BILLING_ID` environment variable set to a valid Azure Billing ID when running in record mode.
39
-
In replay mode this variable is never required. Note that the billing ID is redacted from all recording files so that
36
+
A few tests also need the `TEST_BILLING_ID` environment variable set to a valid Azure Billing ID when running in record mode.
37
+
In replay mode this variable is never required. Note that the billing ID is redacted from all recording files so that
40
38
the resulting file can be replayed by anybody, even somebody who does not know the Billing ID the test was recorded with.
41
39
42
-
Some Azure resources take longer to provision or delete than the default test timeout of 15m. To change the timeout,
40
+
Some Azure resources take longer to provision or delete than the default test timeout of 15m. To change the timeout,
43
41
set `TIMEOUT` to a suitable value when running task. For example, to give your test a 60m timeout, use:
0 commit comments