Skip to content

Commit

Permalink
test: Make Coveralls, Code Climate branch URLs
Browse files Browse the repository at this point in the history
More specific than the generic top-level URLs.
  • Loading branch information
mbland committed May 13, 2017
1 parent ffec385 commit ab07b78
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ declare GITHUB_REPO="$(git config --show remote.origin.url)"
GITHUB_REPO="${GITHUB_REPO##*@github.com:}"
GITHUB_REPO="${GITHUB_REPO%.git}"

declare GIT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"

_test_mocha_flags() {
local flag_line_pattern='^ *-'
local line
Expand Down Expand Up @@ -169,15 +171,15 @@ _test_coverage() {
return 1
fi
printf 'Coverage report sent to Coveralls: %s' \
"https://coveralls.io/github/$GITHUB_REPO"
"https://coveralls.io/github/${GITHUB_REPO}?branch=${GIT_BRANCH}"

if [[ -n "$CODECLIMATE_REPO_TOKEN" ]]; then
if ! codeclimate-test-reporter < "$lcov_info_path"; then
echo 'Failed to send coverage report to Code Climate.' >&2
echo 'Failed to send report to Code Climate.' >&2
return 1
fi
printf 'Coverage report sent to Code Climate: %s' \
"https://codeclimate.com/github/$GITHUB_REPO"
printf 'Report sent to Code Climate: %s' \
"https://codeclimate.com/github/${GITHUB_REPO}/compare/${GIT_BRANCH}"
fi
fi
return "$result"
Expand Down

0 comments on commit ab07b78

Please sign in to comment.