pulumi/sdk/nodejs/tests/automation/data/testproj
Will Jones 09accbf68a Use a file backend for NodeJS Automation API tests
The majority of our NodeJS Automation API tests are currently configured
to use the (default) option of a Pulumi Cloud backend. This is
undesirable for several reasons:

* Using Pulumi Cloud introduces a network into the mix, meaning there is
  a greater chance of tests flaking.
* Pulumi Cloud is essentially a massive shared global state, so if
  multiple tests run concurrently, we need to ensure that they don't
  interfere with each other. We thus have code to generate random stack
  names, projects, etc. to avoid these sorts of clashes. If we don't, we
  again run the risk of having flaky tests.
* It's slower than not using Pulumi Cloud/the network and instead using
  e.g. a local file-backed state.

This commit reworks as many tests as possible to use local file-backed
state. In doing so, we optimistically re-enable some previously skipped
tests that were marked as flaky. For hygiene, and in case there is a
chance we'll run multiple instances of the suite on a single instance in
CI, we use temporary directories for state where possible which are
aggressively cleaned up on test suite exit (see the `tmp` NPM package
which we already use elsewhere). For tests that use `Pulumi.yaml` files
(and thus must have a fixed `backend.url`), we use `file://~`, which is
already used in one test and seems to work just fine.

As a result of these changes, the tests run significantly faster (from
the order of tens of minutes to just a few, if that) and should in
theory be less (never, 🙏) flaky. Moreover, it's likely that we
could later remove some more of the code in our tests that e.g.
generates random names, since there should be no need for this any more.

Fixes #8061
Part of #15940
2024-07-18 13:50:55 +01:00
..
Pulumi.yaml Use a file backend for NodeJS Automation API tests 2024-07-18 13:50:55 +01:00
go.mod Update github.com/cloudflare/circl to v1.3.7 (#15151) 2024-01-16 08:59:57 +00:00
go.sum Update github.com/cloudflare/circl to v1.3.7 (#15151) 2024-01-16 08:59:57 +00:00
main.go ci: Simplify test listing, update go dependencies to 1.18 compat 2022-09-21 09:51:59 -07:00