mirror of https://github.com/pulumi/pulumi.git
6f0ee42b7c
13033: test(sdk/npm): Don't download from NPM or Yarn regstries r=Frassle a=abhinav Follow up to #12983 Tests that download from NPM or Yarn will be brittle, unsafe, and slow. We don't need to hit these servers directly. This change alters the package installation tests to set up a local HTTP server that implements a subset of the [NPM Package Registry API][1] -- just enough to satisfy these tests. [1]: https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md In the tests, we'll set `$HOME` to a new temporary directory and write an `~/.npmrc` or `~/.yarnrc` requesting use of the local server as the registry. With this, the tests are entirely local. No external requests. Also contains minor fix-ups to the test that were pointed out in #12983: - Use 'require' in chdir - Use subtests for `Test*Install` - Don't send command output to /dev/null These fix-ups are in separate commits to keep the meat of this change independently reviewable. Co-authored-by: Abhinav Gupta <abhinav@pulumi.com> |
||
---|---|---|
.. | ||
manager.go | ||
manager_test.go | ||
npm.go | ||
npm_test.go | ||
yarn.go |