Skip to content

Re-enable codecov #364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
environment:
global:
PATH: "C:\\Python27\\Scripts\\;%PATH%"
PYTEST_COMMAND: "coverage run -m pytest"
matrix:
- TOXENV: py27-base
- TOXENV: py27-optional
Expand All @@ -16,7 +17,7 @@ environment:

install:
- git submodule update --init --recursive
- python -m pip install tox
- python -m pip install tox codecov

build: off

Expand All @@ -25,3 +26,6 @@ test_script:

after_test:
- python debug-info.py

on_success:
- codecov
17 changes: 9 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@ sudo: false
cache: pip

env:
- USE_OPTIONAL=true
- USE_OPTIONAL=false
- SIX_VERSION=1.9 USE_OPTIONAL=true
global:
- PYTEST_COMMAND="coverage run -m pytest"
matrix:
- TOXENV=optional
- TOXENV=base
- TOXENV=six19-optional

install:
- ./requirements-install.sh
- pip install tox codecov

script:
- if [[ $TRAVIS_PYTHON_VERSION == pypy* ]]; then py.test; fi
- if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then coverage run -m pytest; fi
- bash flake8-run.sh
- tox

after_script:
- python debug-info.py

after_success:
- if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then coverage combine && codecov; fi
- codecov
6 changes: 5 additions & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
-r requirements.txt

tox

flake8<3.0
pytest

pytest==3.2.5
coverage
pytest-expect>=1.1,<2.0
mock
18 changes: 10 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
[tox]
envlist = {py27,py33,py34,py35,py36,pypy}-{base,optional}
envlist = {py27,py33,py34,py35,py36,pypy}-{base,six19,optional}

[testenv]
deps =
flake8<3.0
pytest
pytest-expect>=1.1,<2.0
mock
base: six
base: webencodings
optional: -r{toxinidir}/requirements-optional.txt
-r{toxinidir}/requirements-test.txt
doc: Sphinx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like when this ran the tests with six==1.9, it'd also run the tests with the optional requirements. I'm pretty sure your changes don't do that--six19 is a separate environment from optional.

I don't know offhand if that's important, but it seems like if we want to maintain parity, it'd be better to add a line here like:

six19: -r{toxinidir}/requirements-optional.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, yes I missed that. It would be better to achieve that by using TOXENV=six19-optional .


passenv =
PYTEST_COMMAND
COVERAGE_RUN_OPTIONS
commands =
{envbindir}/py.test {posargs}
six19: pip install six==1.9
{env:PYTEST_COMMAND:{envbindir}/py.test} {posargs}
flake8 {toxinidir}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other projects I work on, I run flake8 as a separate environment because there isn't much reason to run it multiple times. Having said that, it seems like it only takes a few seconds on html5lib-python, so seems like it'd not a big deal here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flake8 could be moved out to a separate factor easily, and even a different testenv.

It is important to run flake8 on each version of python, as pyflakes is version dependent.

The benefit of keeping it in here is that devs dont need to remember to do it, and they typically only test on one environment. For CI, the running time is inconsequential compared to the rest of the very voluminous tests ;-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to everything you say here. Don't change what you have.


[testenv:doc]
changedir = doc
commands = sphinx-build -b html . _build

[flake8]
exclude = ./.tox