This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 457
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #425 from MaciejBaj/408-coverage-coveralls
Implement test coverage report - Closes #408
- Loading branch information
Showing
8 changed files
with
123 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
TRAVIS_BUILD_NUMBER=$1 | ||
JOB_NUMBER=$2 | ||
TEST_TYPE=$3 | ||
TRAVIS_BUILD_DIR=$4 | ||
TRAVIS_BRANCH=$5 | ||
TRAVIS_PULL_REQUEST_BRANCH=$6 | ||
|
||
if [ ${TEST_TYPE} == "FUNC" ]; then | ||
npm run fetchCoverage; | ||
fi | ||
bash .travis/send-report.sh \ | ||
${TRAVIS_BUILD_NUMBER} \ | ||
${JOB_NUMBER} \ | ||
${TEST_TYPE} \ | ||
${TRAVIS_BUILD_DIR} \ | ||
${TRAVIS_BRANCH} \ | ||
${TRAVIS_PULL_REQUEST_BRANCH}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
TRAVIS_BUILD_NUMBER=$1 | ||
JOB_NUMBER=$2 | ||
TEST_TYPE=$3 | ||
TRAVIS_BUILD_DIR=$4 | ||
TRAVIS_BRANCH=$5 | ||
TRAVIS_PULL_REQUEST_BRANCH=$6 | ||
|
||
if [ -z ${TRAVIS_BUILD_NUMBER+x} ] || [ -z ${JOB_NUMBER+x} ] || [ -z ${TEST_TYPE+x} ] || \ | ||
[ -z ${TRAVIS_BUILD_DIR+x} ] || [ -z ${TRAVIS_BRANCH+x} ] || [ -z ${TRAVIS_PULL_REQUEST_BRANCH+x} ]; then | ||
echo "Provide all script parameters." | ||
exit 1 | ||
fi | ||
|
||
COVERAGE_DIR=${TRAVIS_BUILD_DIR}/test | ||
|
||
if [ ${TEST_TYPE} == "FUNC" ]; then | ||
REPORT_NAME=".coverage-func"; | ||
unzip ${COVERAGE_DIR}/.coverage-func.zip -d ${COVERAGE_DIR}/${REPORT_NAME} | ||
else | ||
REPORT_NAME=".coverage-unit"; | ||
fi | ||
|
||
if [ ! -e ${COVERAGE_DIR}/${REPORT_NAME}/lcov.info ]; then | ||
echo "Cannot find the report at path $COVERAGE_DIR/$REPORT_NAME"; | ||
exit 1 | ||
fi | ||
|
||
if [ -n ${TRAVIS_PULL_REQUEST_BRANCH+x} ] && [ -n ${TRAVIS_PULL_REQUEST_BRANCH} ]; then | ||
BRANCH=${TRAVIS_PULL_REQUEST_BRANCH} | ||
else | ||
BRANCH=${TRAVIS_BRANCH} | ||
fi | ||
|
||
COVERALLS_SERVICE_NAME="travis-ci" | ||
COVERALLS_REPO_TOKEN=7s05KDqmPWkwZ6nzU5WtznKkt5FKDE3kv | ||
COVERALLS_PARALLEL=true | ||
COVERALLS_SERVICE_JOB_ID=JOB_NUMBER | ||
|
||
yarn global add coveralls | ||
cat ${COVERAGE_DIR}/${REPORT_NAME}/lcov.info | coveralls | ||
|
||
if [ -z $? ] || [ $? -eq 1 ]; then | ||
echo ${COVERAGE_DIR}/${REPORT_NAME}/lcov.info "SEND TO COVERALLS" | ||
else | ||
echo "Unable to create reports: " $? | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
--reporter spec | ||
--quiet false | ||
--clearRequireCache false | ||
--noFail false | ||
--noFail false |