From 1816f73b9b5ff9227590b1691ce7d8036a7b1ef8 Mon Sep 17 00:00:00 2001 From: James Talmage Date: Mon, 23 Nov 2015 23:01:37 -0500 Subject: [PATCH] Fix failing coveralls script. For PR's `process.env.COVERALLS_REPO_TOKEN` does not exist, so `tap` will not automatically send data to coveralls. Hence our existing script: `npm run coveralls`. Unfortuneately that seems to create problems to create problems when merged onto master. In that case `tap` **will** automatically push our coverage data, and the follow up push seems to fail. To fix all this, I check the environment variable in .travis.yaml, and manually push the coverage data if the environment variable does not exist. https://travis-ci.org/sindresorhus/ava/jobs/92855751 --- .travis.yml | 3 ++- package.json | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3fbe3aedf..0c48dee40 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,5 @@ node_js: - 'stable' - '0.12' - '0.10' -after_success: npm run coveralls +after_success: + - '[ -z "$COVERALLS_REPO_TOKEN" ] && tap --coverage-report=text-lcov | ./node_modules/.bin/coveralls' diff --git a/package.json b/package.json index fde2c9192..d0ef0fbc9 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,6 @@ "scripts": { "test": "xo && tap --coverage --reporter=spec --timeout=150 test/*.js", "test-win": "tap --reporter=spec --timeout=150 test/*.js", - "coveralls": "tap --coverage-report=text-lcov | coveralls", "coverage": "tap --coverage-report=lcov" }, "files": [