Adapt to recent dependencies
This covers the following updates to fix CI currently broken. * Fix compatibility with tox 4 * Update hacking to 6.1.0 * Clean up python 2 support and bump minimum supported version to 3.8 * Remove six because python 2 support is removed * Update job template to use the recent tested python versions * Replace items by prefixItems to fix schema error Change-Id: I3b9c5b20aca55332c721d34fd4c41c5b886f60c5
This commit is contained in:
parent
113ba244f8
commit
636d8c7236
|
@ -1,9 +1,7 @@
|
||||||
- project:
|
- project:
|
||||||
templates:
|
templates:
|
||||||
- docs-on-readthedocs
|
- docs-on-readthedocs
|
||||||
- openstack-python-jobs
|
- openstack-python3-jobs
|
||||||
- openstack-python36-jobs
|
|
||||||
- openstack-python37-jobs
|
|
||||||
vars:
|
vars:
|
||||||
rtd_webhook_id: '47124'
|
rtd_webhook_id: '47124'
|
||||||
check:
|
check:
|
||||||
|
|
|
@ -16,7 +16,6 @@ import copy
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import jsonschema
|
import jsonschema
|
||||||
import six
|
|
||||||
|
|
||||||
from os_faults.api import base_driver
|
from os_faults.api import base_driver
|
||||||
from os_faults.api import error
|
from os_faults.api import error
|
||||||
|
@ -27,8 +26,7 @@ from os_faults import registry
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
class CloudManagement(base_driver.BaseDriver, metaclass=abc.ABCMeta):
|
||||||
class CloudManagement(base_driver.BaseDriver):
|
|
||||||
SERVICES = {}
|
SERVICES = {}
|
||||||
CONTAINERS = {}
|
CONTAINERS = {}
|
||||||
SUPPORTED_NETWORKS = []
|
SUPPORTED_NETWORKS = []
|
||||||
|
|
|
@ -13,14 +13,11 @@
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
|
|
||||||
import six
|
|
||||||
|
|
||||||
from os_faults.api import base_driver
|
from os_faults.api import base_driver
|
||||||
from os_faults.api.utils import public
|
from os_faults.api.utils import public
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
class Container(base_driver.BaseDriver, metaclass=abc.ABCMeta):
|
||||||
class Container(base_driver.BaseDriver):
|
|
||||||
|
|
||||||
def __init__(self, container_name, config, node_cls, cloud_management,
|
def __init__(self, container_name, config, node_cls, cloud_management,
|
||||||
hosts=None):
|
hosts=None):
|
||||||
|
|
|
@ -49,6 +49,7 @@ def list_actions(klazz):
|
||||||
klazz,
|
klazz,
|
||||||
predicate=utils.is_public))
|
predicate=utils.is_public))
|
||||||
|
|
||||||
|
|
||||||
RANDOMNESS = {'one', 'random', 'some', 'single'}
|
RANDOMNESS = {'one', 'random', 'some', 'single'}
|
||||||
ANYTHING = {'all'}
|
ANYTHING = {'all'}
|
||||||
NODE_ALIASES_PATTERN = '|'.join(RANDOMNESS | ANYTHING)
|
NODE_ALIASES_PATTERN = '|'.join(RANDOMNESS | ANYTHING)
|
||||||
|
|
|
@ -110,7 +110,7 @@ class NodeCollection(utils.ReprMixin):
|
||||||
msg = 'Cannot pick {} from {} node(s)'.format(
|
msg = 'Cannot pick {} from {} node(s)'.format(
|
||||||
count, len(self._hosts))
|
count, len(self._hosts))
|
||||||
raise error.NodeCollectionError(msg)
|
raise error.NodeCollectionError(msg)
|
||||||
return self._make_instance(random.sample(self._hosts, count))
|
return self._make_instance(random.sample(self.hosts, count))
|
||||||
|
|
||||||
def filter(self, criteria_fn):
|
def filter(self, criteria_fn):
|
||||||
hosts = list(filter(criteria_fn, self._hosts))
|
hosts = list(filter(criteria_fn, self._hosts))
|
||||||
|
|
|
@ -13,13 +13,10 @@
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
|
|
||||||
import six
|
|
||||||
|
|
||||||
from os_faults.api import base_driver
|
from os_faults.api import base_driver
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
class NodeDiscover(base_driver.BaseDriver, metaclass=abc.ABCMeta):
|
||||||
class NodeDiscover(base_driver.BaseDriver):
|
|
||||||
"""Node discover base driver."""
|
"""Node discover base driver."""
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
|
|
|
@ -13,15 +13,12 @@
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
|
|
||||||
import six
|
|
||||||
|
|
||||||
from os_faults.api import base_driver
|
from os_faults.api import base_driver
|
||||||
from os_faults.api import error
|
from os_faults.api import error
|
||||||
from os_faults import utils
|
from os_faults import utils
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
class PowerDriver(base_driver.BaseDriver, metaclass=abc.ABCMeta):
|
||||||
class PowerDriver(base_driver.BaseDriver):
|
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def supports(self, host):
|
def supports(self, host):
|
||||||
|
|
|
@ -13,14 +13,11 @@
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
|
|
||||||
import six
|
|
||||||
|
|
||||||
from os_faults.api import base_driver
|
from os_faults.api import base_driver
|
||||||
from os_faults.api.utils import public
|
from os_faults.api.utils import public
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
class Service(base_driver.BaseDriver, metaclass=abc.ABCMeta):
|
||||||
class Service(base_driver.BaseDriver):
|
|
||||||
|
|
||||||
def __init__(self, service_name, config, node_cls, cloud_management,
|
def __init__(self, service_name, config, node_cls, cloud_management,
|
||||||
hosts=None):
|
hosts=None):
|
||||||
|
|
|
@ -31,6 +31,7 @@ def describe_actions(klazz):
|
||||||
return ['%s - %s' % (m[0], m[1].__doc__.split('\n')[0])
|
return ['%s - %s' % (m[0], m[1].__doc__.split('\n')[0])
|
||||||
for m in sorted(methods)]
|
for m in sorted(methods)]
|
||||||
|
|
||||||
|
|
||||||
SERVICE_ACTIONS = describe_actions(service_pkg.Service)
|
SERVICE_ACTIONS = describe_actions(service_pkg.Service)
|
||||||
NODE_ACTIONS = describe_actions(node_collection_pkg.NodeCollection)
|
NODE_ACTIONS = describe_actions(node_collection_pkg.NodeCollection)
|
||||||
|
|
||||||
|
@ -163,5 +164,6 @@ def main():
|
||||||
command = ' '.join(command)
|
command = ' '.join(command)
|
||||||
os_faults.human_api(destructor, command)
|
os_faults.human_api(destructor, command)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
PORT_SCHEMA = {
|
PORT_SCHEMA = {
|
||||||
'type': 'array',
|
'type': 'array',
|
||||||
'items': [
|
'prefixItems': [
|
||||||
{'enum': ['tcp', 'udp']},
|
{'enum': ['tcp', 'udp']},
|
||||||
{'type': 'integer', 'minimum': 0, 'maximum': 65535},
|
{'type': 'integer', 'minimum': 0, 'maximum': 65535},
|
||||||
{'enum': ['egress', 'ingress']}
|
{'enum': ['egress', 'ingress']}
|
||||||
|
|
|
@ -11,8 +11,9 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from os_faults.ansible import executor
|
from os_faults.ansible import executor
|
||||||
from os_faults.api import node_collection
|
from os_faults.api import node_collection
|
||||||
|
@ -197,7 +198,7 @@ class AnsibleRunnerTestCase(test.TestCase):
|
||||||
|
|
||||||
err = self.assertRaises(executor.AnsibleExecutionException,
|
err = self.assertRaises(executor.AnsibleExecutionException,
|
||||||
ex.execute, my_hosts, my_tasks, my_statuses)
|
ex.execute, my_hosts, my_tasks, my_statuses)
|
||||||
self.assertEqual(type(err), executor.AnsibleExecutionUnreachable)
|
self.assertIsInstance(err, executor.AnsibleExecutionUnreachable)
|
||||||
|
|
||||||
@mock.patch('os_faults.ansible.executor.find_ansible')
|
@mock.patch('os_faults.ansible.executor.find_ansible')
|
||||||
@mock.patch('os_faults.ansible.executor.AnsibleRunner.run_playbook')
|
@mock.patch('os_faults.ansible.executor.AnsibleRunner.run_playbook')
|
||||||
|
@ -218,7 +219,7 @@ class AnsibleRunnerTestCase(test.TestCase):
|
||||||
|
|
||||||
err = self.assertRaises(executor.AnsibleExecutionException,
|
err = self.assertRaises(executor.AnsibleExecutionException,
|
||||||
ex.execute, my_hosts, my_tasks, my_statuses)
|
ex.execute, my_hosts, my_tasks, my_statuses)
|
||||||
self.assertEqual(type(err), executor.AnsibleExecutionException)
|
self.assertIsInstance(err, executor.AnsibleExecutionException)
|
||||||
|
|
||||||
@mock.patch('os_faults.ansible.executor.find_ansible')
|
@mock.patch('os_faults.ansible.executor.find_ansible')
|
||||||
@mock.patch('copy.deepcopy')
|
@mock.patch('copy.deepcopy')
|
||||||
|
|
|
@ -10,8 +10,9 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from os_faults.api import error
|
from os_faults.api import error
|
||||||
from os_faults.api import human
|
from os_faults.api import human
|
||||||
|
|
|
@ -12,9 +12,7 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
import six
|
|
||||||
|
|
||||||
from os_faults.api import cloud_management
|
from os_faults.api import cloud_management
|
||||||
from os_faults.api import error
|
from os_faults.api import error
|
||||||
|
@ -81,7 +79,7 @@ class NodeCollectionTestCase(test.TestCase):
|
||||||
collection._check_nodes_types, self.node_collection)
|
collection._check_nodes_types, self.node_collection)
|
||||||
|
|
||||||
def test_repr(self):
|
def test_repr(self):
|
||||||
self.assertIsInstance(repr(self.node_collection), six.string_types)
|
self.assertIsInstance(repr(self.node_collection), str)
|
||||||
|
|
||||||
def test_len(self):
|
def test_len(self):
|
||||||
self.assertEqual(4, len(self.node_collection))
|
self.assertEqual(4, len(self.node_collection))
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from os_faults.api import error
|
from os_faults.api import error
|
||||||
from os_faults.api import node_collection
|
from os_faults.api import node_collection
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import mock
|
from unittest import mock
|
||||||
|
|
||||||
from os_faults.cmd import cmd
|
from os_faults.cmd import cmd
|
||||||
from os_faults.tests.unit import test
|
from os_faults.tests.unit import test
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
from click import testing
|
from click import testing
|
||||||
import mock
|
|
||||||
|
|
||||||
from os_faults.api import cloud_management
|
from os_faults.api import cloud_management
|
||||||
from os_faults.api import node_collection
|
from os_faults.api import node_collection
|
||||||
|
|
|
@ -11,9 +11,10 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from os_faults.api import node_collection
|
from os_faults.api import node_collection
|
||||||
from os_faults.drivers.cloud import devstack
|
from os_faults.drivers.cloud import devstack
|
||||||
|
|
|
@ -11,8 +11,9 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from os_faults.ansible import executor
|
from os_faults.ansible import executor
|
||||||
from os_faults.api import node_collection
|
from os_faults.api import node_collection
|
||||||
|
|
|
@ -11,8 +11,9 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from os_faults.api import error
|
from os_faults.api import error
|
||||||
from os_faults.drivers.cloud import universal
|
from os_faults.drivers.cloud import universal
|
||||||
|
|
|
@ -11,8 +11,9 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
from pyghmi import exceptions as pyghmi_exc
|
from pyghmi import exceptions as pyghmi_exc
|
||||||
|
|
||||||
import os_faults
|
import os_faults
|
||||||
|
|
|
@ -11,8 +11,9 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import ddt
|
import ddt
|
||||||
import mock
|
|
||||||
|
|
||||||
from os_faults.api import node_collection
|
from os_faults.api import node_collection
|
||||||
from os_faults.drivers.power import libvirt
|
from os_faults.drivers.power import libvirt
|
||||||
|
|
|
@ -12,8 +12,7 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from os_faults.api.node_collection import Host
|
from os_faults.api.node_collection import Host
|
||||||
from os_faults.api.node_collection import NodeCollection
|
from os_faults.api.node_collection import NodeCollection
|
||||||
|
|
|
@ -10,8 +10,9 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
import jsonschema
|
import jsonschema
|
||||||
import mock
|
|
||||||
|
|
||||||
import os_faults
|
import os_faults
|
||||||
from os_faults.ansible import executor
|
from os_faults.ansible import executor
|
||||||
|
|
|
@ -12,8 +12,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from os_faults.api import base_driver
|
from os_faults.api import base_driver
|
||||||
from os_faults.api import error
|
from os_faults.api import error
|
||||||
|
|
|
@ -11,8 +11,7 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import threading
|
import threading
|
||||||
|
from unittest import mock
|
||||||
import mock
|
|
||||||
|
|
||||||
from os_faults.tests.unit import test
|
from os_faults.tests.unit import test
|
||||||
from os_faults import utils
|
from os_faults import utils
|
||||||
|
@ -44,7 +43,7 @@ class UtilsTestCase(test.TestCase):
|
||||||
tw.start_thread(target)
|
tw.start_thread(target)
|
||||||
tw.join_threads()
|
tw.join_threads()
|
||||||
|
|
||||||
self.assertEqual(type(tw.errors[0]), MyException)
|
self.assertIsInstance(tw.errors[0], MyException)
|
||||||
|
|
||||||
def test_join_threads(self):
|
def test_join_threads(self):
|
||||||
thread_1 = mock.Mock()
|
thread_1 = mock.Mock()
|
||||||
|
|
|
@ -8,15 +8,9 @@ appdirs>=1.3.0 # MIT License
|
||||||
click>=6.7 # BSD
|
click>=6.7 # BSD
|
||||||
iso8601>=0.1.11 # MIT
|
iso8601>=0.1.11 # MIT
|
||||||
jsonschema>=2.6.0 # MIT
|
jsonschema>=2.6.0 # MIT
|
||||||
oslo.concurrency>=3.0.0,<4.0.0;python_version=='2.7' # Apache-2.0
|
oslo.concurrency>=3.0.0 # Apache-2.0
|
||||||
oslo.concurrency>=3.0.0;python_version>='3.6' # Apache-2.0
|
oslo.i18n>=2.1.0 # Apache-2.0
|
||||||
oslo.i18n>=2.1.0,<4.0.0;python_version=='2.7' # Apache-2.0
|
oslo.serialization>=1.10.0 # Apache-2.0
|
||||||
oslo.i18n>=2.1.0;python_version>='3.6' # Apache-2.0
|
oslo.utils>=3.20.0 # Apache-2.0
|
||||||
oslo.serialization>=1.10.0,<3.0.0;python_version=='2.7' # Apache-2.0
|
pyghmi>=1.0.9
|
||||||
oslo.serialization>=1.10.0;python_version>='3.6' # Apache-2.0
|
|
||||||
oslo.utils>=3.20.0,<4.0.0;python_version=='2.7' # Apache-2.0
|
|
||||||
oslo.utils>=3.20.0;python_version>='3.6' # Apache-2.0
|
|
||||||
pyghmi>=1.0.9,<1.5.0;python_version=='2.7' # Apache-2.0
|
|
||||||
pyghmi>=1.0.9;python_version>='3.6'
|
|
||||||
PyYAML>=3.10.0 # MIT
|
PyYAML>=3.10.0 # MIT
|
||||||
six>=1.9.0 # MIT
|
|
||||||
|
|
15
setup.cfg
15
setup.cfg
|
@ -1,17 +1,18 @@
|
||||||
[metadata]
|
[metadata]
|
||||||
name = os_faults
|
name = os_faults
|
||||||
summary = OpenStack fault-injection library
|
summary = OpenStack fault-injection library
|
||||||
description-file =
|
description_file =
|
||||||
README.rst
|
README.rst
|
||||||
description-content-type = text/x-rst; charset=UTF-8
|
description_content_type = text/x-rst; charset=UTF-8
|
||||||
author = OpenStack
|
author = OpenStack
|
||||||
author-email = openstack-discuss@lists.openstack.org
|
author_email = openstack-discuss@lists.openstack.org
|
||||||
url = http://os-faults.readthedocs.io/
|
url = http://os-faults.readthedocs.io/
|
||||||
download_url = https://pypi.org/project/os-faults/
|
download_url = https://pypi.org/project/os-faults/
|
||||||
project_urls =
|
project_urls =
|
||||||
Bug Tracker = https://bugs.launchpad.net/os-faults
|
Bug Tracker = https://bugs.launchpad.net/os-faults
|
||||||
Documentation = http://os-faults.readthedocs.io/
|
Documentation = http://os-faults.readthedocs.io/
|
||||||
Source Code = https://opendev.org/performa/os-faults/
|
Source Code = https://opendev.org/performa/os-faults/
|
||||||
|
python_requires = >=3.8
|
||||||
classifier =
|
classifier =
|
||||||
Environment :: OpenStack
|
Environment :: OpenStack
|
||||||
Intended Audience :: Information Technology
|
Intended Audience :: Information Technology
|
||||||
|
@ -19,11 +20,11 @@ classifier =
|
||||||
License :: OSI Approved :: Apache Software License
|
License :: OSI Approved :: Apache Software License
|
||||||
Operating System :: POSIX :: Linux
|
Operating System :: POSIX :: Linux
|
||||||
Programming Language :: Python
|
Programming Language :: Python
|
||||||
Programming Language :: Python :: 2
|
|
||||||
Programming Language :: Python :: 2.7
|
|
||||||
Programming Language :: Python :: 3
|
Programming Language :: Python :: 3
|
||||||
Programming Language :: Python :: 3.6
|
Programming Language :: Python :: 3.8
|
||||||
Programming Language :: Python :: 3.7
|
Programming Language :: Python :: 3.9
|
||||||
|
Programming Language :: Python :: 3.10
|
||||||
|
Programming Language :: Python :: 3.11
|
||||||
|
|
||||||
[files]
|
[files]
|
||||||
packages =
|
packages =
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
# The order of packages is significant, because pip processes them in the order
|
hacking>=6.1.0,<6.2.0 # Apache-2.0
|
||||||
# of appearance. Changing the order has an impact on the overall integration
|
|
||||||
# process, which may cause wedges in the gate later.
|
|
||||||
|
|
||||||
hacking>=1.1.0,<1.2.0 # Apache-2.0
|
|
||||||
pytest # MIT
|
pytest # MIT
|
||||||
pytest-cov # MIT
|
pytest-cov # MIT
|
||||||
pytest-html # Mozilla Public License 2.0 (MPL 2.0)
|
pytest-html # Mozilla Public License 2.0 (MPL 2.0)
|
||||||
|
|
28
tox.ini
28
tox.ini
|
@ -1,35 +1,38 @@
|
||||||
[tox]
|
[tox]
|
||||||
minversion = 2.6
|
minversion = 3.18.0
|
||||||
envlist = pep8,py27,py36,cover
|
envlist = pep8,py3,cover
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
basepython = python3
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
deps =
|
deps =
|
||||||
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
install_command = pip install -U {opts} {packages}
|
|
||||||
setenv =
|
setenv =
|
||||||
VIRTUAL_ENV={envdir}
|
VIRTUAL_ENV={envdir}
|
||||||
whitelist_externals =
|
allowlist_externals =
|
||||||
find
|
find
|
||||||
rm
|
rm
|
||||||
commands =
|
commands =
|
||||||
find . -type f -name "*.pyc" -delete
|
find . -type f -name "*.pyc" -delete
|
||||||
py.test -vvvv --html={envlogdir}/pytest_results.html --self-contained-html --durations=10 "os_faults/tests/unit" {posargs}
|
py.test -vvvv --html={envlogdir}/pytest_results.html --self-contained-html --durations=10 "os_faults/tests/unit" {posargs}
|
||||||
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
passenv =
|
||||||
|
http_proxy
|
||||||
|
HTTP_PROXY
|
||||||
|
https_proxy
|
||||||
|
HTTPS_PROXY
|
||||||
|
no_proxy
|
||||||
|
NO_PROXY
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
basepython = python3
|
|
||||||
commands = flake8 . doc/ext
|
commands = flake8 . doc/ext
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
basepython = python3
|
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
basepython = python3
|
|
||||||
commands =
|
commands =
|
||||||
py.test --cov-config .coveragerc --cov-report html --cov=os_faults "os_faults/tests/unit"
|
py.test --cov-config .coveragerc --cov-report html --cov=os_faults "os_faults/tests/unit"
|
||||||
coverage html -d {envlogdir}
|
coverage html -d {envlogdir}
|
||||||
|
@ -40,7 +43,6 @@ commands =
|
||||||
# 1) create SSH key in os-faults folder: ssh-keygen -t rsa -f os_faults_key -N ''
|
# 1) create SSH key in os-faults folder: ssh-keygen -t rsa -f os_faults_key -N ''
|
||||||
# 2) copy public key into authorized_keys of user stack: cat os_faults_key.pub >> ~/.ssh/authorized_keys
|
# 2) copy public key into authorized_keys of user stack: cat os_faults_key.pub >> ~/.ssh/authorized_keys
|
||||||
# 3) run tests normally: tox -e devstack
|
# 3) run tests normally: tox -e devstack
|
||||||
basepython = python3
|
|
||||||
setenv = {[testenv]setenv}
|
setenv = {[testenv]setenv}
|
||||||
OS_TEST_PATH=./os_faults/tests/devstack
|
OS_TEST_PATH=./os_faults/tests/devstack
|
||||||
OS_DEBUG=True
|
OS_DEBUG=True
|
||||||
|
@ -50,13 +52,11 @@ commands =
|
||||||
py.test -vvvv --html={envlogdir}/pytest_results.html --self-contained-html --durations=10 "os_faults/tests/devstack" {posargs}
|
py.test -vvvv --html={envlogdir}/pytest_results.html --self-contained-html --durations=10 "os_faults/tests/devstack" {posargs}
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
basepython = python3
|
|
||||||
commands =
|
commands =
|
||||||
rm -rf doc/build
|
rm -rf doc/build
|
||||||
python setup.py build_sphinx --warning-is-error
|
python setup.py build_sphinx --warning-is-error
|
||||||
|
|
||||||
[testenv:releasenotes]
|
[testenv:releasenotes]
|
||||||
basepython = python3
|
|
||||||
commands =
|
commands =
|
||||||
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
||||||
|
|
||||||
|
@ -64,6 +64,8 @@ commands =
|
||||||
# E123 skipped because it is ignored by default in the default pep8.
|
# E123 skipped because it is ignored by default in the default pep8.
|
||||||
# E125 skipped until https://github.com/jcrocholl/pep8/issues/126 is resolved.
|
# E125 skipped until https://github.com/jcrocholl/pep8/issues/126 is resolved.
|
||||||
# E731 skipped as assign a lambda expression
|
# E731 skipped as assign a lambda expression
|
||||||
ignore = E123,E125,E731
|
# W503 line break before binary operator
|
||||||
|
# W504 line break after binary operator
|
||||||
|
ignore = E123,E125,E731,W503,W504
|
||||||
show-source = True
|
show-source = True
|
||||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
||||||
|
|
Loading…
Reference in New Issue