Skip to content

Commit 7b883b0

Browse files
committed
Fix coveralls execution on master
1 parent dfa7131 commit 7b883b0

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ environment:
77

88
matrix:
99
# coveralls is not in the default env list
10-
- TOXENV: "coveralls"
10+
- TOXENV: "coverage"
1111
# note: please use "tox --listenvs" to populate the build matrix below
1212
- TOXENV: "linting"
1313
- TOXENV: "py27"
@@ -42,7 +42,7 @@ install:
4242
build: false # Not a C# project, build stuff at the test step instead.
4343

4444
test_script:
45-
- call scripts\call-tox.bat
45+
- C:\Python36\python -m tox
4646

4747
cache:
4848
- '%LOCALAPPDATA%\pip\cache'

scripts/call-tox.bat

Lines changed: 0 additions & 8 deletions
This file was deleted.

scripts/maybe-coveralls.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
Calls "coveralls" to report code coverage to coveralls.io if we have COVERALLS_REPO_TOKEN defined in the environment,
3+
otherwise skip it.
4+
5+
This script is needed because "coveralls" without a token defined fails, and we want to execute the entire
6+
workflow even on PRs to detect errors earlier rather than only on master when COVERALLS_REPO_TOKEN is actually
7+
defined.
8+
"""
9+
10+
import os
11+
import subprocess
12+
13+
if os.environ.get("COVERALLS_REPO_TOKEN"):
14+
subprocess.check_call(["coveralls"])
15+
else:
16+
print("Skipping coveralls run because COVERALLS_REPO_TOKEN is not defined")

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,19 +178,19 @@ commands =
178178
{envpython} tox_run.py
179179

180180

181-
[testenv:coveralls]
181+
[testenv:coverage]
182182
passenv = CI TRAVIS TRAVIS_* COVERALLS_REPO_TOKEN
183183
usedevelop = True
184-
changedir = .
185184
deps =
186185
{[testenv]deps}
187186
coveralls
188187
codecov
189188
commands =
190-
coverage run -m pytest testing
189+
coverage run -m pytest testing/test_config.py
190+
coverage combine
191191
coverage report -m
192-
coveralls
193192
codecov
193+
python scripts/maybe-coveralls.py
194194

195195
[testenv:release]
196196
decription = do a release, required posarg of the version number

0 commit comments

Comments
 (0)