Skip to content

Commit 524cf69

Browse files
author
Yang Gu
authored
webgpu: Switch back to old karma reporter (#7449)
With karma-jasmine-html-report, we don't know how many cases are skipped. The result looks like below: TOTAL: 37 SUCCESS The old report provides more info as below: Chrome 113.0.0.0 (Windows 10): Executed 37 of 4559 (skipped 4522) SUCCESS (1.045 secs / 0.395 secs) This PR also fixes a comment typo in setup_test.ts
1 parent 3fadd02 commit 524cf69

File tree

2 files changed

+9
-24
lines changed

2 files changed

+9
-24
lines changed

tfjs-backend-webgpu/karma.conf.js

+8-23
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,13 @@
1818
const karmaTypescriptConfig = {
1919
tsconfig: 'tsconfig.test.json',
2020
// Disable coverage reports and instrumentation by default for tests
21-
coverageOptions: {
22-
instrumentation: false
23-
},
21+
coverageOptions: {instrumentation: false},
2422
reports: {},
2523
bundlerOptions: {
2624
transforms: [require('karma-typescript-es6-transform')({
2725
presets: [
2826
// ensure we get es5 by adding IE 11 as a target
29-
['@babel/env', {
30-
'targets': { 'ie': '11' }, 'loose': true
31-
}]
27+
['@babel/env', {'targets': {'ie': '11'}, 'loose': true}]
3228
]
3329
})],
3430
// worker_node_test in tfjs-core contains a conditional require statement
@@ -40,21 +36,15 @@ const karmaTypescriptConfig = {
4036
const devConfig = {
4137
frameworks: ['jasmine', 'karma-typescript'],
4238
files: [
43-
{
44-
pattern: './node_modules/@babel/polyfill/dist/polyfill.js'
45-
},
39+
{pattern: './node_modules/@babel/polyfill/dist/polyfill.js'},
4640
'src/setup_test.ts',
47-
{
48-
pattern: 'src/**/*.ts'
49-
},
41+
{pattern: 'src/**/*.ts'},
5042
],
51-
preprocessors: {
52-
'src/**/*.ts': ['karma-typescript']
53-
},
43+
preprocessors: {'src/**/*.ts': ['karma-typescript']},
5444
karmaTypescriptConfig,
5545
};
5646

57-
module.exports = function (config) {
47+
module.exports = function(config) {
5848
const args = [];
5949
if (config.grep) {
6050
args.push('--grep', config.grep);
@@ -69,7 +59,7 @@ module.exports = function (config) {
6959

7060
config.set({
7161
...devConfig,
72-
reporters: ['kjhtml'],
62+
reporters: ['dots', 'karma-typescript'],
7363
plugins: [
7464
require('karma-chrome-launcher'),
7565
require('karma-typescript'),
@@ -91,11 +81,6 @@ module.exports = function (config) {
9181
],
9282
}
9383
},
94-
client: {
95-
jasmine: {
96-
random: false
97-
},
98-
args: args
99-
}
84+
client: {jasmine: {random: false}, args: args}
10085
})
10186
}

tfjs-backend-webgpu/src/setup_test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ if (typeof __karma__ !== 'undefined') {
119119
// tslint:disable-next-line:no-imports-from-dist
120120
// tslint:disable-next-line:no-require-imports
121121
require('@tensorflow/tfjs-core/dist/tests');
122-
// Import and run tests from webgl.
122+
// Import and run tests from webgpu.
123123
// tslint:disable-next-line:no-imports-from-dist
124124
// tslint:disable-next-line:no-require-imports
125125
require('./tests');

0 commit comments

Comments
 (0)