Skip to content

Commit 4fd1ea8

Browse files
committed
test(*): splitting test runs for azure #4908
1 parent 282440e commit 4fd1ea8

6 files changed

+219
-2
lines changed

azure-pipelines.yml

+27-2
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,42 @@ steps:
77
env:
88
AZURE_PIPELINES: "true"
99

10+
- script: npm install -g istanbul-combine
11+
displayName: 'Install coverage combiner'
12+
env:
13+
AZURE_PIPELINES: "true"
14+
1015
- script: npm run lint:lib
1116
displayName: 'Run lint'
1217

1318
- script: npm run build:lib
1419
displayName: 'Build source code and styles'
1520

16-
- script: npm run test:lib:azure
17-
displayName: 'Run tests'
21+
- script: npm run test:lib:azure:others
22+
displayName: 'Run non-grid tests'
23+
env:
24+
NODE_OPTIONS: "--max_old_space_size=4096"
25+
26+
- script: npm run test:lib:azure:grid
27+
displayName: 'Run grid tests'
1828
env:
1929
NODE_OPTIONS: "--max_old_space_size=4096"
2030

31+
- script: npm run test:lib:azure:tgrid
32+
displayName: 'Run tree grid tests'
33+
env:
34+
NODE_OPTIONS: "--max_old_space_size=4096"
35+
36+
- script: npm run test:lib:azure:hgrid
37+
displayName: 'Run hierarchical grid tests'
38+
env:
39+
NODE_OPTIONS: "--max_old_space_size=4096"
40+
41+
- script: istanbul-combine -d coverage -p none -r lcov -r cobertura coverage/hierarchical-grid/coverage-final.json coverage/tree-grid/coverage-final.json coverage/non-grid/coverage-final.json coverage/grid/coverage-final.json
42+
displayName: 'Combine coverage results'
43+
env:
44+
AZURE_PIPELINES: "true"
45+
2146
- script: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
2247
condition: and(succeeded(), eq(variables['system.teamProject'], 'igniteui-angular'))
2348
displayName: 'Code coverage @ Coveralls'

