-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test for 2.6, 3.5 and 3.6; use stasher for total coverage.
- Loading branch information
Showing
6 changed files
with
99 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
*.pyc | ||
*.egg | ||
*.egg-info | ||
*.eggs | ||
.coverage | ||
.coverage.* | ||
.idea | ||
.DS_Store | ||
.tox | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,45 @@ | ||
language: python | ||
sudo: false | ||
|
||
python: | ||
- "2.7" | ||
- "3.3" | ||
- "3.4" | ||
python: 3.5 | ||
|
||
env: | ||
# NOTE: On Travis web page define private STASH_URL, STASH_TOKEN, STASH_SECRET. | ||
global: | ||
- STASH_BOX=$TRAVIS_REPO_SLUG:$TRAVIS_BUILD_NUMBER:$STASH_SECRET | ||
matrix: | ||
- TOXENV=py27 | ||
- TOXENV=py34 | ||
- TOXENV=py35 | ||
- TOXENV=lint | ||
- TOXENV=coverage | ||
|
||
matrix: | ||
include: | ||
- env: TOXENV=py26 | ||
python: 2.6 | ||
- env: TOXENV=py33 | ||
python: 3.3 | ||
- env: TOXENV=py36 | ||
python: 3.6 | ||
|
||
install: | ||
- if [[ "${TRAVIS_PYTHON_VERSION}" == "2.6" ]]; then pip install importlib unittest2 "markdown<=2.4"; fi | ||
- pip install flake8 python-coveralls | ||
- pip install -e . | ||
- pip install "file://`pwd`#egg=content-io[tests]" | ||
- pip install --upgrade pip | ||
- pip install tox stasher | ||
|
||
script: | ||
- make flake8 | ||
- coverage run --source cio runtests.py | ||
- coverage report | ||
- if [[ $TOXENV =~ coverage ]] && [ -n "$STASH_SECRET" ]; then | ||
stash pull $STASH_BOX -wc $(TOXENV= tox -l | wc -l); | ||
fi | ||
- if [[ ! $TOXENV =~ coverage ]] || [ -n "$STASH_SECRET" ]; then | ||
tox; | ||
fi | ||
- if [[ $TOXENV =~ py ]] && [ -n "$STASH_SECRET" ]; then | ||
stash push $STASH_BOX $(ls .coverage.*); | ||
fi | ||
|
||
after_success: | ||
- coveralls | ||
- if [[ $TOXENV =~ coverage ]]; then | ||
pip install --quiet python-coveralls; | ||
coveralls --ignore-errors; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,35 @@ | ||
.DEFAULT_GOAL := help | ||
|
||
.PHONY: help # shows available commands | ||
help: | ||
@echo "\nAvailable commands:\n\n $(shell sed -n 's/^.PHONY:\(.*\)/ *\1\\n/p' Makefile)" | ||
|
||
.PHONY: test | ||
test: | ||
python setup.py test | ||
coverage run setup.py test | ||
|
||
.PHONY: test_all # runs tests using detox, combines coverage and reports it | ||
test_all: | ||
detox | ||
make coverage | ||
|
||
flake8: | ||
.PHONY: lint | ||
lint: | ||
flake8 cio | ||
|
||
.PHONY: install | ||
install: | ||
python setup.py install | ||
|
||
.PHONY: develop | ||
develop: | ||
python setup.py develop | ||
|
||
.PHONY: coverage | ||
coverage: | ||
coverage run --source cio setup.py test && \ | ||
coverage report | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf .tox/ dist/ *.egg *.egg-info .coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
[flake8] | ||
ignore = E501,E731 | ||
max-line-length = 100 | ||
ignore = E731 | ||
max-line-length = 120 | ||
exclude = .tox,.git,docs | ||
max-complexity = 12 | ||
|
||
[coverage:run] | ||
source = cio | ||
branch = True | ||
parallel = True | ||
|
||
[coverage:report] | ||
fail_under = 93 | ||
skip_covered = True | ||
show_missing = True | ||
|
||
# Regex expressions for lines excluded from report | ||
exclude_lines = | ||
pragma: no cover | ||
if __name__ == .__main__.: | ||
raise NotImplementedError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters