Add integration-test code coverage (#10632)

* wip

* Update to latest vscodetestcover and add tests back in

* Update to latest version of vscodetestcover

* updates

* another yarn.lock

* update version

* Revert import path change
This commit is contained in:
Charles Gagnon
2020-06-01 14:54:07 -07:00
committed by GitHub
parent f2c3320f0e
commit 7305bdaec4
38 changed files with 963 additions and 1799 deletions

View File

@@ -85,7 +85,7 @@
"mocha-junit-reporter": "^1.17.0",
"mocha-multi-reporters": "^1.1.7",
"should": "^13.2.3",
"vscodetestcover": "github:corivera/vscodetestcover#1.0.6"
"vscodetestcover": "github:corivera/vscodetestcover#1.0.8"
},
"__metadata": {
"id": "41",

View File

@@ -935,9 +935,9 @@ vscode-nls@^3.2.1:
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.5.tgz#25520c1955108036dec607c85e00a522f247f1a4"
integrity sha512-ITtoh3V4AkWXMmp3TB97vsMaHRgHhsSFPsUdzlueSL+dRZbSNTZeOmdQv60kjCV306ghPxhDeoNUEm3+EZMuyw==
"vscodetestcover@github:corivera/vscodetestcover#1.0.6":
version "1.0.5"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/14e0f2c46346b31bc1af2c590febeaf69a9112eb"
"vscodetestcover@github:corivera/vscodetestcover#1.0.8":
version "1.0.8"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/4331080eed9d2713807e9a3f47610947d5b0a1d7"
dependencies:
decache "^4.4.0"
glob "^7.1.2"

View File

@@ -90,7 +90,7 @@
"mocha-multi-reporters": "^1.1.7",
"should": "^13.2.1",
"typemoq": "^2.1.0",
"vscodetestcover": "github:corivera/vscodetestcover#1.0.6"
"vscodetestcover": "github:corivera/vscodetestcover#1.0.8"
},
"__metadata": {
"id": "10",

View File

@@ -769,9 +769,9 @@ vscode-nls@^3.2.1:
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.5.tgz#25520c1955108036dec607c85e00a522f247f1a4"
integrity sha512-ITtoh3V4AkWXMmp3TB97vsMaHRgHhsSFPsUdzlueSL+dRZbSNTZeOmdQv60kjCV306ghPxhDeoNUEm3+EZMuyw==
"vscodetestcover@github:corivera/vscodetestcover#1.0.6":
version "1.0.5"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/14e0f2c46346b31bc1af2c590febeaf69a9112eb"
"vscodetestcover@github:corivera/vscodetestcover#1.0.8":
version "1.0.8"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/4331080eed9d2713807e9a3f47610947d5b0a1d7"
dependencies:
decache "^4.4.0"
glob "^7.1.2"

View File

@@ -285,6 +285,6 @@
"mocha-multi-reporters": "^1.1.7",
"should": "^13.2.1",
"typemoq": "^2.1.0",
"vscodetestcover": "github:corivera/vscodetestcover#1.0.6"
"vscodetestcover": "github:corivera/vscodetestcover#1.0.8"
}
}

View File

@@ -1331,9 +1331,9 @@ vscode-nls@^4.0.0:
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.2.tgz#ca8bf8bb82a0987b32801f9fddfdd2fb9fd3c167"
integrity sha512-7bOHxPsfyuCqmP+hZXscLhiHwe7CSuFE4hyhbs22xPIhQ4jv99FcR4eBzfYYVLP356HNFpdvz63FFb/xw6T4Iw==
"vscodetestcover@github:corivera/vscodetestcover#1.0.6":
version "1.0.5"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/14e0f2c46346b31bc1af2c590febeaf69a9112eb"
"vscodetestcover@github:corivera/vscodetestcover#1.0.8":
version "1.0.8"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/4331080eed9d2713807e9a3f47610947d5b0a1d7"
dependencies:
decache "^4.4.0"
glob "^7.1.2"

View File

@@ -657,7 +657,7 @@
"mocha-multi-reporters": "^1.1.7",
"mocha": "^5.2.0",
"should": "^13.2.1",
"vscodetestcover": "github:corivera/vscodetestcover#1.0.6",
"vscodetestcover": "github:corivera/vscodetestcover#1.0.8",
"typemoq": "^2.1.0"
},
"__metadata": {

View File

@@ -1088,9 +1088,9 @@ vscode-nls@^4.0.0:
resolved "https://registry.npmjs.org/vscode-nls/-/vscode-nls-4.0.0.tgz#4001c8a6caba5cedb23a9c5ce1090395c0e44002"
integrity sha512-qCfdzcH+0LgQnBpZA53bA32kzp9rpq/f66Som577ObeuDlFIrtbEJ+A/+CCxjIh4G8dpJYNCKIsxpRAHIfsbNw==
"vscodetestcover@github:corivera/vscodetestcover#1.0.6":
version "1.0.5"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/14e0f2c46346b31bc1af2c590febeaf69a9112eb"
"vscodetestcover@github:corivera/vscodetestcover#1.0.8":
version "1.0.8"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/4331080eed9d2713807e9a3f47610947d5b0a1d7"
dependencies:
decache "^4.4.0"
glob "^7.1.2"

View File

@@ -62,7 +62,7 @@
"mocha-junit-reporter": "^1.17.0",
"mocha-multi-reporters": "^1.1.7",
"should": "^13.2.1",
"vscodetestcover": "github:corivera/vscodetestcover#1.0.6"
"vscodetestcover": "github:corivera/vscodetestcover#1.0.8"
},
"__metadata": {
"id": "33",

View File

@@ -816,9 +816,9 @@ vscode-nls@^4.0.0:
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.1.tgz#f9916b64e4947b20322defb1e676a495861f133c"
integrity sha512-4R+2UoUUU/LdnMnFjePxfLqNhBS8lrAFyX7pjb2ud/lqDkrUavFUTcG7wR0HBZFakae0Q6KLBFjMS6W93F403A==
"vscodetestcover@github:corivera/vscodetestcover#1.0.6":
version "1.0.5"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/14e0f2c46346b31bc1af2c590febeaf69a9112eb"
"vscodetestcover@github:corivera/vscodetestcover#1.0.8":
version "1.0.8"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/4331080eed9d2713807e9a3f47610947d5b0a1d7"
dependencies:
decache "^4.4.0"
glob "^7.1.2"

View File

@@ -0,0 +1,21 @@
{
"enabled": true,
"relativeSourcePath": "../../../",
"relativeCoverageDir": "../../coverage",
"ignorePatterns": [
"**/coverage/**",
"**/generated/**",
"**/node_modules/**",
"**/test/**"
],
"includePid": false,
"reports": [
"cobertura",
"lcov"
],
"verbose": false,
"remapOptions": {
"basePath": "../../../",
"useAbsolutePaths": true
}
}

View File

@@ -22,8 +22,7 @@
"Microsoft.azuredatastudio-postgresql"
],
"scripts": {
"vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:vscode-colorize-tests ./tsconfig.json",
"postinstall": "node ./node_modules/vscode/bin/install"
"vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:vscode-colorize-tests ./tsconfig.json"
},
"devDependencies": {
"@types/chai": "3.4.34",
@@ -33,6 +32,6 @@
"mocha-junit-reporter": "^1.17.0",
"mocha-multi-reporters": "^1.1.7",
"ms-rest-azure": "^2.6.0",
"vscode": "1.1.5"
"vscodetestcover": "github:corivera/vscodetestcover#1.0.8"
}
}

View File

@@ -0,0 +1,48 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as path from 'path';
import * as testRunner from 'vscodetestcover';
const suite = 'Extension Integration Tests';
const mochaOptions: any = {
ui: 'tdd',
useColors: true,
timeout: 60000
};
// set relevant mocha options from the environment
if (process.env.ADS_TEST_GREP) {
mochaOptions.grep = process.env.ADS_TEST_GREP;
console.log(`setting options.grep to: ${mochaOptions.grep}`);
}
if (process.env.ADS_TEST_INVERT_GREP) {
mochaOptions.invert = parseInt(process.env.ADS_TEST_INVERT_GREP);
console.log(`setting options.invert to: ${mochaOptions.invert}`);
}
if (process.env.ADS_TEST_TIMEOUT) {
mochaOptions.timeout = parseInt(process.env.ADS_TEST_TIMEOUT);
console.log(`setting options.timeout to: ${mochaOptions.timeout}`);
}
if (process.env.ADS_TEST_RETRIES) {
mochaOptions.retries = parseInt(process.env.ADS_TEST_RETRIES);
console.log(`setting options.retries to: ${mochaOptions.retries}`);
}
if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
mochaOptions.reporter = 'mocha-multi-reporters';
mochaOptions.reporterOptions = {
reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: {
testsuitesTitle: `${suite} ${process.platform}`,
mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, `test-results/${process.platform}-${suite.toLowerCase().replace(/[^\w]/g, '-')}-results.xml`)
}
};
}
testRunner.configure(mochaOptions, { coverConfig: '../../coverConfig.json' });
export = testRunner;

View File

@@ -1,50 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as testRunner from 'vscode/lib/testrunner';
import * as path from 'path';
const suite = 'Extension Integration Tests';
const options: any = {
ui: 'tdd',
useColors: true,
timeout: 600000
};
// set relevant mocha options from the environment
if (process.env.ADS_TEST_GREP) {
options.grep = process.env.ADS_TEST_GREP;
console.log(`setting options.grep to: ${options.grep}`);
}
if (process.env.ADS_TEST_INVERT_GREP) {
const value = parseInt(process.env.ADS_TEST_INVERT_GREP);
options.invert = Boolean(value);
console.log(`setting options.invert to: ${options.invert}`);
}
if (process.env.ADS_TEST_TIMEOUT) {
options.timeout = parseInt(process.env.ADS_TEST_TIMEOUT);
console.log(`setting options.timeout to: ${options.timeout}`);
}
if (process.env.ADS_TEST_RETRIES) {
options.retries = parseInt(process.env.ADS_TEST_RETRIES);
console.log(`setting options.retries to: ${options.retries}`);
}
if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
console.log(`environment variable BUILD_ARTIFACTSTAGINGDIRECTORY is set to ${process.env.BUILD_ARTIFACTSTAGINGDIRECTORY} so configuring multiple reporters for test results.\n For this to work the ${process.env.BUILD_ARTIFACTSTAGINGDIRECTORY} must be fully qualified directory and must exist`);
options.reporter = 'mocha-multi-reporters';
options.reporterOptions = {
reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: {
testsuitesTitle: `${suite} Tests ${process.platform}`,
mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, `test-results/${process.platform}-${suite.toLowerCase().replace(/[^\w]/g, '-')}-results.xml`)
}
};
}
testRunner.configure(options);
export = testRunner;

View File

@@ -5,4 +5,5 @@
/// <reference path='../../../../src/sql/azdata.d.ts'/>
/// <reference path='../../../../src/sql/azdata.proposed.d.ts'/>
/// <reference path='../../../../src/sql/azdata.test.d.ts'/>
/// <reference path='../../../../src/vs/vscode.d.ts'/>
/// <reference types='@types/node'/>

File diff suppressed because it is too large Load Diff

View File

@@ -148,7 +148,7 @@
"mocha-multi-reporters": "^1.1.7",
"should": "^13.2.1",
"typemoq": "^2.1.0",
"vscodetestcover": "github:corivera/vscodetestcover#1.0.6"
"vscodetestcover": "github:corivera/vscodetestcover#1.0.8"
},
"__metadata": {
"id": "65",

View File

@@ -1242,9 +1242,9 @@ vscode-nls@^4.0.0:
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.1.tgz#f9916b64e4947b20322defb1e676a495861f133c"
integrity sha512-4R+2UoUUU/LdnMnFjePxfLqNhBS8lrAFyX7pjb2ud/lqDkrUavFUTcG7wR0HBZFakae0Q6KLBFjMS6W93F403A==
"vscodetestcover@github:corivera/vscodetestcover#1.0.6":
version "1.0.5"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/14e0f2c46346b31bc1af2c590febeaf69a9112eb"
"vscodetestcover@github:corivera/vscodetestcover#1.0.8":
version "1.0.8"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/4331080eed9d2713807e9a3f47610947d5b0a1d7"
dependencies:
decache "^4.4.0"
glob "^7.1.2"

View File

@@ -1110,6 +1110,6 @@
"mocha-junit-reporter": "^1.17.0",
"mocha-multi-reporters": "^1.1.7",
"typemoq": "^2.1.0",
"vscodetestcover": "github:corivera/vscodetestcover#1.0.6"
"vscodetestcover": "github:corivera/vscodetestcover#1.0.8"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -564,7 +564,7 @@
"mocha-multi-reporters": "^1.1.7",
"should": "^13.2.3",
"typemoq": "^2.1.0",
"vscodetestcover": "github:corivera/vscodetestcover#1.0.6"
"vscodetestcover": "github:corivera/vscodetestcover#1.0.8"
},
"enableProposedApi": true
}

View File

@@ -1661,9 +1661,9 @@ vscode-nls@^4.0.0:
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.0.0.tgz#4001c8a6caba5cedb23a9c5ce1090395c0e44002"
integrity sha512-qCfdzcH+0LgQnBpZA53bA32kzp9rpq/f66Som577ObeuDlFIrtbEJ+A/+CCxjIh4G8dpJYNCKIsxpRAHIfsbNw==
"vscodetestcover@github:corivera/vscodetestcover#1.0.6":
version "1.0.5"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/14e0f2c46346b31bc1af2c590febeaf69a9112eb"
"vscodetestcover@github:corivera/vscodetestcover#1.0.8":
version "1.0.8"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/4331080eed9d2713807e9a3f47610947d5b0a1d7"
dependencies:
decache "^4.4.0"
glob "^7.1.2"

