Skip to content

Commit 08aa54e

Browse files
alexeaglemhevery
authored andcommitted
ci: Add back the CLI integration test with pinning (angular#21555)
The CLI app is now checked in, rather than generated dynamically with `ng new`. This loses some assertion power, but gains hermeticity. It also checks in lock files for all integration tests, avoiding floating version numbers. We'll need another place to integration test between changes in the various repositories - but the angular/angular PR-blocking status is not the right place to do this. PR Close angular#21555
1 parent fac4d8d commit 08aa54e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+22985
-101
lines changed

integration/.gitignore

-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
built/
22
dist/
33
vendor/
4-
yarn.lock
5-
.ng-cli/
6-
cli-*/**
74
*/src/*.d.ts
85
*/src/*.js
96
**/*.ngfactory.ts
107
**/*.ngsummary.json
118
**/*.ngsummary.ts
12-
*/yarn*
139
**/.yarn_local_cache*

integration/README.md

+21-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
# Integration tests for Angular
22

3-
This directory contains end-to-end tests for Angular. Each directory is a self-contained
4-
application that exactly mimics how a user might expect Angular to work, so they allow
5-
high-fidelity reproductions of real-world issues.
6-
7-
For this to work, we first build the Angular distribution just like we would publish
8-
it to npm, then install the distribution into each app.
3+
This directory contains end-to-end tests for Angular. Each directory is a self-contained application that exactly mimics how a user might expect Angular
4+
to work, so they allow high-fidelity reproductions of real-world issues.
5+
6+
For this to work, we first build the Angular distribution just like we would
7+
publish it to npm, then install the distribution into each app.
8+
9+
To test Angular CLI applications, we generate integration tests such as `cli-hello-world`.
10+
This was generated with a current version of the CLI, and the only modification was replacement of `@angular/*` packages with their counterparts coming from `file:../../dist/packages-dist/*`.
11+
When a significant change is released in the CLI, the application should be re-generated from scratch:
12+
13+
```bash
14+
$ cd integration
15+
$ rm -rf cli-hello-world
16+
$ ng new cli-hello-world
17+
# Edit cli-hello-world/package.json to point the @angular packages to dist/packages-dist, and preserve local mods to
18+
# ng build
19+
# ng test
20+
# typescript version
21+
```
922

1023
## Writing an integration test
1124

@@ -29,6 +42,8 @@ you can install the package directly from `file:../../node_modules`.
2942

3043
## Running integration tests
3144

45+
First you must run `build.sh` to create the current distribution.
46+
3247
You can iterate on the tests by keeping the dist folder up-to-date.
3348
See the `package.json` of the test(s) you're debugging, to see which dist/ folders they install from.
3449
Then run the right `tsc --watch` command to keep those dist folders up-to-date, for example:

integration/bazel/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
},
2121
"scripts": {
2222
"postinstall": "ngc -p angular.tsconfig.json",
23-
"test": "WORKAROUND https://github.com/bazelbuild/bazel/issues/4242, can't build ...",
24-
"test": "bazel build //src/... --noshow_progress"
23+
"test": "bazel build //... --noshow_progress"
2524
}
2625
}

0 commit comments

Comments
 (0)