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/content/test/run-tests.md
+43-4
Original file line number
Diff line number
Diff line change
@@ -59,16 +59,22 @@ aliases:
59
59
60
60
1. Run acceptance tests for only modified resources. (Full test runs can take over 9 hours.) See [Go's documentation](https://pkg.go.dev/cmd/go#hdr-Testing_flags) for more information about `-run` and other flags.
61
61
62
+
```bash
63
+
make testacc TEST=./google/services/container TESTARGS='-run=TestAccContainerNodePool_basic$$'
64
+
```
65
+
66
+
To run all tests matching, e.g., `TestAccContainerNodePool*`, omit the trailing `$$`:
67
+
62
68
```bash
63
69
make testacc TEST=./google/services/container TESTARGS='-run=TestAccContainerNodePool'
64
70
```
65
71
66
-
> **Note:** Acceptance tests create actual infrastructure which can incur costs. Acceptance tests may not clean up after themselves if interrupted, so you may want to check for stray resources and / or billing charges.
72
+
> **Note:** Acceptance tests create actual infrastructure which can incur costs. Acceptance tests may not clean up after themselves if interrupted, so you may want to check for stray resources and / or billing charges.
67
73
68
74
1. Optional: Save verbose test output (including API requests and responses) to a file for analysis.
69
75
70
76
```bash
71
-
TF_LOG=DEBUG make testacc TEST=./google/services/container TESTARGS='-run=TestAccContainerNodePool_basic' > output.log
77
+
TF_LOG=DEBUG make testacc TEST=./google/services/container TESTARGS='-run=TestAccContainerNodePool_basic$$' > output.log
72
78
```
73
79
74
80
1. Optional: Debug tests with [Delve](https://github.com/go-delve/delve). See [`dlv test` documentation](https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_test.md) for information about available flags.
@@ -95,12 +101,19 @@ aliases:
95
101
```bash
96
102
make testacc TEST=./google-beta/services/container TESTARGS='-run=TestAccContainerNodePool'
97
103
```
98
-
>**Note:** Acceptance tests create actual infrastructure which can incur costs. Acceptance tests may not clean up after themselves if interrupted, so you may want to check for stray resources and / or billing charges.
104
+
105
+
To run all tests matching, e.g., `TestAccContainerNodePool*`, omit the trailing `$$`:
106
+
107
+
```bash
108
+
make testacc TEST=./google-beta/services/container TESTARGS='-run=TestAccContainerNodePool'
109
+
```
110
+
111
+
>**Note:** Acceptance tests create actual infrastructure which can incur costs. Acceptance tests may not clean up after themselves if interrupted, so you may want to check for stray resources and / or billing charges.
99
112
100
113
1. Optional: Save verbose test output to a file for analysis.
101
114
102
115
```bash
103
-
TF_LOG=DEBUG make testacc TEST=./google-beta/services/container TESTARGS='-run=TestAccContainerNodePool_basic'> output.log
116
+
TF_LOG=DEBUG make testacc TEST=./google-beta/services/container TESTARGS='-run=TestAccContainerNodePool_basic$$'> output.log
104
117
```
105
118
106
119
1. Optional: Debug tests with [Delve](https://github.com/go-delve/delve). See [`dlv test` documentation](https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_test.md) for information about available flags.
@@ -290,6 +303,32 @@ Configure Terraform to use locally-built binaries for `google` and `google-beta`
VCR tests record HTTP request/response interactions in cassettes and replay them in future runs without calling the real API.
309
+
310
+
Running tests in`REPLAYING` mode locally can sometimes be useful. In particular, it can allow you to test more quickly, cheaply, and without spinning up real infrastructure, once you've got an initial recording.
311
+
312
+
It can also be helpful for debugging tests that seem to work locally, but fail in CI in replaying mode.
313
+
314
+
VCR is controlled via two variables:
315
+
- `VCR_MODE`: `REPLAYING` or `RECORDING` mode
316
+
- `VCR_PATH`: Path where recorded cassettes are stored.
317
+
318
+
Ensure both variables are configured to properly trigger VCR tests locally.
319
+
320
+
If you don't already have an existing cassette that's up to date, first do a run in `RECORDING` mode:
321
+
322
+
```bash
323
+
VCR_PATH=$HOME/.vcr/ VCR_MODE=RECORDING make testacc TEST=./google/services/alloydb TESTARGS='-run=TestAccContainerNodePool_basic$$'
324
+
```
325
+
326
+
Now run the same test again in `REPLAYING` mode:
327
+
328
+
```bash
329
+
VCR_PATH=$HOME/.vcr/ VCR_MODE=REPLAYING make testacc TEST=./google/services/alloydb TESTARGS='-run=TestAccContainerNodePool_basic$$'
330
+
```
331
+
293
332
### Cleanup
294
333
295
334
To stop using developer overrides, stop setting `TF_CLI_CONFIG_FILE` in the commands you are executing.
Copy file name to clipboardExpand all lines: mmv1/products/accesscontextmanager/ServicePerimeter.yaml
+18
Original file line number
Diff line number
Diff line change
@@ -384,6 +384,15 @@ properties:
384
384
- name: 'accessLevel'
385
385
type: String
386
386
description: 'An AccessLevel resource name that allows resources outside the ServicePerimeter to be accessed from the inside.'
387
+
- name: 'resource'
388
+
type: String
389
+
description: |
390
+
A Google Cloud resource that is allowed to egress the perimeter.
391
+
Requests from these resources are allowed to access data outside the perimeter.
392
+
Currently only projects are allowed. Project format: `projects/{project_number}`.
393
+
The resource may be in any Google Cloud organization, not just the
394
+
organization that the perimeter is defined in. `*` is not allowed, the
395
+
case of allowing all Google Cloud resources only is not supported.
387
396
- name: 'sourceRestriction'
388
397
type: Enum
389
398
description: 'Whether to enforce traffic restrictions based on `sources` field. If the `sources` field is non-empty, then this field must be set to `SOURCE_RESTRICTION_ENABLED`.'
@@ -693,6 +702,15 @@ properties:
693
702
- name: 'accessLevel'
694
703
type: String
695
704
description: 'An AccessLevel resource name that allows resources outside the ServicePerimeter to be accessed from the inside.'
705
+
- name: 'resource'
706
+
type: String
707
+
description: |
708
+
A Google Cloud resource that is allowed to egress the perimeter.
709
+
Requests from these resources are allowed to access data outside the perimeter.
710
+
Currently only projects are allowed. Project format: `projects/{project_number}`.
711
+
The resource may be in any Google Cloud organization, not just the
712
+
organization that the perimeter is defined in. `*` is not allowed, the
713
+
case of allowing all Google Cloud resources only is not supported.
696
714
- name: 'sourceRestriction'
697
715
type: Enum
698
716
description: 'Whether to enforce traffic restrictions based on `sources` field. If the `sources` field is non-empty, then this field must be set to `SOURCE_RESTRICTION_ENABLED`.'
Copy file name to clipboardExpand all lines: mmv1/products/accesscontextmanager/ServicePerimeterDryRunEgressPolicy.yaml
+9
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,15 @@ properties:
128
128
- name: 'accessLevel'
129
129
type: String
130
130
description: 'An AccessLevel resource name that allows resources outside the ServicePerimeter to be accessed from the inside.'
131
+
- name: 'resource'
132
+
type: String
133
+
description: |
134
+
A Google Cloud resource that is allowed to egress the perimeter.
135
+
Requests from these resources are allowed to access data outside the perimeter.
136
+
Currently only projects are allowed. Project format: `projects/{project_number}`.
137
+
The resource may be in any Google Cloud organization, not just the
138
+
organization that the perimeter is defined in. `*` is not allowed, the
139
+
case of allowing all Google Cloud resources only is not supported.
131
140
- name: 'sourceRestriction'
132
141
type: Enum
133
142
description: 'Whether to enforce traffic restrictions based on `sources` field. If the `sources` field is non-empty, then this field must be set to `SOURCE_RESTRICTION_ENABLED`.'
Copy file name to clipboardExpand all lines: mmv1/products/accesscontextmanager/ServicePerimeterEgressPolicy.yaml
+9
Original file line number
Diff line number
Diff line change
@@ -125,6 +125,15 @@ properties:
125
125
- name: 'accessLevel'
126
126
type: String
127
127
description: 'An AccessLevel resource name that allows resources outside the ServicePerimeter to be accessed from the inside.'
128
+
- name: 'resource'
129
+
type: String
130
+
description: |
131
+
A Google Cloud resource that is allowed to egress the perimeter.
132
+
Requests from these resources are allowed to access data outside the perimeter.
133
+
Currently only projects are allowed. Project format: `projects/{project_number}`.
134
+
The resource may be in any Google Cloud organization, not just the
135
+
organization that the perimeter is defined in. `*` is not allowed, the
136
+
case of allowing all Google Cloud resources only is not supported.
128
137
- name: 'sourceRestriction'
129
138
type: Enum
130
139
description: 'Whether to enforce traffic restrictions based on `sources` field. If the `sources` field is non-empty, then this field must be set to `SOURCE_RESTRICTION_ENABLED`.'
Copy file name to clipboardExpand all lines: mmv1/products/accesscontextmanager/ServicePerimeters.yaml
+18
Original file line number
Diff line number
Diff line change
@@ -373,6 +373,15 @@ properties:
373
373
- name: 'accessLevel'
374
374
type: String
375
375
description: 'An AccessLevel resource name that allows resources outside the ServicePerimeter to be accessed from the inside.'
376
+
- name: 'resource'
377
+
type: String
378
+
description: |
379
+
A Google Cloud resource that is allowed to egress the perimeter.
380
+
Requests from these resources are allowed to access data outside the perimeter.
381
+
Currently only projects are allowed. Project format: `projects/{project_number}`.
382
+
The resource may be in any Google Cloud organization, not just the
383
+
organization that the perimeter is defined in. `*` is not allowed, the
384
+
case of allowing all Google Cloud resources only is not supported.
376
385
- name: 'sourceRestriction'
377
386
type: Enum
378
387
description: 'Whether to enforce traffic restrictions based on `sources` field. If the `sources` field is non-empty, then this field must be set to `SOURCE_RESTRICTION_ENABLED`.'
@@ -674,6 +683,15 @@ properties:
674
683
- name: 'accessLevel'
675
684
type: String
676
685
description: 'An AccessLevel resource name that allows resources outside the ServicePerimeter to be accessed from the inside.'
686
+
- name: 'resource'
687
+
type: String
688
+
description: |
689
+
A Google Cloud resource that is allowed to egress the perimeter.
690
+
Requests from these resources are allowed to access data outside the perimeter.
691
+
Currently only projects are allowed. Project format: `projects/{project_number}`.
692
+
The resource may be in any Google Cloud organization, not just the
693
+
organization that the perimeter is defined in. `*` is not allowed, the
694
+
case of allowing all Google Cloud resources only is not supported.
677
695
- name: 'sourceRestriction'
678
696
type: Enum
679
697
description: 'Whether to enforce traffic restrictions based on `sources` field. If the `sources` field is non-empty, then this field must be set to `SOURCE_RESTRICTION_ENABLED`.'
0 commit comments