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-starlight/src/content/docs/03-community/01-contributing.mdx
+42-1Lines changed: 42 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -249,6 +249,47 @@ In general, we try to make sure that any test that requires a build tag is also
249
249
250
250
For example, all AWS tests are prefixed with `TestAws*`.
251
251
252
+
Terragrunt also includes integration tests for Google Cloud Platform (GCP). These tests are prefixed with `TestGcp*` and are tagged with the `gcp` build tag. To run these tests, you can use the `-tags` flag set in the `GOFLAGS` environment variable, similar to AWS tests:
253
+
254
+
```bash
255
+
GOFLAGS='-tags=gcp' go test -run 'TestGcp*'.
256
+
```
257
+
258
+
To successfully run the GCP tests, you must set the following environment variables:
259
+
260
+
-`GCLOUD_SERVICE_KEY`: The service account JSON key used for authentication.
261
+
-`GOOGLE_CLOUD_PROJECT` or `GOOGLE_PROJECT_ID`: The GCP project name.
262
+
-`GOOGLE_COMPUTE_ZONE`: The compute zone name.
263
+
-`GOOGLE_IDENTITY_EMAIL`: The service account identity email.
264
+
-`GCLOUD_SERVICE_KEY_IMPERSONATOR`: (Optional) An additional service account key used in impersonation tests.
265
+
266
+
Make sure these environment variables are set in your shell before running the tests. For example:
Given that Terragrunt is a tool that frequently involves concurrently running multiple things at once, there's always a risk for race conditions to occur. As such, there are dedicated tests that are run with the `-race` flag in CI to use golang's built-in tooling for identifying race conditions.
@@ -299,7 +340,7 @@ To accomplish these two goals, we have created an `errors` package that has seve
299
340
300
341
Here is how the `errors` package should be used:
301
342
302
-
1. Any time you want to create your own error, create a custom type for it, and when instantiating that type, wrap it with a call to `errors.New`. That way, any time you call a method defined in the Terragrunt code, you know the error it returns already has a stacktrace and you don’t have to wrap it yourself.
343
+
1. Any time you want to create your own error, create a custom type for it, and when instantiating that type, wrap it with a call to `errors.New`. That way, any time you call a method defined in the Terragrunt code, you know the error it returns already has a stacktrace and you don't have to wrap it yourself.
303
344
304
345
2. Any time you get back an error object from a function built into Go or a 3rd party library, immediately wrap it with `errors.New`. This gives us a stacktrace as close to the source as possible.
Copy file name to clipboardExpand all lines: docs/_docs/03_community/01-contributing.md
+42-1Lines changed: 42 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -278,6 +278,47 @@ In general, we try to make sure that any test that requires a build tag is also
278
278
279
279
For example, all AWS tests are prefixed with `TestAws*`.
280
280
281
+
Terragrunt also includes integration tests for Google Cloud Platform (GCP). These tests are prefixed with `TestGcp*` and are tagged with the `gcp` build tag. To run these tests, you can use the `-tags` flag set in the `GOFLAGS` environment variable, similar to AWS tests:
282
+
283
+
```bash
284
+
GOFLAGS='-tags=gcp' go test -run 'TestGcp*'.
285
+
```
286
+
287
+
To successfully run the GCP tests, you must set the following environment variables:
288
+
289
+
-`GCLOUD_SERVICE_KEY`: The service account JSON key used for authentication.
290
+
-`GOOGLE_CLOUD_PROJECT` or `GOOGLE_PROJECT_ID`: The GCP project name.
291
+
-`GOOGLE_COMPUTE_ZONE`: The compute zone name.
292
+
-`GOOGLE_IDENTITY_EMAIL`: The service account identity email.
293
+
-`GCLOUD_SERVICE_KEY_IMPERSONATOR`: (Optional) An additional service account key used in impersonation tests.
294
+
295
+
Make sure these environment variables are set in your shell before running the tests. For example:
Given that Terragrunt is a tool that frequently involves concurrently running multiple things at once, there's always a risk for race conditions to occur. As such, there are dedicated tests that are run with the `-race` flag in CI to use golang's built-in tooling for identifying race conditions.
@@ -328,7 +369,7 @@ To accomplish these two goals, we have created an `errors` package that has seve
328
369
329
370
Here is how the `errors` package should be used:
330
371
331
-
1. Any time you want to create your own error, create a custom type for it, and when instantiating that type, wrap it with a call to `errors.New`. That way, any time you call a method defined in the Terragrunt code, you know the error it returns already has a stacktrace and you don’t have to wrap it yourself.
372
+
1. Any time you want to create your own error, create a custom type for it, and when instantiating that type, wrap it with a call to `errors.New`. That way, any time you call a method defined in the Terragrunt code, you know the error it returns already has a stacktrace and you don't have to wrap it yourself.
332
373
333
374
2. Any time you get back an error object from a function built into Go or a 3rd party library, immediately wrap it with `errors.New`. This gives us a stacktrace as close to the source as possible.
0 commit comments