Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Code coverage report (#559)
Browse files Browse the repository at this point in the history
* Add UT code coverage report

* updates

* updates

* updates

* updates

* updates

* updates

* integration test python code coverage report
  • Loading branch information
chicm-ms authored Jan 3, 2019
1 parent 17a39d4 commit 50697a2
Show file tree
Hide file tree
Showing 10 changed files with 1,305 additions and 339 deletions.
15 changes: 15 additions & 0 deletions src/nni_manager/core/test/import_all.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as glob from 'glob';

// Istanbul only generates report for used/imported files, the files are not used/imported by test cases
// are not included in code coverage reports.
// This is a workaround to import all files in order to show all source files in code coverage reports.

glob.sync('**/*.ts').forEach((file) => {
if (file.indexOf('node_modules/') < 0 && file.indexOf('types/') < 0
&& file.indexOf('.test.ts') < 0 && file.indexOf('main.ts')) {
try {
import('../../' + file);
} catch(err) {
}
}
})
35 changes: 30 additions & 5 deletions src/nni_manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@
"scripts": {
"postbuild": "cp -rf scripts ./dist/ && cp -rf config ./dist/",
"build": "tsc",
"test": "mocha -r ts-node/register -t 15000 --recursive **/*.test.ts --exclude node_modules/**/**/*.test.ts --exclude core/test/nnimanager.test.ts --colors",
"test": "nyc mocha -r ts-node/register -t 15000 --recursive **/*.test.ts --exclude node_modules/**/**/*.test.ts --exclude core/test/nnimanager.test.ts --colors",
"start": "node dist/main.js",
"tslint": "tslint -p ."
},
"license": "MIT",
"dependencies": {
"azure-storage": "^2.10.2",
"chai-as-promised": "^7.1.1",
"child-process-promise": "^2.2.1",
"express": "^4.16.3",
"express-joi-validator": "^2.0.0",
"js-base64": "^2.4.9",
"kubernetes-client": "^6.5.0",
"node-nvidia-smi": "^1.0.0",
"rx": "^4.1.0",
"sqlite3": "^4.0.2",
Expand All @@ -25,15 +28,13 @@
"ts-deferred": "^1.0.4",
"typescript-ioc": "^1.2.4",
"typescript-string-operations": "^1.3.1",
"webhdfs": "^1.2.0",
"azure-storage": "^2.10.2",
"kubernetes-client": "^6.5.0",
"js-base64": "^2.4.9"
"webhdfs": "^1.2.0"
},
"devDependencies": {
"@types/chai": "^4.1.4",
"@types/chai-as-promised": "^7.1.0",
"@types/express": "^4.16.0",
"@types/glob": "^7.1.1",
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.18",
"@types/request": "^2.47.1",
Expand All @@ -43,7 +44,9 @@
"@types/stream-buffers": "^3.0.2",
"@types/tmp": "^0.0.33",
"chai": "^4.1.2",
"glob": "^7.1.3",
"mocha": "^5.2.0",
"nyc": "^13.1.0",
"request": "^2.87.0",
"rmdir": "^1.2.0",
"tmp": "^0.0.33",
Expand All @@ -54,5 +57,27 @@
},
"engines": {
"node": ">=10.0.0"
},
"nyc": {
"include": [
"**/*.ts"
],
"exclude": [
"**/test/*",
"./node_modules/"
],
"extension": [
".ts",
".tsx"
],
"require": [
"ts-node/register"
],
"reporter": [
"text-summary",
"html"
],
"sourceMap": true,
"instrument": true
}
}
Loading

0 comments on commit 50697a2

Please sign in to comment.