Skip to content
Snippets Groups Projects
Commit dc15e2f5 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Merge branch 'parallel-testing' into 'develop'

Parallel testing

See merge request !16
parents 8b760440 3153ca78
Branches
Tags
1 merge request!16Parallel testing
......@@ -14,11 +14,9 @@ import inventory_provider
from inventory_provider.tasks import worker
from inventory_provider import config
TEST_DATA_DIRNAME = os.path.realpath(os.path.join(
inventory_provider.__path__[0],
"..",
"test",
"data"))
TEST_DATA_DIRNAME = os.path.join(
os.path.dirname(__file__),
"data")
_bootstrap_semaphore = threading.Semaphore()
......@@ -43,7 +41,7 @@ def data_config_filename():
"api": "ims_api",
"username": "ims_username",
"password": "ims_password"
},
},
"managed-routers": "bogus url",
"unmanaged-interfaces": [
{
......@@ -224,10 +222,10 @@ NETIFACES_TEST_DATA_STRING = """{
def mocked_netifaces(mocker):
s = NETIFACES_TEST_DATA_STRING
for k, v in {
'AF_INET': netifaces.AF_INET,
'AF_INET6': netifaces.AF_INET6,
'AF_LINK': netifaces.AF_LINK
}.items():
'AF_INET': netifaces.AF_INET,
'AF_INET6': netifaces.AF_INET6,
'AF_LINK': netifaces.AF_LINK
}.items():
s = s.replace('{%s}' % k, str(v))
data = ast.literal_eval(s)
mocker.patch('netifaces.interfaces', lambda: data.keys())
......
......@@ -2,13 +2,10 @@ import os
import responses
import inventory_provider
from inventory_provider import juniper
TEST_DATA_FILENAME = os.path.realpath(os.path.join(
inventory_provider.__path__[0],
'..',
'test',
os.path.dirname(__file__),
'data',
'netdash-alldevices.txt'))
......
......@@ -5,20 +5,21 @@ envlist = py36
exclude = venv,.tox,build
max-line-length = 120
[coverage:run]
concurrency = multiprocessing,thread
[testenv]
passenv = TEST_OPSDB_HOSTNAME,TEST_OPSDB_DBNAME,TEST_OPSDB_USERNAME,TEST_OPSDB_PASSWORD
deps =
coverage
pytest-xdist
pytest-cov
flake8
-r requirements.txt
#install_command = pip install --pre --extra-index-url http://pip.geant.net/ --trusted-host pip.geant.net {opts} {packages}
commands =
coverage erase
coverage run --source inventory_provider -m pytest {posargs}
coverage xml
coverage html
coverage report --fail-under 80
pytest -n auto --cov inventory_provider --cov-fail-under=80 --cov-report html --cov-report xml --cov-report term -p no:checkdocs
flake8
sphinx-build -M html docs/source docs/build
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment