Skip to content

Commit

Permalink
Removing tox for clarity in CI and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
felipejinli authored and asn-d6 committed Apr 9, 2021
1 parent 95bd083 commit ba47277
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 47 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -34,7 +34,6 @@ pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
Expand Down
22 changes: 13 additions & 9 deletions .travis.yml
@@ -1,22 +1,26 @@
language: python
sudo: required
dist: bionic
python: 3.9
python: 3.7
env:
- TOXENV=py39 TEST=unit
- TOXENV=style
- TOXENV=docs
- TEST=unit
before_install:
# Install tor and chutney if doing functional tests
- if [[ $TEST == functional* ]]; then ./test/scripts/install-tor.sh; fi
- if [[ $TEST == 'functional_v2' ]]; then source test/scripts/install-chutney-v2.sh; fi
- if [[ $TEST == 'functional_v3' ]]; then source test/scripts/install-chutney-v3.sh; fi
install:
- pip install tox coveralls
- pip install -r requirements.txt
- pip install -r test-requirements.txt
script:
- if [[ $TEST == 'functional_v2' ]]; then tox ./test/functional/v2/;
elif [[ $TEST == 'functional_v3' ]]; then tox ./test/functional/v3/;
elif [[ $TEST == 'unit' ]]; then tox -- --ignore=./test/functional/;
else tox; fi
# Tests are run with linters
- if [[ $TEST == functional* ]];
then
source ./test/scripts/run-functional-tests.sh;
elif [[ $TEST == 'unit' ]];
then
source ./test/scripts/run-unit-tests.sh;
fi
- sphinx-build -W -b html -d ./docs/_build ./docs ./docs/_build/html
after_success:
- coveralls
1 change: 0 additions & 1 deletion MANIFEST.in
@@ -1,7 +1,6 @@
include README.rst
include COPYING
include requirements.txt
include tox.ini
recursive-include docs *.rst
recursive-include onionbalance/config_generator/data *
include versioneer.py
Expand Down
8 changes: 6 additions & 2 deletions setup.cfg
@@ -1,5 +1,5 @@
[tool:pytest]
norecursedirs = .tox _build tor chutney
norecursedirs = _build tor chutney

[bdist_wheel]
universal=1
Expand All @@ -10,4 +10,8 @@ style = pep440
versionfile_source = onionbalance/_version.py
versionfile_build = onionbalance/_version.py
tag_prefix =''
parentdir_prefix = onionbalance-
parentdir_prefix = onionbalance-

[flake8]
ignore = E501, E302, E251, E305, E261
exclude = onionbalance/hs_v3/ext/
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -50,8 +50,8 @@ def read(*names, **kwargs):
'future>=0.14.0',
'setproctitle',
'cryptography>=2.5',
],
tests_require=['tox', 'pytest-mock', 'pytest', 'mock', 'pexpect'],
],
tests_require=['pytest-mock', 'pytest', 'mock', 'pexpect', 'pylint', 'flake8', 'coveralls'],
package_data={'onionbalance.config_generator': ['data/*']},
include_package_data=True,
classifiers=[
Expand Down
4 changes: 4 additions & 0 deletions test-requirements.txt
Expand Up @@ -4,3 +4,7 @@ pytest-mock
pexpect
coveralls>=1.1
pytest-cov>=2.4
sphinx
pylint
flake8
coverage>=5.3.1
8 changes: 8 additions & 0 deletions test/scripts/run-functional-tests.sh
@@ -0,0 +1,8 @@
#!/bin/bash
set -ex

[[ $TEST ~= functional_(.*) ]]
version="${BASH_REMATCH[1]}"
pytest --cov-report=term-missing --cov=onionbalance test/functional/$version/
pylint onionbalance
flake8 onionbalance
6 changes: 6 additions & 0 deletions test/scripts/run-unit-tests.sh
@@ -0,0 +1,6 @@
#!/bin/bash
set -ex

pytest --cov-report=term-missing --cov=onionbalance --ignore=test/functional/
pylint onionbalance --ignore=test/functional/
flake8 onionbalance
32 changes: 0 additions & 32 deletions tox.ini

This file was deleted.

0 comments on commit ba47277

Please sign in to comment.