diff --git a/.travis.yml b/.travis.yml index 2579ffc0..b9af3d96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,4 +12,5 @@ before_script: - docker-compose -f docker-compose.yml -f docker-compose.ci.yml up --build -d script: - - docker exec -it cvat /bin/bash -c 'python3 manage.py test cvat/apps/engine && tests/node_modules/.bin/karma start tests/karma.conf.js' + - docker exec -it cvat /bin/bash -c 'python3 manage.py test cvat/apps/engine' + - docker exec -it cvat /bin/bash -c 'cd cvatjs && npm install && npm run test && npm run coveralls' diff --git a/Dockerfile b/Dockerfile index 0bb5f93a..ad0ac444 100644 --- a/Dockerfile +++ b/Dockerfile @@ -137,6 +137,7 @@ RUN if [ "$WITH_DEXTR" = "yes" ]; then \ COPY ssh ${HOME}/.ssh COPY cvat/ ${HOME}/cvat +COPY cvatjs/ ${HOME}/cvatjs COPY tests ${HOME}/tests # Binary option is necessary to correctly apply the patch on Windows platform. # https://unix.stackexchange.com/questions/239364/how-to-fix-hunk-1-failed-at-1-different-line-endings-message diff --git a/README.md b/README.md index 9cada872..18f9267b 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Build Status](https://travis-ci.org/opencv/cvat.svg?branch=develop)](https://travis-ci.org/opencv/cvat) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/840351da141e4eaeac6476fd19ec0a33)](https://app.codacy.com/app/nmanovic/cvat?utm_source=github.com&utm_medium=referral&utm_content=opencv/cvat&utm_campaign=Badge_Grade_Settings) [![Gitter chat](https://badges.gitter.im/opencv-cvat/gitter.png)](https://gitter.im/opencv-cvat) +[![Coverage Status](https://coveralls.io/repos/github/opencv/cvat/badge.svg?branch=)](https://coveralls.io/github/opencv/cvat?branch=develop) CVAT is free, online, interactive video and image annotation tool for computer vision. It is being used by our team to annotate million of objects with different properties. Many UI and UX decisions are based on feedbacks from professional data annotation team. diff --git a/cvatjs/jest.config.js b/cvatjs/jest.config.js index e966a4be..efa327eb 100644 --- a/cvatjs/jest.config.js +++ b/cvatjs/jest.config.js @@ -10,6 +10,8 @@ const { defaults } = require('jest-config'); module.exports = { + coverageDirectory: 'reports/coverage', + coverageReporters: ['lcov'], moduleFileExtensions: [ ...defaults.moduleFileExtensions, 'ts', @@ -17,7 +19,7 @@ module.exports = { ], reporters: [ 'default', - 'jest-junit', + ['jest-junit', { outputDirectory: 'reports/junit' }], ], testMatch: [ '**/tests/**/*.js', diff --git a/cvatjs/package.json b/cvatjs/package.json index 5ed05c7e..3c7831cd 100644 --- a/cvatjs/package.json +++ b/cvatjs/package.json @@ -5,8 +5,9 @@ "main": "babel.config.js", "scripts": { "build": "webpack", - "test": "jest --config=jest.config.js", - "docs": "jsdoc --readme README.md src/*.js -p -c jsdoc.config.js -d docs" + "test": "jest --config=jest.config.js --coverage", + "docs": "jsdoc --readme README.md src/*.js -p -c jsdoc.config.js -d docs", + "coveralls": "cat ./reports/coverage/lcov.info | coveralls" }, "author": "Intel", "license": "MIT", @@ -17,6 +18,7 @@ "babel-eslint": "^10.0.1", "babel-loader": "^8.0.6", "core-js": "^3.0.1", + "coveralls": "^3.0.5", "jest": "^24.8.0", "jest-junit": "^6.4.0", "jsdoc": "^3.6.2",