Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit efdfbbb

Browse files
committed
build: update testing configuration
1 parent de95c3e commit efdfbbb

File tree

6 files changed

+80
-83
lines changed

6 files changed

+80
-83
lines changed

scripts/saucelabs/start-tunnel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e -o pipefail
44

5-
TUNNEL_FILE="sc-4.4.9-linux.tar.gz"
5+
TUNNEL_FILE="sc-4.4.12-linux.tar.gz"
66
TUNNEL_URL="https://saucelabs.com/downloads/${TUNNEL_FILE}"
77
TUNNEL_DIR="/tmp/saucelabs-connect"
88

test/karma-system-config.js

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// Configure the base path and map the different node packages.
2+
System.config({
3+
baseURL: '/base',
4+
paths: {
5+
'node:*': 'node_modules/*'
6+
},
7+
map: {
8+
'rxjs': 'node:rxjs',
9+
'tslib': 'node:tslib/tslib.js',
10+
11+
// Angular specific mappings.
12+
'@angular/core': 'node:@angular/core/bundles/core.umd.js',
13+
'@angular/core/testing': 'node:@angular/core/bundles/core-testing.umd.js',
14+
'@angular/common': 'node:@angular/common/bundles/common.umd.js',
15+
'@angular/common/testing': 'node:@angular/common/bundles/common-testing.umd.js',
16+
'@angular/common/http': 'node:@angular/common/bundles/common-http.umd.js',
17+
'@angular/common/http/testing': 'node:@angular/common/bundles/common-http-testing.umd.js',
18+
'@angular/compiler': 'node:@angular/compiler/bundles/compiler.umd.js',
19+
'@angular/compiler/testing': 'node:@angular/compiler/bundles/compiler-testing.umd.js',
20+
'@angular/http': 'node:@angular/http/bundles/http.umd.js',
21+
'@angular/http/testing': 'node:@angular/http/bundles/http-testing.umd.js',
22+
'@angular/forms': 'node:@angular/forms/bundles/forms.umd.js',
23+
'@angular/forms/testing': 'node:@angular/forms/bundles/forms-testing.umd.js',
24+
'@angular/animations': 'node:@angular/animations/bundles/animations.umd.js',
25+
'@angular/animations/browser': 'node:@angular/animations/bundles/animations-browser.umd.js',
26+
'@angular/platform-browser/animations':
27+
'node:@angular/platform-browser/bundles/platform-browser-animations.umd',
28+
'@angular/platform-browser':
29+
'node:@angular/platform-browser/bundles/platform-browser.umd.js',
30+
'@angular/platform-browser/testing':
31+
'node:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
32+
'@angular/platform-browser-dynamic':
33+
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
34+
'@angular/platform-browser-dynamic/testing':
35+
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
36+
37+
'@angular/material/button': 'node:@angular/material/bundles/material-button.umd.js',
38+
'@angular/material/core': 'node:@angular/material/bundles/material-core.umd.js',
39+
'@angular/cdk': 'node:@angular/cdk/bundles/cdk.umd.js',
40+
'@angular/cdk/a11y': 'node:@angular/cdk/bundles/cdk-a11y.umd.js',
41+
'@angular/cdk/bidi': 'node:@angular/cdk/bundles/cdk-bidi.umd.js',
42+
'@angular/cdk/coercion': 'node:@angular/cdk/bundles/cdk-coercion.umd.js',
43+
'@angular/cdk/keycodes': 'node:@angular/cdk/bundles/cdk-keycodes.umd.js',
44+
'@angular/cdk/platform': 'node:@angular/cdk/bundles/cdk-platform.umd.js',
45+
46+
// Path mappings for local packages that can be imported inside of tests.
47+
'@angular/flex-layout': 'dist/packages/flex-layout/index.js',
48+
'@angular/flex-layout/core': 'dist/packages/flex-layout/core/index.js',
49+
'@angular/flex-layout/extended': 'dist/packages/flex-layout/extended/index.js',
50+
'@angular/flex-layout/flex': 'dist/packages/flex-layout/flex/index.js',
51+
'@angular/flex-layout/grid': 'dist/packages/flex-layout/grid/index.js',
52+
'@angular/flex-layout/server': 'dist/packages/flex-layout/server/index.js',
53+
},
54+
packages: {
55+
// Thirdparty barrels.
56+
'rxjs': {main: 'index'},
57+
'rxjs/operators': {main: 'index'},
58+
59+
// Set the default extension for the root package, because otherwise the demo-app can't
60+
// be built within the production mode. Due to missing file extensions.
61+
'.': {
62+
defaultExtension: 'js'
63+
}
64+
}
65+
});

