Skip to content

Commit 3af8af0

Browse files
committed
test: reduce harness-e2e-cli test time
This change optimizes the `harness-e2e-cli` integration test by migrating to the `@angular/build` application builder (esbuild), which significantly improves build performance. Additionally, unused configurations such as Karma unit tests, SCSS support, and i18n extraction have been removed to further streamline the project and reduce dependencies. These improvements reduce the execution time of `//integration/harness-e2e-cli:test` to approximately 38 seconds.
1 parent 2ad3866 commit 3af8af0

File tree

9 files changed

+471
-3996
lines changed

9 files changed

+471
-3996
lines changed

integration/harness-e2e-cli/angular.json

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
33
"version": 1,
44
"newProjectRoot": "projects",
5+
"cli": {
6+
"cache": {
7+
"enabled": false
8+
}
9+
},
510
"projects": {
611
"harness-e2e-cli": {
712
"projectType": "application",
@@ -18,16 +23,16 @@
1823
"prefix": "app",
1924
"architect": {
2025
"build": {
21-
"builder": "@angular-devkit/build-angular:browser",
26+
"builder": "@angular/build:application",
2227
"options": {
2328
"outputPath": "dist/harness-e2e-cli",
29+
"polyfills": ["zone.js"],
2430
"index": "src/index.html",
25-
"main": "src/main.ts",
26-
"polyfills": "src/polyfills.ts",
31+
"browser": "src/main.ts",
2732
"tsConfig": "tsconfig.app.json",
28-
"inlineStyleLanguage": "scss",
33+
"inlineStyleLanguage": "css",
2934
"assets": ["src/favicon.ico", "src/assets"],
30-
"styles": ["src/styles.scss"],
35+
"styles": ["src/styles.css"],
3136
"scripts": []
3237
},
3338
"configurations": {
@@ -53,9 +58,7 @@
5358
"outputHashing": "all"
5459
},
5560
"development": {
56-
"buildOptimizer": false,
5761
"optimization": false,
58-
"vendorChunk": true,
5962
"extractLicenses": false,
6063
"sourceMap": true,
6164
"namedChunks": true
@@ -64,7 +67,7 @@
6467
"defaultConfiguration": "production"
6568
},
6669
"serve": {
67-
"builder": "@angular-devkit/build-angular:dev-server",
70+
"builder": "@angular/build:dev-server",
6871
"configurations": {
6972
"production": {
7073
"buildTarget": "harness-e2e-cli:build:production"
@@ -74,25 +77,6 @@
7477
}
7578
},
7679
"defaultConfiguration": "development"
77-
},
78-
"extract-i18n": {
79-
"builder": "@angular-devkit/build-angular:extract-i18n",
80-
"options": {
81-
"buildTarget": "harness-e2e-cli:build"
82-
}
83-
},
84-
"test": {
85-
"builder": "@angular-devkit/build-angular:karma",
86-
"options": {
87-
"main": "src/test.ts",
88-
"polyfills": "src/polyfills.ts",
89-
"tsConfig": "tsconfig.spec.json",
90-
"karmaConfig": "karma.conf.js",
91-
"inlineStyleLanguage": "scss",
92-
"assets": ["src/favicon.ico", "src/assets"],
93-
"styles": ["src/styles.scss"],
94-
"scripts": []
95-
}
9680
}
9781
}
9882
}

integration/harness-e2e-cli/karma.conf.js

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

integration/harness-e2e-cli/package.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"watch": "ng build --watch --configuration development",
99
"test": "ng test",
1010
"run-e2e-specs": "node --loader ts-node/esm node_modules/jasmine/bin/jasmine --config=e2e/jasmine.json",
11-
"wait-and-run-e2e": "wait-on http://localhost:4200 && pnpm run-e2e-specs",
12-
"e2e": "concurrently -s first -k 'pnpm ng serve' 'pnpm wait-and-run-e2e'"
11+
"wait-and-run-e2e": "for i in {1..20}; do curl -s --fail http://localhost:4200 > /dev/null && break || (echo 'Waiting for server... attempt '$i' of 20'; sleep 2); done; pnpm run run-e2e-specs",
12+
"e2e": "concurrently -s first -k 'pnpm run ng serve' 'pnpm run wait-and-run-e2e'"
1313
},
1414
"private": true,
1515
"dependencies": {
@@ -26,7 +26,7 @@
2626
"zone.js": "~0.15.0"
2727
},
2828
"devDependencies": {
29-
"@angular-devkit/build-angular": "20.2.0",
29+
"@angular/build": "20.2.0",
3030
"@angular/cli": "20.2.0",
3131
"@angular/compiler-cli": "20.2.0",
3232
"@types/jasmine": "5.1.8",
@@ -35,14 +35,8 @@
3535
"concurrently": "^9.0.0",
3636
"jasmine": "5.8.0",
3737
"jasmine-core": "5.8.0",
38-
"karma": "6.4.4",
39-
"karma-chrome-launcher": "~3.2.0",
40-
"karma-coverage": "~2.2.0",
41-
"karma-jasmine": "~4.0.0",
42-
"karma-jasmine-html-reporter": "~2.1.0",
4338
"selenium-webdriver": "3.6.0",
4439
"ts-node": "~10.9.1",
45-
"typescript": "5.8.3",
46-
"wait-on": "^8.0.0"
40+
"typescript": "5.8.3"
4741
}
4842
}

0 commit comments

Comments
 (0)