Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send coverage reports to Codacy #5444

Merged
merged 7 commits into from
Jan 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ jobs:
sudo apt-get install -y --allow-downgrades mongodb-org=3.6.14 mongodb-org-server=3.6.14 mongodb-org-shell=3.6.14 mongodb-org-mongos=3.6.14 mongodb-org-tools=3.6.14
- name: Start MongoDB
run: sudo systemctl start mongod
- name: Run tests
- name: Run Tests
run: npm run-script test-ci
- name: Send Coverage
run: npm run-script coverage
3 changes: 2 additions & 1 deletion ci.test.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ HOSTNAME=localhost
INSECURE_USE_HTTP=true
PORT=1337
NODE_ENV=production
CI=true
CI=true
CODACY_PROJECT_TOKEN=cff7ab3377d6434a9355fd051dbb4595
105 changes: 105 additions & 0 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
"scripts": {
"start": "node server.js",
"test": "env-cmd ./my.test.env mocha --exit tests/*.test.js",
"test-ci": "env-cmd ./ci.test.env mocha --exit tests/*.test.js",
"test-ci": "env-cmd ./ci.test.env nyc --reporter=lcov --reporter=text-summary mocha --exit tests/*.test.js",
"env": "env",
"postinstall": "webpack --mode production --config webpack.config.js && npm run-script update-buster",
"bundle": "webpack --mode production --config webpack.config.js && npm run-script update-buster",
"bundle-dev": "webpack --mode development --config webpack.config.js && npm run-script update-buster",
"bundle-analyzer": "webpack --mode development --config webpack.config.js --profile --json > stats.json && webpack-bundle-analyzer stats.json",
"update-buster": "node bin/generateCacheBuster.js >tmp/cacheBusterToken",
"coverage": "env-cmd ./test.env nyc mocha --exit tests/*.test.js",
"coverage": "cat ./coverage/lcov.info | env-cmd ./ci.test.env codacy-coverage",
"dev": "env-cmd ./my.env nodemon server.js 0.0.0.0",
"prod": "env-cmd ./my.prod.env node server.js 0.0.0.0"
},
Expand Down Expand Up @@ -123,6 +123,7 @@
"devDependencies": {
"babel-eslint": "^10.0.3",
"benv": "^3.3.0",
"codacy-coverage": "^3.4.0",
"csv-parse": "^4.8.3",
"env-cmd": "^8.0.2",
"eslint": "^6.2.1",
Expand Down
2 changes: 1 addition & 1 deletion tests/admintools.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ var someData = {

describe('admintools', function ( ) {
var self = this;
this.timeout(30000); // TODO: see why this test takes longer on Travis to complete
this.timeout(45000); // TODO: see why this test takes longer on CI to complete
before(function (done) {
benv.setup(function() {

Expand Down