Skip to content

Commit

Permalink
[WIP] CI shuffle.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Sneeringer committed Mar 7, 2017
1 parent a28beb9 commit 093a6da
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 44 deletions.
34 changes: 19 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
language: python
sudo: false

addons:
apt:
sources:
- deadsnakes
packages:
- python3.5
matrix:
include:
- python: 2.7
env:
- TOXENV=py27
- TOXENV=system-tests
- python: 3.4
env: TOXENV=py34
- python: 3.5
env:
- TOXENV=py35
- TOXENV=lint
- python: 3.6
env:
- TOXENV=py36
- TOXENV=system-tests

install:
- pip install --upgrade pip tox
- pip install --upgrade pip
- pip install --upgrade tox

This comment has been minimized.

Copy link
@dhermes

dhermes Mar 8, 2017

This is actually inferior to upgrading both at once (pip reasons)

This comment has been minimized.

Copy link
@lukesneeringer

lukesneeringer Mar 8, 2017

Owner

Consider this file to not be done. :-)


script:
- python2.7 scripts/run_unit_tests.py
- if [[ "${TRAVIS_EVENT_TYPE}" != "pull_request" ]]; then python3.4 scripts/run_unit_tests.py; fi
- python3.5 scripts/run_unit_tests.py
- python scripts/run_unit_tests.py --tox-env cover
- tox -e lint
- tox -e system-tests
- tox -e system-tests3
- scripts/update_docs.sh
- tox

after_success:
- scripts/coveralls.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,4 @@ def unique_resource_id(delimiter='_'):
if build_id == '':
return '%s%d' % (delimiter, 1000 * time.time())
else:
return '%s%s%s%d' % (delimiter, build_id,
delimiter, time.time())
return '%s%s%s%d' % (delimiter, build_id, delimiter, time.time())
File renamed without changes.
Empty file added language/tests/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions system_tests/language.py → language/tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
from google.cloud import language
from google.cloud import storage

from system_test_utils import unique_resource_id
from retry import RetryErrors
from google.cloud._system_test_utils import unique_resource_id
from google.cloud._system_test_utils.retry import RetryErrors

This comment has been minimized.

Copy link
@dhermes

dhermes Mar 8, 2017

I am 👎 on shipping google.cloud._system_test_utils with core



class Config(object):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
73 changes: 48 additions & 25 deletions language/tox.ini
Original file line number Diff line number Diff line change
@@ -1,35 +1,58 @@
[tox]
envlist =
py27,py34,py35,cover
{py27,py34,py35,py36}-unit
{py27,py36}-system

This comment has been minimized.

Copy link
@dhermes

dhermes Mar 8, 2017

So tox -e py27 will still be valid (per tox). Also, principal of least surprise probably dictates you shouldn't call them pyFOO-unit but rather pyFOO.

This comment has been minimized.

Copy link
@lukesneeringer

lukesneeringer Mar 8, 2017

Owner

I can be behind that. So, tox -e py36 gives you the Python 3.6 unit tests, and tox -e py36-system gives you the Python 3.6 system tests.

lint
cover

[testing]
localdeps =
pip install --quiet --upgrade {toxinidir}/../core
deps =
{toxinidir}/../core
mock
pytest
covercmd =
py.test --quiet \
--cov=google.cloud.language \
--cov=unit_tests \
--cov-config {toxinidir}/.coveragerc \
unit_tests

[testenv]
commands =
{[testing]localdeps}
py.test --quiet {posargs} unit_tests
basepython =
py27: python2.7
py34: python3.4
py35: python3.5
py36: python3.6

deps =
{[testing]deps}
mock
pytest
pytest-cov
{toxinidir}/../core

This comment has been minimized.

Copy link
@dhermes

dhermes Mar 8, 2017

This was intentionally not in deps. See googleapis#2705

system: {toxinidir}/../storage
usedevelop = True

This comment has been minimized.

Copy link
@dhermes

dhermes Mar 8, 2017

We've had issues with this due to namespace packages, but maybe they are magically resolved?

This comment has been minimized.

Copy link
@lukesneeringer

lukesneeringer Mar 8, 2017

Owner

I had issues with it off, because coverage treated each per-version installation as separate.

This comment has been minimized.

Copy link
@dhermes

dhermes Mar 8, 2017

Yeah I'm not opposed to usedevelop, just wanted to give a warning of our previous failures


commands =
unit: py.test --quiet \
unit: --cov=google.cloud.language --cov tests.unit \
unit: --cov-config {toxinidir}/.coveragerc \
unit: --cov-append --cov-report= --cov-fail-under=97 \
unit: tests/unit

This comment has been minimized.

Copy link
@dhermes

dhermes Mar 8, 2017

Is unit: needed on every line, even with the continuation? (Seems pretty icky)

This comment has been minimized.

Copy link
@lukesneeringer

lukesneeringer Mar 8, 2017

Owner

Sadly yes. :-(

system: py.test --quiet tests/system.py

passenv =
CI_*
CIRCLE*
GOOGLE_*
TRAVIS*


[testenv:cover]
basepython =
python2.7
basepython = python3.6
deps =
coverage
pytest-cov
commands =
{[testing]localdeps}
{[testing]covercmd}
coverage report --show-missing --fail-under=100
coverage erase


[testenv:lint]
basepython = python3.5
deps =
{[testing]deps}
coverage
pytest-cov
pycodestyle
pylint
changedir={toxinidir}/../
usedevelop = False
commands =
pycodestyle language/
pylint google.cloud.language

0 comments on commit 093a6da

Please sign in to comment.