View File

@@ -362,6 +362,6 @@
"mocha-junit-reporter": "^1.17.0",
"mocha-multi-reporters": "^1.1.7",
"typemoq": "^2.1.0",
"vscodetestcover": "github:corivera/vscodetestcover#1.0.6"
"vscodetestcover": "github:corivera/vscodetestcover#1.0.8"
}
}

View File

@@ -766,9 +766,9 @@ vscode-nls@^4.0.0:
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.1.tgz#f9916b64e4947b20322defb1e676a495861f133c"
integrity sha512-4R+2UoUUU/LdnMnFjePxfLqNhBS8lrAFyX7pjb2ud/lqDkrUavFUTcG7wR0HBZFakae0Q6KLBFjMS6W93F403A==
"vscodetestcover@github:corivera/vscodetestcover#1.0.6":
version "1.0.5"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/14e0f2c46346b31bc1af2c590febeaf69a9112eb"
"vscodetestcover@github:corivera/vscodetestcover#1.0.8":
version "1.0.8"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/4331080eed9d2713807e9a3f47610947d5b0a1d7"
dependencies:
decache "^4.4.0"
glob "^7.1.2"

View File

@@ -75,7 +75,7 @@
"mocha-multi-reporters": "^1.1.7",
"should": "^13.2.1",
"typemoq": "^2.1.0",
"vscodetestcover": "github:corivera/vscodetestcover#1.0.6"
"vscodetestcover": "github:corivera/vscodetestcover#1.0.8"
},
"__metadata": {
"id": "37",

View File

@@ -808,9 +808,9 @@ vscode-nls@^4.0.0:
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.1.1.tgz#f9916b64e4947b20322defb1e676a495861f133c"
integrity sha512-4R+2UoUUU/LdnMnFjePxfLqNhBS8lrAFyX7pjb2ud/lqDkrUavFUTcG7wR0HBZFakae0Q6KLBFjMS6W93F403A==
"vscodetestcover@github:corivera/vscodetestcover#1.0.6":
version "1.0.5"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/14e0f2c46346b31bc1af2c590febeaf69a9112eb"
"vscodetestcover@github:corivera/vscodetestcover#1.0.8":
version "1.0.8"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/4331080eed9d2713807e9a3f47610947d5b0a1d7"
dependencies:
decache "^4.4.0"
glob "^7.1.2"

View File

@@ -269,6 +269,6 @@
"tslint": "^5.8.0",
"typemoq": "^2.1.0",
"typescript": "^2.6.1",
"vscodetestcover": "github:corivera/vscodetestcover#1.0.6"
"vscodetestcover": "github:corivera/vscodetestcover#1.0.8"
}
}

View File

@@ -901,9 +901,9 @@ vscode-nls@^3.2.1:
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.5.tgz#25520c1955108036dec607c85e00a522f247f1a4"
integrity sha512-ITtoh3V4AkWXMmp3TB97vsMaHRgHhsSFPsUdzlueSL+dRZbSNTZeOmdQv60kjCV306ghPxhDeoNUEm3+EZMuyw==
"vscodetestcover@github:corivera/vscodetestcover#1.0.6":
version "1.0.5"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/14e0f2c46346b31bc1af2c590febeaf69a9112eb"
"vscodetestcover@github:corivera/vscodetestcover#1.0.8":
version "1.0.8"
resolved "https://codeload.github.com/corivera/vscodetestcover/tar.gz/4331080eed9d2713807e9a3f47610947d5b0a1d7"
dependencies:
decache "^4.4.0"
glob "^7.1.2"

View File

@@ -47,7 +47,7 @@ if "%SKIP_PYTHON_INSTALL_TEST%" == "1" (
)
call %INTEGRATION_TEST_ELECTRON_PATH% --user-data-dir=%VSCODEUSERDATADIR% --extensions-dir=%VSCODEEXTENSIONSDIR% --remote-debugging-port=9222 ^
--extensionDevelopmentPath=%~dp0\..\extensions\integration-tests --extensionTestsPath=%~dp0\..\extensions\integration-tests\out\tests --disable-telemetry --disable-crash-reporter --disable-updates -nogpu
--extensionDevelopmentPath=%~dp0\..\extensions\integration-tests --extensionTestsPath=%~dp0\..\extensions\integration-tests\out\test --disable-telemetry --disable-crash-reporter --disable-updates -nogpu
rmdir /s /q %VSCODEUSERDATADIR%
rmdir /s /q %VSCODEEXTENSIONSDIR%