7f0d7f4d12
In the `integration_test` CircleCI job, we run `yarn install` on all projects in the `integration/` directory. If a project has no lockfile or if the lockfile is out-of-sync with the corresponding `package.json` file, then the installed dependency versions are no longer pinned, which can result in different versions being installed between different runs of the same job (if, for example, a new version is released for a package) and breaks hermeticity. This could be prevented by using the `--frozen-lockfile` option with `yarn install`, but this is not possible with the current setup, because yarn needs to be able to install the locally built Angular packages, whose checksums will be different from the ones in the lockfile. Therefore, we have to manually ensure that the lockfiles remain in-sync with the corresponding `package.json` files for the rest of the dependencies. For example, previously, [cli-hello-world-lazy/yarn.lock][1] had an entry for `@angular-devkit/build-angular@0.900.0-next.9` (pinned to `0.900.0-next.9`), but [cli-hello-world-lazy/package.json][2] specified the `@angular-devkit/build-angular` version as `^0.900.0-rc.0` (note the leading caret). As a result, since the version in the lock file does not much the one in `package.json`, the lockfile is ignored and the latest available version that matches `^0.900.0-rc.0` is installed. This, for example, started causing unrelated CI failures ([example][3]), when `@angular-devkit/build-angular@9.0.0-rc.3` was released with a size improvement. This commit ensures that all integration projects have a lockfile and that lockfiles are up-to-date (with the current `package.json` files). [1]: https://github.com/angular/angular/blob/fc2f6b845/integration/cli-hello-world-lazy/yarn.lock#L13 [2]: https://github.com/angular/angular/blob/fc2f6b845/integration/cli-hello-world-lazy/package.json#L26 [3]: https://circleci.com/gh/angular/angular/535959#tests/containers/2 PR Close #33968 |
||
---|---|---|
.. | ||
goldens | ||
project | ||
.gitignore | ||
README.md | ||
generate.ts | ||
matcher.ts | ||
package.json | ||
test.ts | ||
tsclient.ts | ||
tsconfig.json | ||
yarn.lock |
README.md
Angular Language Service Test
This directory is an integration test for @angular/language-service
to ensure
that the language service works correctly as a tsserver
plugin.
To use the tests:
- Use
yarn install
to install all dependencies in this directory and in the Angular repo root directory. - Build an Angular distribution with
yarn build-dist
. This needs to be done after changes to Angular, but not after changes to integration tests. This is an expensive build. - In this directory, run the integration tests with
yarn test
.
Update golden files
If the expected output needs to be updated, run yarn golden my-golden.json
, replacing
my-golden.json
with the golden file to be updated. Do not qualify the file with a directory path.
See generate.ts for more information.
Adding a new fixture
Currently there is no automated way to produce a new fixture. The way the
current fixtures were created was to hack a version of tsserver.js to write the
commands from VSCode
to a file while performing the operation to be tested.
I also hand modified the input to remove superfluous request.
Once a new fixture is created:
- Add the fixture name to
goldens/
- Run
yarn golden my-golden.json
, replacingmy-golden.json
with the new fixture name, to produce the expected output files. - Hand validate that the expected output is reasonable.