Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inventory-provider
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
dashboardv3
inventory-provider
Commits
dc15e2f5
Commit
dc15e2f5
authored
1 year ago
by
Bjarke Madsen
Browse files
Options
Downloads
Plain Diff
Merge branch 'parallel-testing' into 'develop'
Parallel testing See merge request
!16
parents
8b760440
3153ca78
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!16
Parallel testing
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
test/__init__.py
+0
-0
0 additions, 0 deletions
test/__init__.py
test/conftest.py
+8
-10
8 additions, 10 deletions
test/conftest.py
test/test_junos_devices_query.py
+1
-4
1 addition, 4 deletions
test/test_junos_devices_query.py
tox.ini
+6
-5
6 additions, 5 deletions
tox.ini
with
15 additions
and
19 deletions
test/__init__.py
0 → 100644
+
0
−
0
View file @
dc15e2f5
This diff is collapsed.
Click to expand it.
test/conftest.py
+
8
−
10
View file @
dc15e2f5
...
...
@@ -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
())
...
...
This diff is collapsed.
Click to expand it.
test/test_junos_devices_query.py
+
1
−
4
View file @
dc15e2f5
...
...
@@ -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
'
))
...
...
This diff is collapsed.
Click to expand it.
tox.ini
+
6
−
5
View file @
dc15e2f5
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment