Skip to content

Commit

Permalink
feat(coverage): Add coveralls coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
vbudhram committed Feb 11, 2020
1 parent 3b53139 commit a8099f3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
version: 2.1
orbs:
coveralls: coveralls/coveralls@1.0.4

executors:
nodejs:
Expand Down Expand Up @@ -78,6 +80,8 @@ jobs:
command: docker pull jdlk7/firestore-emulator && docker run -d --name gcloud-firestore -p 8006:9090 jdlk7/firestore-emulator

- run: ../../.circleci/build-test-deploy.sh << parameters.test >>
- coveralls/upload:
flag_name: << parameters.module >>

deploy-module:
executor: nodejs
Expand Down Expand Up @@ -254,6 +258,7 @@ jobs:
./_scripts/gh-pages.sh
fi
workflows:
test:
jobs:
Expand Down
4 changes: 3 additions & 1 deletion .circleci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ if grep -e "$MODULE" -e 'all' $DIR/../packages/test.list; then
elif [[ -e Dockerfile-test ]]; then
docker build -f Dockerfile-test -t ${MODULE}:test .

docker run --net="host" ${MODULE}:test npm run ${TEST:-test}
docker run --net="host" --name="${MODULE}" ${MODULE}:test npm run ${TEST:-test}

docker cp ${MODULE}:/app/reports/coverage ./coverage || true

if grep eslint "$DIR/../packages/$MODULE/Gruntfile.js"; then
docker run --net="host" ${MODULE}:test /app/node_modules/.bin/grunt eslint
Expand Down
16 changes: 9 additions & 7 deletions packages/fxa-auth-db-mysql/scripts/mocha-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ const NYC_BIN = path.join(
'nyc'
);

let bin = NYC_BIN;
let argv = ['--cache', MOCHA_BIN];

if (process.env.NO_COVERAGE) {
bin = MOCHA_BIN;
argv = [];
}
const bin = NYC_BIN;
const argv = [
'--cache',
'--no-clean',
'--reporter=lcov',
'--reporter=text',
'--report-dir=reports/coverage',
MOCHA_BIN,
];

const p = spawn(bin, argv.concat(process.argv.slice(2)), {
stdio: 'inherit',
Expand Down

0 comments on commit a8099f3

Please sign in to comment.