Skip to content

Commit 98e5af1

Browse files
devversionjasonaden
authored andcommitted
build: switch example e2e tests to bazel (angular#28402)
* No longer builds the example e2e tests using "tsc". The examples are now built with Bazel and can therefore be built with Ivy by using the `--define=compile=aot` switch. * No longer runs the example e2e tests using the protractor CLI. example e2e tests are executed with the Bazel protractor rule and can therefore run incrementally. NOTE: Unit tests found within the examples are still running within the legacy jobs. PR Close angular#28402
1 parent 66335c3 commit 98e5af1

File tree

103 files changed

+895
-413
lines changed

Some content is hidden

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

103 files changed

+895
-413
lines changed

.circleci/config.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,6 @@ jobs:
410410
- *define_env_vars
411411
- *yarn_install
412412
- run: yarn tsc -p packages
413-
- run: yarn tsc -p packages/examples
414413
- run: yarn tsc -p modules
415414
- run: yarn karma start ./karma-js.conf.js --single-run --browsers=ChromeNoSandbox
416415

@@ -437,7 +436,6 @@ jobs:
437436
command: ./scripts/saucelabs/start-tunnel.sh
438437
background: true
439438
- run: yarn tsc -p packages
440-
- run: yarn tsc -p packages/examples
441439
- run: yarn tsc -p modules
442440
# Waits for the Saucelabs tunnel to be ready. This ensures that we don't run tests
443441
# too early without Saucelabs not being ready.
@@ -465,10 +463,9 @@ jobs:
465463
- run: ./scripts/build-e2e-tests.sh --use-existing-packages-dist
466464
- run:
467465
name: Starting servers for e2e tests
468-
command: yarn gulp serve serve-examples
466+
command: yarn gulp serve
469467
background: true
470468
- run: NODE_PATH=$NODE_PATH:./dist/all yarn protractor ./protractor-e2e.conf.js --bundles=true
471-
- run: NODE_PATH=$NODE_PATH:./dist/all yarn protractor ./protractor-examples-e2e.conf.js --bundles=true
472469
- run: NODE_PATH=$NODE_PATH:./dist/all yarn protractor ./protractor-perf.conf.js --bundles=true --dryrun
473470

474471
legacy-misc-tests:

gulpfile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ gulp.task('source-map-test', loadTask('source-map-test'));
3939
gulp.task('tools:build', loadTask('tools-build'));
4040
gulp.task('check-cycle', loadTask('check-cycle'));
4141
gulp.task('serve', loadTask('serve', 'default'));
42-
gulp.task('serve-examples', loadTask('serve', 'examples'));
4342
gulp.task('changelog', loadTask('changelog'));
4443
gulp.task('check-env', () => {/* this is a noop because the env test ran already above */});
4544
gulp.task('cldr:extract', loadTask('cldr', 'extract'));

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@
3838
"@bazel/karma": "~0.22.1",
3939
"@bazel/typescript": "~0.22.1",
4040
"@schematics/angular": "^7.0.4",
41+
"@types/angular": "^1.6.47",
4142
"@types/chokidar": "1.7.3",
4243
"@types/convert-source-map": "^1.5.1",
4344
"@types/diff": "^3.2.2",
4445
"@types/fs-extra": "4.0.2",
4546
"@types/hammerjs": "2.0.35",
4647
"@types/jasmine": "^2.8.8",
48+
"@types/jasminewd2": "^2.0.6",
4749
"@types/mock-fs": "^3.6.30",
4850
"@types/node": "^10.9.4",
4951
"@types/selenium-webdriver": "3.0.7",
@@ -98,9 +100,7 @@
98100
"@bazel/bazel": "~0.22.0",
99101
"@bazel/buildifier": "^0.19.2",
100102
"@bazel/ibazel": "~0.9.0",
101-
"@types/angular": "^1.6.47",
102103
"@types/base64-js": "1.2.5",
103-
"@types/jasminewd2": "^2.0.4",
104104
"@types/minimist": "^1.2.0",
105105
"@types/systemjs": "0.19.32",
106106
"browserstacktunnel-wrapper": "2.0.1",

packages/examples/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
exports_files([
2+
"index.html",
3+
"tsconfig-e2e.json",
4+
])

packages/examples/README.md

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,15 @@ behavior) just like an Angular application developer would write.
77
# Running the examples
88

99
```
10-
# # execute the following command only when framework code changes
11-
./build.sh
10+
# Serving individual examples (e.g. common)
11+
yarn bazel run //packages/examples/common:devserver
1212
13-
# run when test change
14-
./packages/examples/build.sh
15-
16-
# start server
17-
$(npm bin)/gulp serve-examples
13+
# "core" examples
14+
yarn bazel run //packages/examples/core:devserver
1815
```
1916

20-
navigate to [http://localhost:8001](http://localhost:8001)
21-
2217
# Running the tests
2318

2419
```
25-
# run only when framework code changes
26-
./build.sh
27-
28-
# run to compile tests and run them
29-
./packages/examples/test.sh
30-
```
31-
32-
NOTE: sometimes the http server does not exit properly and it retains the `8001` port.
33-
in such a case you can use `lsof -i:8001` to see which process it is and then use `kill`
34-
to remove it. (Or in single command: `lsof -i:8001 -t | xargs kill`)
20+
yarn bazel test //packages/examples/...
21+
```

packages/examples/_common/bootstrap.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

packages/examples/_common/e2e_util.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

packages/examples/_common/index.html

Lines changed: 0 additions & 16 deletions
This file was deleted.

packages/examples/_common/module.d.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

packages/examples/_common/system-config.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)