From 8f2e94541a342a54ee62def68c134a31b5dca9c4 Mon Sep 17 00:00:00 2001 From: Piotr Puszkiewicz Date: Fri, 16 Mar 2018 16:48:57 -0700 Subject: [PATCH 1/3] delimiter -> seperator because they ARE different --- test/coverageWritingTestRunner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/coverageWritingTestRunner.ts b/test/coverageWritingTestRunner.ts index 2f5d84d853..c484a8de0d 100644 --- a/test/coverageWritingTestRunner.ts +++ b/test/coverageWritingTestRunner.ts @@ -65,7 +65,7 @@ export default class CoverageWritingTestRunner { remapIstanbulPath = path.join(process.env.CODE_EXTENSIONS_PATH, "node_modules", "remap-istanbul", "bin", "remap-istanbul.js"); nodePath = process.env.NVM_BIN; if (nodePath) { - nodePath = `${nodePath}${path.delimiter}`; + nodePath = `${nodePath}${path.sep}`; } await fs.writeTextFile(rawCoverageJsonPath, JSON.stringify(__coverage__)); From 9b2a1984a578efb8245ca56ee3328a5e12d64b8b Mon Sep 17 00:00:00 2001 From: Piotr Puszkiewicz Date: Tue, 20 Mar 2018 16:16:22 -0700 Subject: [PATCH 2/3] enable coverage reporting by test type --- package.json | 10 ++++++---- test/coverageWritingTestRunner.ts | 8 ++++---- test/featureTests/index.ts | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index b7545c2ef3..5539326fa6 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "watch": "tsc -watch -p ./", "tdd": "npm run test:unit -- --watch --watch-extensions ts", "test": "npm-run-all test:feature test:unit test:integration", - "test:unit": "nyc mocha --ui tdd -- test/unitTests/**/*.test.ts", + "test:unit": "nyc -r lcovonly --report-dir coverage/unit mocha --ui tdd -- test/unitTests/**/*.test.ts", "test:feature": "cross-env OSVC_SUITE=featureTests CODE_EXTENSIONS_PATH=./ CODE_TESTS_PATH=./out/test/featureTests npm run test:runInVsCode", "test:integration": "npm-run-all test:integration:*", "test:integration:singleCsproj": "cross-env OSVC_SUITE=singleCsproj npm run test:runSuiteInVsCode", @@ -40,9 +40,11 @@ "test:runInVsCode": "node ./test/runVsCodeTestsWithAbsolutePaths.js", "postinstall": "node ./node_modules/vscode/bin/install", "cov:instrument": "rimraf ./coverage && rimraf ./.nyc_output && rimraf ./out && npm run compile && cd out && nyc instrument --require source-map-support/register --cwd ../ . . && cd ..", - "cov:merge": "cd ./out && istanbul-combine -d ../coverage -r lcovonly ../.nyc_output/*.json && cd ..", - "cov:merge-html": "istanbul-combine -d ./coverage -r html ./.nyc_output/*.json", - "cov:report": "npm run cov:merge && codecov" + "cov:merge": "cd ./out && istanbul-combine -d ../coverage/integration -r lcovonly ../.nyc_output/integration/*.json && cd ..", + "cov:merge-html": "istanbul-combine -d ./coverage -r html ./.nyc_output/integration/*.json", + "cov:report": "npm-run-all cov:report:integration cov:report:unit", + "cov:report:unit": "codecov --file ./coverage/unit/lcov.info", + "cov:report:integration": "npm run cov:merge && codecov" }, "nyc": { "include": [ diff --git a/test/coverageWritingTestRunner.ts b/test/coverageWritingTestRunner.ts index c484a8de0d..a4f139657b 100644 --- a/test/coverageWritingTestRunner.ts +++ b/test/coverageWritingTestRunner.ts @@ -46,7 +46,7 @@ export default class CoverageWritingTestRunner { private async writeCoverage(): Promise { if (typeof __coverage__ !== 'undefined') { - let nycFolderPath = path.join(process.env.CODE_EXTENSIONS_PATH, ".nyc_output"); + let nycFolderPath = path.join(process.env.CODE_EXTENSIONS_PATH, ".nyc_output", "integration"); if (!(await fs.exists(nycFolderPath))) { await fs.mkdir(nycFolderPath); @@ -63,9 +63,9 @@ export default class CoverageWritingTestRunner { remappedCoverageJsonPath = path.join(nycFolderPath, `${process.env.OSVC_SUITE}.json`); outFolderPath = path.join(process.env.CODE_EXTENSIONS_PATH, "out"); remapIstanbulPath = path.join(process.env.CODE_EXTENSIONS_PATH, "node_modules", "remap-istanbul", "bin", "remap-istanbul.js"); - nodePath = process.env.NVM_BIN; - if (nodePath) { - nodePath = `${nodePath}${path.sep}`; + nodePath = ""; + if (process.env.NVM_BIN) { + nodePath = `${process.env.NVM_BIN}${path.sep}`; } await fs.writeTextFile(rawCoverageJsonPath, JSON.stringify(__coverage__)); diff --git a/test/featureTests/index.ts b/test/featureTests/index.ts index 9b5ad6600f..5eec1b9ba2 100644 --- a/test/featureTests/index.ts +++ b/test/featureTests/index.ts @@ -23,7 +23,7 @@ let testRunner = new coverageWritingTestRunner(require('vscode/lib/testrunner')) // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info testRunner.configure({ - timeout: 10000, + timeout: 100000, ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) useColors: true // colored output from test results }); From 84a90a4b10e63f36c72b38c527fea5b652dbca0f Mon Sep 17 00:00:00 2001 From: Piotr Puszkiewicz Date: Wed, 21 Mar 2018 11:24:23 -0700 Subject: [PATCH 3/3] add flags --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5539326fa6..3edac89636 100644 --- a/package.json +++ b/package.json @@ -43,8 +43,8 @@ "cov:merge": "cd ./out && istanbul-combine -d ../coverage/integration -r lcovonly ../.nyc_output/integration/*.json && cd ..", "cov:merge-html": "istanbul-combine -d ./coverage -r html ./.nyc_output/integration/*.json", "cov:report": "npm-run-all cov:report:integration cov:report:unit", - "cov:report:unit": "codecov --file ./coverage/unit/lcov.info", - "cov:report:integration": "npm run cov:merge && codecov" + "cov:report:unit": "codecov -f \"coverage/unit/lcov.info\" -F unit", + "cov:report:integration": "npm run cov:merge && codecov -f \"coverage/integration/lcov.info\" -F integration" }, "nyc": { "include": [