package.json

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
"test:lib:tgrid": "ng test igniteui-angular --watch=false --no-progress --code-coverage --karma-config=./projects/igniteui-angular/karma.tree-grid.conf.js",
1515
"test:lib:hgrid": "ng test igniteui-angular --watch=false --no-progress --code-coverage --karma-config=./projects/igniteui-angular/karma.hierarchical-grid.conf.js",
1616
"test:lib:others": "ng test igniteui-angular --watch=false --no-progress --code-coverage --karma-config=./projects/igniteui-angular/karma.non-grid.conf.js",
17+
"test:lib:azure:grid": "ng test igniteui-angular --watch=false --no-progress --code-coverage --karma-config=./projects/igniteui-angular/karma.azure.grid.conf.js",
18+
"test:lib:azure:tgrid": "ng test igniteui-angular --watch=false --no-progress --code-coverage --karma-config=./projects/igniteui-angular/karma.azure.tree-grid.conf.js",
19+
"test:lib:azure:hgrid": "ng test igniteui-angular --watch=false --no-progress --code-coverage --karma-config=./projects/igniteui-angular/karma.azure.hierarchical-grid.conf.js",
20+
"test:lib:azure:others": "ng test igniteui-angular --watch=false --no-progress --code-coverage --karma-config=./projects/igniteui-angular/karma.azure.non-grid.conf.js",
1721
"test:lib:watch": "ng test igniteui-angular",
1822
"test:schematics": "ts-node --project projects/igniteui-angular/migrations/tsconfig.json ./node_modules/jasmine/bin/jasmine.js ./projects/igniteui-angular/migrations/**/*.spec.ts ./projects/igniteui-angular/schematics/**/*.spec.ts",
1923
"build:lib": "ng build igniteui-angular --prod && gulp build-style",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
8+
files: [
9+
{ pattern: '../../node_modules/hammerjs/hammer.min.js', watched: false },
10+
{ pattern: '../../node_modules/hammer-simulator/index.js', watched: false },
11+
{ pattern: './test.css', watched: false },
12+
{ pattern: '../../dist/igniteui-angular/styles/igniteui-angular.css', watched: false }
13+
],
14+
plugins: [
15+
require('karma-jasmine'),
16+
require('karma-chrome-launcher'),
17+
require('karma-jasmine-spec-tags'),
18+
require('karma-junit-reporter'),
19+
require('karma-coverage-istanbul-reporter'),
20+
require('karma-spec-reporter'),
21+
require('@angular-devkit/build-angular/plugins/karma')
22+
],
23+
client: {
24+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
25+
jasmine: {
26+
random: false
27+
},
28+
tagPrefix: '#',
29+
tags: 'grid'
30+
},
31+
coverageIstanbulReporter: {
32+
dir: require('path').join(__dirname, '../../coverage/grid'),
33+
reports: ['lcovonly', 'json', 'cobertura'],
34+
fixWebpackSourcePaths: true
35+
},
36+
reporters: ['junit'],
37+
junitReporter: {
38+
outputDir: ''
39+
},
40+
port: 9876,
41+
colors: true,
42+
logLevel: config.LOG_INFO,
43+
autoWatch: true,
44+
browsers: ['ChromeHeadless'],
45+
singleRun: true
46+
});
47+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
8+
files: [
9+
{ pattern: '../../node_modules/hammerjs/hammer.min.js', watched: false },
10+
{ pattern: '../../node_modules/hammer-simulator/index.js', watched: false },
11+
{ pattern: './test.css', watched: false },
12+
{ pattern: '../../dist/igniteui-angular/styles/igniteui-angular.css', watched: false }
13+
],
14+
plugins: [
15+
require('karma-jasmine'),
16+
require('karma-chrome-launcher'),
17+
require('karma-jasmine-spec-tags'),
18+
require('karma-junit-reporter'),
19+
require('karma-coverage-istanbul-reporter'),
20+
require('karma-spec-reporter'),
21+
require('@angular-devkit/build-angular/plugins/karma')
22+
],
23+
client: {
24+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
25+
jasmine: {
26+
random: false
27+
},
28+
tagPrefix: '#',
29+
tags: 'hGrid'
30+
},
31+
coverageIstanbulReporter: {
32+
dir: require('path').join(__dirname, '../../coverage/hierarchical-grid'),
33+
reports: ['lcovonly', 'json', 'cobertura'],
34+
fixWebpackSourcePaths: true
35+
},
36+
reporters: ['junit'],
37+
junitReporter: {
38+
outputDir: ''
39+
},
40+
port: 9876,
41+
colors: true,
42+
logLevel: config.LOG_INFO,
43+
autoWatch: true,
44+
browsers: ['ChromeHeadless'],
45+
singleRun: true
46+
});
47+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
8+
files: [
9+
{ pattern: '../../node_modules/hammerjs/hammer.min.js', watched: false },
10+
{ pattern: '../../node_modules/hammer-simulator/index.js', watched: false },
11+
{ pattern: './test.css', watched: false },
12+
{ pattern: '../../dist/igniteui-angular/styles/igniteui-angular.css', watched: false }
13+
],
14+
plugins: [
15+
require('karma-jasmine'),
16+
require('karma-chrome-launcher'),
17+
require('karma-jasmine-spec-tags'),
18+
require('karma-junit-reporter'),
19+
require('karma-coverage-istanbul-reporter'),
20+
require('karma-spec-reporter'),
21+
require('@angular-devkit/build-angular/plugins/karma')
22+
],
23+
client: {
24+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
25+
jasmine: {
26+
random: false
27+
},
28+
tagPrefix: '#',
29+
skipTags: 'hGrid,tGrid,grid'
30+
},
31+
coverageIstanbulReporter: {
32+
dir: require('path').join(__dirname, '../../coverage/non-grid'),
33+
reports: ['lcovonly', 'json', 'cobertura'],
34+
fixWebpackSourcePaths: true
35+
},
36+
reporters: ['junit'],
37+
junitReporter: {
38+
outputDir: ''
39+
},
40+
port: 9876,
41+
colors: true,
42+
logLevel: config.LOG_INFO,
43+
autoWatch: true,
44+
browsers: ['ChromeHeadless'],
45+
singleRun: true
46+
});
47+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
8+
files: [
9+
{ pattern: '../../node_modules/hammerjs/hammer.min.js', watched: false },
10+
{ pattern: '../../node_modules/hammer-simulator/index.js', watched: false },
11+
{ pattern: './test.css', watched: false },
12+
{ pattern: '../../dist/igniteui-angular/styles/igniteui-angular.css', watched: false }
13+
],
14+
plugins: [
15+
require('karma-jasmine'),
16+
require('karma-chrome-launcher'),
17+
require('karma-jasmine-spec-tags'),
18+
require('karma-junit-reporter'),
19+
require('karma-coverage-istanbul-reporter'),
20+
require('karma-spec-reporter'),
21+
require('@angular-devkit/build-angular/plugins/karma')
22+
],
23+
client: {
24+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
25+
jasmine: {
26+
random: false
27+
},
28+
tagPrefix: '#',
29+
tags: 'tGrid'
30+
},
31+
coverageIstanbulReporter: {
32+
dir: require('path').join(__dirname, '../../coverage/tree-grid'),
33+
reports: ['lcovonly', 'json', 'cobertura'],
34+
fixWebpackSourcePaths: true
35+
},
36+
reporters: ['junit'],
37+
junitReporter: {
38+
outputDir: ''
39+
},
40+
port: 9876,
41+
colors: true,
42+
logLevel: config.LOG_INFO,
43+
autoWatch: true,
44+
browsers: ['ChromeHeadless'],
45+
singleRun: true
46+
});
47+
};

0 commit comments

Comments
 (0)