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

Commit

Permalink
🚛 Upload container generated coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
st3v3nhunt committed Jul 29, 2019
1 parent 80c5611 commit 8c85e64
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ lib-cov

# Coverage directory used by tools like istanbul
coverage
lcov.info

# nyc test coverage
.nyc_output
Expand Down
4 changes: 3 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ jobs:
fi
displayName: Set variables for future tasks
- bash: |
COVERALLS_REPO_TOKEN=$(PIPELINE_COVERALLS_REPO_TOKEN) ./scripts/test-ci
export COVERALLS_SERVICE_NAME='Azure Devops'
export COVERALLS_REPO_TOKEN=$(PIPELINE_COVERALLS_REPO_TOKEN)
./scripts/test-ci
if [ -n "$CUSTOM_PRID" ]; then
export CI_PULL_REQUEST=$CUSTOM_PRID
Expand Down
8 changes: 0 additions & 8 deletions docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,7 @@ services:
volumes:
- sh-test-ci-node_modules:/code/node_modules
environment:
- BUILD_BUILDID=$BUILD_BUILDID
- BUILD_SOURCEBRANCHNAME=$BUILD_SOURCEBRANCHNAME
- BUILD_SOURCEVERSION=$BUILD_SOURCEVERSION
- COVERALLS_GIT_BRANCH=$BUILD_SOURCEBRANCH
- COVERALLS_REPO_TOKEN=$COVERALLS_REPO_TOKEN
- COVERALLS_SERVICE_NAME='Azure DevOps'
- SEARCH_API_KEY=fake-search-api-key
- SYSTEM_PULLREQUEST_PULLREQUESTNUMBER=$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER
- TF_BUILD=$TF_BUILD

volumes:
sh-test-node_modules:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"lint-watch": "esw --watch .",
"start-watch": "yarn brunch watch & nodemon --inspect=0.0.0.0 app.js | ./node_modules/bunyan/bin/bunyan",
"test": "NODE_ENV=test mocha --exit --recursive test",
"test-ci": "yarn ci-hook && yarn coverage-upload-coveralls",
"test-ci": "yarn ci-hook",
"test-unit": "NODE_ENV=test mocha --recursive test/unit",
"test-unit-watch": "NODE_ENV=test mocha --recursive test/unit --reporter min --watch",
"test-integration-watch": "NODE_ENV=test mocha --recursive test/integration --reporter min --watch",
Expand Down
7 changes: 7 additions & 0 deletions scripts/test-ci
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@
docker-compose -p test-ci -f docker-compose-tests.yml down -v
docker-compose -p test-ci -f docker-compose-tests.yml build test-ci
docker-compose -p test-ci -f docker-compose-tests.yml run test-ci
# Copy coverage from the image to the host
# CONTAINER_ID=$(docker ps -af 'name=test-ci' --format '{{.ID}}')
docker cp "$(docker ps -af 'name=test-ci' --format '{{.ID}}'):/code/coverage/" .
# Install coveralls into the CI container to perform upload
mkdir run-coveralls && cd run-coveralls && npm init -f && npm install coveralls
cd ..
cat ./coverage/lcov.info | ./run-coveralls/node_modules/coveralls/bin/coveralls.js

0 comments on commit 8c85e64

Please sign in to comment.