pulumi/tests/examples
bors[bot] 92f5b4a374
Merge #10720 #10734
10720: ci: Enable programtests against local backend, improve isolation r=AaronFriel a=AaronFriel

These changes make integration tests run much more quickly on a local dev loop, for easily parallelized program tests like in the `integration_go_test.go` file the improvement was on the order of minutes across all tests.

The changes rely on setting `PULUMI_BACKEND_URL` to override the backend during particular tests. The backend is set to a temporary directory which is cleaned up on exit. 

A helper function `NewBackendUrl(t *testing.T)` is added to enable

When `PULUMI_TEST_USE_SERVICE=true`, the `RequireService` option is set to true.

When `RequireService == true`, the test is skipped if an access token is not present, improving local dev experience by skipping tests which would error very loudly.

When `RequireService == false and CloudURL == ""`, then we use the helper function to create a temporary directory and point the filestate backend to it. 

The CloudURL check allows tests which, even in the presence of `PULUMI_TEST_USE_SERVICE=true`, to still run against a local backend. E.g.: 

```go
	localTestOptions := testOptions.With(integration.ProgramTestOptions{
		CloudURL: integration.NewBackendURL(t),
	})
```

10734: prepare for next release (v3.41.0) r=AaronFriel a=pulumi-bot



Co-authored-by: Aaron Friel <mayreply@aaronfriel.com>
Co-authored-by: github-actions <github-actions@github.com>
2022-09-14 23:29:44 +00:00
..
dynamic-provider Move examples tests to /test/examples (#4196) 2020-03-26 20:19:18 -07:00
formattable Move examples tests to /test/examples (#4196) 2020-03-26 20:19:18 -07:00
minimal Move examples tests to /test/examples (#4196) 2020-03-26 20:19:18 -07:00
multilang/nodejs Update all references to pulumi so that source-map-support isn't deprecated anymore (#10032) 2022-07-01 20:31:57 +02:00
secrets Move examples tests to /test/examples (#4196) 2020-03-26 20:19:18 -07:00
examples_test.go Merge #10720 #10734 2022-09-14 23:29:44 +00:00