mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-23 22:53:43 +00:00
Tox!
Signed-off-by: Adam Hill <adam@diginc.us>
This commit is contained in:
parent
fff31558a0
commit
88e4b6390c
6 changed files with 35 additions and 2 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -4,6 +4,10 @@
|
||||||
__pycache__
|
__pycache__
|
||||||
.cache
|
.cache
|
||||||
.pytest_cache
|
.pytest_cache
|
||||||
|
.tox
|
||||||
|
.eggs
|
||||||
|
*.egg-info
|
||||||
|
|
||||||
|
|
||||||
# Created by https://www.gitignore.io/api/jetbrains+iml
|
# Created by https://www.gitignore.io/api/jetbrains+iml
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,5 @@ install:
|
||||||
|
|
||||||
script:
|
script:
|
||||||
# run tasks marked as 'build_stage' first (ensure docker images are built)
|
# run tasks marked as 'build_stage' first (ensure docker images are built)
|
||||||
- py.test -vv -n auto -m "build_stage"
|
|
||||||
# run the remaining tasks in the test suite
|
# run the remaining tasks in the test suite
|
||||||
- py.test -vv -n auto -m "not build_stage"
|
- tox
|
||||||
|
|
|
@ -3,3 +3,4 @@ pytest
|
||||||
pytest-xdist
|
pytest-xdist
|
||||||
pytest-cov
|
pytest-cov
|
||||||
testinfra
|
testinfra
|
||||||
|
tox
|
||||||
|
|
6
setup.py
Normal file
6
setup.py
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
setup(
|
||||||
|
setup_requires=['pytest-runner'],
|
||||||
|
tests_require=['pytest'],
|
||||||
|
)
|
13
test/README.md
Normal file
13
test/README.md
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# How do I test?
|
||||||
|
|
||||||
|
Make sure you have Docker and Python w/pip package manager.
|
||||||
|
|
||||||
|
From command line all you need to do is:
|
||||||
|
|
||||||
|
- `pip install tox`
|
||||||
|
- `tox`
|
||||||
|
|
||||||
|
# How do I debug python?
|
||||||
|
|
||||||
|
Highly recommended: Setup PyCharm on a **Docker enabled** machine. Having a python debugger like PyCharm changes your life if you've never used it :)
|
||||||
|
|
10
tox.ini
Normal file
10
tox.ini
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[tox]
|
||||||
|
envlist = py27
|
||||||
|
|
||||||
|
[testenv]
|
||||||
|
whitelist_externals = docker
|
||||||
|
deps = -rrequirements.txt
|
||||||
|
commands = docker build -f test/debian.Dockerfile -t pytest_pihole:debian .
|
||||||
|
docker build -f test/centos.Dockerfile -t pytest_pihole:centos .
|
||||||
|
docker build -f test/fedora.Dockerfile -t pytest_pihole:fedora .
|
||||||
|
pytest {posargs:-vv -n auto} -m "not build_stage" ./test/
|
Loading…
Reference in a new issue