test/karma-test-shim.js

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -9,75 +9,9 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
99

1010
__karma__.loaded = function () {};
1111

12-
var baseDir = '/base';
1312
var specFiles = Object.keys(window.__karma__.files).filter(isSpecFile);
1413

15-
// Configure the base path and map the different node packages.
16-
System.config({
17-
baseURL: baseDir,
18-
paths: {
19-
'node:*': 'node_modules/*'
20-
},
21-
map: {
22-
'rxjs': 'node:rxjs',
23-
'main': 'main.js',
24-
'tslib': 'node:tslib/tslib.js',
25-
26-
// Angular specific mappings.
27-
'@angular/core': 'node:@angular/core/bundles/core.umd.js',
28-
'@angular/core/testing': 'node:@angular/core/bundles/core-testing.umd.js',
29-
'@angular/common': 'node:@angular/common/bundles/common.umd.js',
30-
'@angular/common/testing': 'node:@angular/common/bundles/common-testing.umd.js',
31-
'@angular/common/http': 'node:@angular/common/bundles/common-http.umd.js',
32-
'@angular/common/http/testing': 'node:@angular/common/bundles/common-http-testing.umd.js',
33-
'@angular/compiler': 'node:@angular/compiler/bundles/compiler.umd.js',
34-
'@angular/compiler/testing': 'node:@angular/compiler/bundles/compiler-testing.umd.js',
35-
'@angular/http': 'node:@angular/http/bundles/http.umd.js',
36-
'@angular/http/testing': 'node:@angular/http/bundles/http-testing.umd.js',
37-
'@angular/forms': 'node:@angular/forms/bundles/forms.umd.js',
38-
'@angular/forms/testing': 'node:@angular/forms/bundles/forms-testing.umd.js',
39-
'@angular/animations': 'node:@angular/animations/bundles/animations.umd.js',
40-
'@angular/animations/browser': 'node:@angular/animations/bundles/animations-browser.umd.js',
41-
'@angular/platform-browser/animations':
42-
'node:@angular/platform-browser/bundles/platform-browser-animations.umd',
43-
'@angular/platform-browser':
44-
'node:@angular/platform-browser/bundles/platform-browser.umd.js',
45-
'@angular/platform-browser/testing':
46-
'node:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
47-
'@angular/platform-browser-dynamic':
48-
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
49-
'@angular/platform-browser-dynamic/testing':
50-
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
51-
52-
'@angular/material/button': 'node:@angular/material/bundles/material-button.umd.js',
53-
'@angular/material/core': 'node:@angular/material/bundles/material-core.umd.js',
54-
'@angular/cdk': 'node:@angular/cdk/bundles/cdk.umd.js',
55-
'@angular/cdk/a11y': 'node:@angular/cdk/bundles/cdk-a11y.umd.js',
56-
'@angular/cdk/bidi': 'node:@angular/cdk/bundles/cdk-bidi.umd.js',
57-
'@angular/cdk/coercion': 'node:@angular/cdk/bundles/cdk-coercion.umd.js',
58-
'@angular/cdk/keycodes': 'node:@angular/cdk/bundles/cdk-keycodes.umd.js',
59-
'@angular/cdk/platform': 'node:@angular/cdk/bundles/cdk-platform.umd.js',
60-
61-
// Path mappings for local packages that can be imported inside of tests.
62-
'@angular/flex-layout': 'dist/packages/flex-layout/index.js',
63-
'@angular/flex-layout/core': 'dist/packages/flex-layout/core/index.js',
64-
'@angular/flex-layout/extended': 'dist/packages/flex-layout/extended/index.js',
65-
'@angular/flex-layout/flex': 'dist/packages/flex-layout/flex/index.js',
66-
'@angular/flex-layout/grid': 'dist/packages/flex-layout/grid/index.js',
67-
'@angular/flex-layout/server': 'dist/packages/flex-layout/server/index.js',
68-
},
69-
packages: {
70-
// Thirdparty barrels.
71-
'rxjs': {main: 'index'},
72-
'rxjs/operators': {main: 'index'},
73-
74-
// Set the default extension for the root package, because otherwise the demo-app can't
75-
// be built within the production mode. Due to missing file extensions.
76-
'.': {
77-
defaultExtension: 'js'
78-
}
79-
}
80-
});
14+
8115

8216
// Configure the Angular test bed and run all specs once configured.
8317
configureTestBed()

test/karma.conf.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ module.exports = (config) => {
1414
require('karma-firefox-launcher'),
1515
require('karma-sourcemap-loader'),
1616
require('karma-coverage'),
17-
require('karma-spec-reporter')
1817
],
1918
files: [
20-
{pattern: 'node_modules/core-js/client/core.js', included: true, watched: false},
19+
{pattern: 'node_modules/core-js/client/core.min.js', included: true, watched: false},
2120
{pattern: 'node_modules/tslib/tslib.js', included: true, watched: false},
22-
{pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: false},
23-
{pattern: 'node_modules/zone.js/dist/zone.js', included: true, watched: false},
24-
{pattern: 'node_modules/zone.js/dist/proxy.js', included: true, watched: false},
21+
{pattern: 'node_modules/systemjs/dist/system.js', included: true, watched: false},
22+
{pattern: 'node_modules/zone.js/dist/zone.min.js', included: true, watched: false},
23+
{pattern: 'node_modules/zone.js/dist/proxy.min.js', included: true, watched: false},
2524
{pattern: 'node_modules/zone.js/dist/sync-test.js', included: true, watched: false},
26-
{pattern: 'node_modules/zone.js/dist/jasmine-patch.js', included: true, watched: false},
25+
{pattern: 'node_modules/zone.js/dist/jasmine-patch.min.js', included: true, watched: false},
2726
{pattern: 'node_modules/zone.js/dist/async-test.js', included: true, watched: false},
2827
{pattern: 'node_modules/zone.js/dist/fake-async-test.js', included: true, watched: false},
2928

3029
{pattern: 'node_modules/@angular/**/*', included: false, watched: false},
3130
{pattern: 'node_modules/rxjs/**/*', included: false, watched: false},
3231

32+
{pattern: 'test/karma-system-config.js', included: true, watched: false},
3333
{pattern: 'test/karma-test-shim.js', included: true, watched: false},
3434

3535

@@ -54,12 +54,8 @@ module.exports = (config) => {
5454
subdir: '.'
5555
},
5656

57-
specReporter: {
58-
maxLogLines: 1,
59-
},
60-
6157
sauceLabs: {
62-
testName: 'flex-layout',
58+
testName: 'Angular Layout Unit Tests',
6359
startConnect: false,
6460
recordVideo: false,
6561
recordScreenshots: false,
@@ -87,8 +83,8 @@ module.exports = (config) => {
8783
browserDisconnectTolerance: 3,
8884
browserNoActivityTimeout: 300000,
8985
captureTimeout: 180000,
90-
browsers: ['ChromeHeadlessCISandbox'],
9186

87+
browsers: ['ChromeHeadlessCISandbox'],
9288
singleRun: false,
9389

9490
browserConsoleLogOptions: {
@@ -102,7 +98,7 @@ module.exports = (config) => {
10298
// accidentally on other tests.
10399
random: true
104100
}
105-
}
101+
},
106102
});
107103

108104
if (process.env['TRAVIS']) {
@@ -131,6 +127,9 @@ module.exports = (config) => {
131127
throw new Error(`Platform "${platform}" unknown, but Travis specified. Exiting.`);
132128
}
133129

130+
// To guarantee a better stability for tests running on external browsers, we disable
131+
// concurrency. Stability is compared to speed more important.
132+
config.concurrency = 1;
134133
config.browsers = platformMap[platform][target.toLowerCase()];
135134
}
136135
};

test/protractor.conf.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const fs = require('fs');
21
const path = require('path');
32

43
// Load ts-node to be able to execute TypeScript files with protractor.

test/remote_browsers.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"base": "SauceLabs",
116116
"browserName": "microsoftedge",
117117
"platform": "Windows 10",
118-
"version": "14"
118+
"version": "17"
119119
},
120120
"SL_ANDROID4.1": {
121121
"base": "SauceLabs",

0 commit comments

Comments
 (0)