Skip to content

Commit 8a3ffed

Browse files
committed
vsts: report smoketest results
1 parent 4dc7385 commit 8a3ffed

12 files changed

Lines changed: 141 additions & 126 deletions

File tree

extensions/css-language-features/server/test/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const glob = require('glob');
1010
const suite = 'Integration CSS Extension Tests';
1111

1212
const options = {
13-
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
14-
useColors: true, // colored output from test results (only windows cannot handle)
13+
ui: 'tdd',
14+
useColors: true,
1515
timeout: 60000
1616
};
1717

extensions/emmet/src/test/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const testRunner = require('vscode/lib/testrunner');
99
const suite = 'Integration Emmet Tests';
1010

1111
const options: any = {
12-
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
13-
useColors: true, // colored output from test results (only windows cannot handle)
12+
ui: 'tdd',
13+
useColors: true,
1414
timeout: 60000
1515
};
1616

extensions/html-language-features/server/test/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const glob = require('glob');
1010
const suite = 'Integration HTML Extension Tests';
1111

1212
const options = {
13-
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
14-
useColors: true, // colored output from test results (only windows cannot handle)
13+
ui: 'tdd',
14+
useColors: true,
1515
timeout: 60000
1616
};
1717

extensions/markdown-language-features/src/test/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const testRunner = require('vscode/lib/testrunner');
99
const suite = 'Integration Markdown Tests';
1010

1111
const options: any = {
12-
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
13-
useColors: true, // colored output from test results (only windows cannot handle)
12+
ui: 'tdd',
13+
useColors: true,
1414
timeout: 60000
1515
};
1616

extensions/vscode-api-tests/src/singlefolder-tests/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const testRunner = require('vscode/lib/testrunner');
99
const suite = 'Integration Single Folder Tests';
1010

1111
const options: any = {
12-
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
13-
useColors: true, // colored output from test results (only windows cannot handle)
12+
ui: 'tdd',
13+
useColors: true,
1414
timeout: 60000
1515
};
1616

extensions/vscode-api-tests/src/workspace-tests/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const testRunner = require('vscode/lib/testrunner');
99
const suite = 'Integration Workspace Tests';
1010

1111
const options: any = {
12-
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
13-
useColors: true, // colored output from test results (only windows cannot handle)
12+
ui: 'tdd',
13+
useColors: true,
1414
timeout: 60000
1515
};
1616

extensions/vscode-colorize-tests/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const testRunner = require('vscode/lib/testrunner');
99
const suite = 'Integration Colorize Tests';
1010

1111
const options: any = {
12-
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
13-
useColors: true, // colored output from test results (only windows cannot handle)
12+
ui: 'tdd',
13+
useColors: true,
1414
timeout: 60000
1515
};
1616

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"7z": "7z",
2020
"update-grammars": "node build/npm/update-all-grammars.js",
2121
"update-localization-extension": "node build/npm/update-localization-extension.js",
22-
"smoketest": "cd test/smoke && mocha",
22+
"smoketest": "cd test/smoke && node test/index.js",
2323
"monaco-compile-check": "tsc -p src/tsconfig.monaco.json --noEmit",
2424
"download-builtin-extensions": "node build/lib/builtInExtensions.js",
2525
"check-monaco-editor-compilation": "tsc -p src/tsconfig.monaco.json --noEmit"
@@ -137,4 +137,4 @@
137137
"windows-mutex": "^0.2.0",
138138
"windows-process-tree": "0.2.2"
139139
}
140-
}
140+
}

test/smoke/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"electron": "1.7.7",
2626
"htmlparser2": "^3.9.2",
2727
"mkdirp": "^0.5.1",
28-
"mocha": "^3.2.0",
28+
"mocha": "^5.2.0",
29+
"mocha-junit-reporter": "^1.17.0",
30+
"mocha-multi-reporters": "^1.1.7",
2931
"ncp": "^2.0.0",
3032
"portastic": "^1.0.1",
3133
"rimraf": "^2.6.1",

test/smoke/test/index.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
const path = require('path');
7+
const Mocha = require('mocha');
8+
9+
const suite = 'Smoke Tests';
10+
11+
const options = {
12+
useColors: true,
13+
timeout: 60000,
14+
slow: 30000
15+
};
16+
17+
if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
18+
options.reporter = 'mocha-multi-reporters';
19+
options.reporterOptions = {
20+
reporterEnabled: 'spec, mocha-junit-reporter',
21+
mochaJunitReporterReporterOptions: {
22+
testsuitesTitle: `${suite} ${process.platform}`,
23+
mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, `test-results/${process.platform}-${suite.toLowerCase().replace(/[^\w]/g, '-')}-results.xml`)
24+
}
25+
};
26+
}
27+
28+
const mocha = new Mocha(options);
29+
mocha.addFile('out/main.js');
30+
mocha.run(failures => process.exit(failures ? -1 : 0));

0 commit comments

Comments
 (0)