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 * Build documentation by sphinx command * Remove "Change Log" section from documentation * Split requirements for documentation build * Ensure tox is installed in functional tests * Fix devstack job Change-Id: I3b9c5b20aca55332c721d34fd4c41c5b886f60c5
This commit is contained in:
parent
113ba244f8
commit
dff77df8fc
@ -1,9 +1,7 @@
|
||||
- project:
|
||||
templates:
|
||||
- docs-on-readthedocs
|
||||
- openstack-python-jobs
|
||||
- openstack-python36-jobs
|
||||
- openstack-python37-jobs
|
||||
- openstack-python3-jobs
|
||||
vars:
|
||||
rtd_webhook_id: '47124'
|
||||
check:
|
||||
|
5
doc/requirements.txt
Normal file
5
doc/requirements.txt
Normal file
@ -0,0 +1,5 @@
|
||||
openstackdocstheme
|
||||
sphinx!=1.6.6,!=1.6.7 # BSD
|
||||
sphinxcontrib-programoutput # BSD
|
||||
sphinx_rtd_theme # MIT
|
||||
reno>=1.8.0 # Apache-2.0
|
@ -1 +0,0 @@
|
||||
.. include:: ../../ChangeLog
|
@ -22,14 +22,6 @@ Contents
|
||||
api
|
||||
contributing
|
||||
|
||||
Release Notes
|
||||
=============
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
history
|
||||
|
||||
Indices and Tables
|
||||
==================
|
||||
|
||||
|
@ -16,7 +16,6 @@ import copy
|
||||
import logging
|
||||
|
||||
import jsonschema
|
||||
import six
|
||||
|
||||
from os_faults.api import base_driver
|
||||
from os_faults.api import error
|
||||
@ -27,8 +26,7 @@ from os_faults import registry
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class CloudManagement(base_driver.BaseDriver):
|
||||
class CloudManagement(base_driver.BaseDriver, metaclass=abc.ABCMeta):
|
||||
SERVICES = {}
|
||||
CONTAINERS = {}
|
||||
SUPPORTED_NETWORKS = []
|
||||
|
@ -13,14 +13,11 @@
|
||||
|
||||
import abc
|
||||
|
||||
import six
|
||||
|
||||
from os_faults.api import base_driver
|
||||
from os_faults.api.utils import public
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class Container(base_driver.BaseDriver):
|
||||
class Container(base_driver.BaseDriver, metaclass=abc.ABCMeta):
|
||||
|
||||
def __init__(self, container_name, config, node_cls, cloud_management,
|
||||
hosts=None):
|
||||
|
@ -49,6 +49,7 @@ def list_actions(klazz):
|
||||
klazz,
|
||||
predicate=utils.is_public))
|
||||
|
||||
|
||||
RANDOMNESS = {'one', 'random', 'some', 'single'}
|
||||
ANYTHING = {'all'}
|
||||
NODE_ALIASES_PATTERN = '|'.join(RANDOMNESS | ANYTHING)
|
||||
|
@ -110,7 +110,7 @@ class NodeCollection(utils.ReprMixin):
|
||||
msg = 'Cannot pick {} from {} node(s)'.format(
|
||||
count, len(self._hosts))
|
||||
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):
|
||||
hosts = list(filter(criteria_fn, self._hosts))
|
||||
|
@ -13,13 +13,10 @@
|
||||
|
||||
import abc
|
||||
|
||||
import six
|
||||
|
||||
from os_faults.api import base_driver
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class NodeDiscover(base_driver.BaseDriver):
|
||||
class NodeDiscover(base_driver.BaseDriver, metaclass=abc.ABCMeta):
|
||||
"""Node discover base driver."""
|
||||
|
||||
@abc.abstractmethod
|
||||
|
@ -13,15 +13,12 @@
|
||||
|
||||
import abc
|
||||
|
||||
import six
|
||||
|
||||
from os_faults.api import base_driver
|
||||
from os_faults.api import error
|
||||
from os_faults import utils
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class PowerDriver(base_driver.BaseDriver):
|
||||
class PowerDriver(base_driver.BaseDriver, metaclass=abc.ABCMeta):
|
||||
|
||||
@abc.abstractmethod
|
||||
def supports(self, host):
|
||||
|
@ -13,14 +13,11 @@
|
||||
|
||||
import abc
|
||||
|
||||
import six
|
||||
|
||||
from os_faults.api import base_driver
|
||||
from os_faults.api.utils import public
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class Service(base_driver.BaseDriver):
|
||||
class Service(base_driver.BaseDriver, metaclass=abc.ABCMeta):
|
||||
|
||||
def __init__(self, service_name, config, node_cls, cloud_management,
|
||||
hosts=None):
|
||||
|
@ -31,6 +31,7 @@ def describe_actions(klazz):
|
||||
return ['%s - %s' % (m[0], m[1].__doc__.split('\n')[0])
|
||||
for m in sorted(methods)]
|
||||
|
||||
|
||||
SERVICE_ACTIONS = describe_actions(service_pkg.Service)
|
||||
NODE_ACTIONS = describe_actions(node_collection_pkg.NodeCollection)
|
||||
|
||||
@ -163,5 +164,6 @@ def main():
|
||||
command = ' '.join(command)
|
||||
os_faults.human_api(destructor, command)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
PORT_SCHEMA = {
|
||||
'type': 'array',
|
||||
'items': [
|
||||
'prefixItems': [
|
||||
{'enum': ['tcp', 'udp']},
|
||||
{'type': 'integer', 'minimum': 0, 'maximum': 65535},
|
||||
{'enum': ['egress', 'ingress']}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
- hosts: all
|
||||
vars:
|
||||
- test_results_path: "/opt/stack/os-faults/.tox/{{tox_envlist}}/log/pytest_results.html"
|
||||
- test_results_path: "{{ zuul.project.src_dir }}/.tox/{{tox_envlist}}/log/pytest_results.html"
|
||||
tasks:
|
||||
- name: Check whether test results file exists
|
||||
stat:
|
||||
@ -10,7 +10,7 @@
|
||||
register: test_results
|
||||
|
||||
- name: Copy job results
|
||||
become: yes
|
||||
become: true
|
||||
synchronize:
|
||||
src: "{{ test_results_path }}"
|
||||
dest: "{{ zuul.executor.log_root }}"
|
||||
|
@ -15,7 +15,7 @@
|
||||
- name: Copy Zuul repos into devstack working directory
|
||||
command: rsync -a {{ item.path }} /opt/stack
|
||||
with_items: '{{ found_repos.files }}'
|
||||
become: yes
|
||||
become: true
|
||||
|
||||
- name: Set ownership of repos
|
||||
file:
|
||||
@ -24,10 +24,11 @@
|
||||
recurse: true
|
||||
owner: stack
|
||||
group: stack
|
||||
become: yes
|
||||
become: true
|
||||
|
||||
|
||||
- hosts: all
|
||||
roles:
|
||||
- bindep
|
||||
- ensure-tox
|
||||
- orchestrate-devstack
|
||||
|
@ -1,13 +1,17 @@
|
||||
---
|
||||
|
||||
- hosts: all
|
||||
vars:
|
||||
- stack_home: "/opt/stack"
|
||||
- os_faults_home: "/opt/stack/os-faults"
|
||||
tasks:
|
||||
- name: Run tests
|
||||
command: "tox -e {{tox_envlist}}"
|
||||
args:
|
||||
chdir: "{{ os_faults_home }}"
|
||||
become: yes
|
||||
become_user: stack
|
||||
- name: Change the owner of os-faults ssh key
|
||||
file:
|
||||
path: /opt/stack/.ssh/os-faults-key
|
||||
owner: zuul
|
||||
group: zuul
|
||||
become: true
|
||||
|
||||
|
||||
- hosts: all
|
||||
roles:
|
||||
- tox
|
||||
vars:
|
||||
- tox_envlist: "devstack"
|
||||
|
@ -11,8 +11,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
|
||||
from os_faults.ansible import executor
|
||||
from os_faults.api import node_collection
|
||||
@ -197,7 +198,7 @@ class AnsibleRunnerTestCase(test.TestCase):
|
||||
|
||||
err = self.assertRaises(executor.AnsibleExecutionException,
|
||||
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.AnsibleRunner.run_playbook')
|
||||
@ -218,7 +219,7 @@ class AnsibleRunnerTestCase(test.TestCase):
|
||||
|
||||
err = self.assertRaises(executor.AnsibleExecutionException,
|
||||
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('copy.deepcopy')
|
||||
|
@ -10,8 +10,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
|
||||
from os_faults.api import error
|
||||
from os_faults.api import human
|
||||
|
@ -12,9 +12,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
import copy
|
||||
|
||||
import mock
|
||||
import six
|
||||
from unittest import mock
|
||||
|
||||
from os_faults.api import cloud_management
|
||||
from os_faults.api import error
|
||||
@ -81,7 +79,7 @@ class NodeCollectionTestCase(test.TestCase):
|
||||
collection._check_nodes_types, self.node_collection)
|
||||
|
||||
def test_repr(self):
|
||||
self.assertIsInstance(repr(self.node_collection), six.string_types)
|
||||
self.assertIsInstance(repr(self.node_collection), str)
|
||||
|
||||
def test_len(self):
|
||||
self.assertEqual(4, len(self.node_collection))
|
||||
|
@ -11,7 +11,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from os_faults.api import error
|
||||
from os_faults.api import node_collection
|
||||
@ -44,46 +44,50 @@ class PowerManagerTestCase(test.TestCase):
|
||||
def test_poweroff(self):
|
||||
self.pm.poweroff(self.hosts)
|
||||
|
||||
self.dummy_driver1.poweroff.called_once_with(host=self.hosts[0])
|
||||
self.dummy_driver2.poweroff.called_once_with(host=self.hosts[1])
|
||||
self.dummy_driver1.poweroff.assert_called_once_with(host=self.hosts[0])
|
||||
self.dummy_driver2.poweroff.assert_called_once_with(host=self.hosts[1])
|
||||
|
||||
def test_poweron(self):
|
||||
self.pm.poweron(self.hosts)
|
||||
|
||||
self.dummy_driver1.poweron.called_once_with(host=self.hosts[0])
|
||||
self.dummy_driver2.poweron.called_once_with(host=self.hosts[1])
|
||||
self.dummy_driver1.poweron.assert_called_once_with(host=self.hosts[0])
|
||||
self.dummy_driver2.poweron.assert_called_once_with(host=self.hosts[1])
|
||||
|
||||
def test_reset(self):
|
||||
self.pm.reset(self.hosts)
|
||||
|
||||
self.dummy_driver1.reset.called_once_with(host=self.hosts[0])
|
||||
self.dummy_driver2.reset.called_once_with(host=self.hosts[1])
|
||||
self.dummy_driver1.reset.assert_called_once_with(host=self.hosts[0])
|
||||
self.dummy_driver2.reset.assert_called_once_with(host=self.hosts[1])
|
||||
|
||||
def test_shutdown(self):
|
||||
self.pm.shutdown(self.hosts)
|
||||
|
||||
self.dummy_driver1.shutdown.called_once_with(host=self.hosts[0])
|
||||
self.dummy_driver2.shutdown.called_once_with(host=self.hosts[1])
|
||||
self.dummy_driver1.shutdown.assert_called_once_with(host=self.hosts[0])
|
||||
self.dummy_driver2.shutdown.assert_called_once_with(host=self.hosts[1])
|
||||
|
||||
def test_snapshot(self):
|
||||
self.pm.snapshot(self.hosts, 'snap1', suspend=False)
|
||||
|
||||
self.dummy_driver1.snapshot.called_once_with(host=self.hosts[0],
|
||||
snapshot_name='snap1',
|
||||
suspend=False)
|
||||
self.dummy_driver2.snapshot.called_once_with(host=self.hosts[1],
|
||||
snapshot_name='snap1',
|
||||
suspend=False)
|
||||
self.dummy_driver1.snapshot.assert_called_once_with(
|
||||
host=self.hosts[0],
|
||||
snapshot_name='snap1',
|
||||
suspend=False)
|
||||
self.dummy_driver2.snapshot.assert_called_once_with(
|
||||
host=self.hosts[1],
|
||||
snapshot_name='snap1',
|
||||
suspend=False)
|
||||
|
||||
def test_revert(self):
|
||||
self.pm.revert(self.hosts, 'snap1', resume=False)
|
||||
|
||||
self.dummy_driver1.revert.called_once_with(host=self.hosts[0],
|
||||
snapshot_name='snap1',
|
||||
resume=False)
|
||||
self.dummy_driver2.revert.called_once_with(host=self.hosts[1],
|
||||
snapshot_name='snap1',
|
||||
resume=False)
|
||||
self.dummy_driver1.revert.assert_called_once_with(
|
||||
host=self.hosts[0],
|
||||
snapshot_name='snap1',
|
||||
resume=False)
|
||||
self.dummy_driver2.revert.assert_called_once_with(
|
||||
host=self.hosts[1],
|
||||
snapshot_name='snap1',
|
||||
resume=False)
|
||||
|
||||
def test_run_error(self):
|
||||
self.dummy_driver2.reset.side_effect = Exception()
|
||||
|
@ -11,7 +11,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from os_faults.cmd import cmd
|
||||
from os_faults.tests.unit import test
|
||||
|
@ -12,9 +12,9 @@
|
||||
# limitations under the License.
|
||||
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
from click import testing
|
||||
import mock
|
||||
|
||||
from os_faults.api import cloud_management
|
||||
from os_faults.api import node_collection
|
||||
|
@ -11,9 +11,10 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import copy
|
||||
import ddt
|
||||
import mock
|
||||
|
||||
from os_faults.api import node_collection
|
||||
from os_faults.drivers.cloud import devstack
|
||||
|
@ -11,8 +11,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
|
||||
from os_faults.ansible import executor
|
||||
from os_faults.api import node_collection
|
||||
|
@ -11,8 +11,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
|
||||
from os_faults.api import error
|
||||
from os_faults.drivers.cloud import universal
|
||||
|
@ -11,8 +11,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
from pyghmi import exceptions as pyghmi_exc
|
||||
|
||||
import os_faults
|
||||
|
@ -11,8 +11,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import ddt
|
||||
import mock
|
||||
|
||||
from os_faults.api import node_collection
|
||||
from os_faults.drivers.power import libvirt
|
||||
|
@ -12,8 +12,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
import unittest
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from os_faults.api.node_collection import Host
|
||||
from os_faults.api.node_collection import NodeCollection
|
||||
|
@ -10,8 +10,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from unittest import mock
|
||||
|
||||
import jsonschema
|
||||
import mock
|
||||
|
||||
import os_faults
|
||||
from os_faults.ansible import executor
|
||||
|
@ -12,8 +12,7 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from os_faults.api import base_driver
|
||||
from os_faults.api import error
|
||||
|
@ -11,8 +11,7 @@
|
||||
# under the License.
|
||||
|
||||
import threading
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from os_faults.tests.unit import test
|
||||
from os_faults import utils
|
||||
@ -44,7 +43,7 @@ class UtilsTestCase(test.TestCase):
|
||||
tw.start_thread(target)
|
||||
tw.join_threads()
|
||||
|
||||
self.assertEqual(type(tw.errors[0]), MyException)
|
||||
self.assertIsInstance(tw.errors[0], MyException)
|
||||
|
||||
def test_join_threads(self):
|
||||
thread_1 = mock.Mock()
|
||||
|
@ -8,15 +8,9 @@ appdirs>=1.3.0 # MIT License
|
||||
click>=6.7 # BSD
|
||||
iso8601>=0.1.11 # 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;python_version>='3.6' # Apache-2.0
|
||||
oslo.i18n>=2.1.0,<4.0.0;python_version=='2.7' # Apache-2.0
|
||||
oslo.i18n>=2.1.0;python_version>='3.6' # Apache-2.0
|
||||
oslo.serialization>=1.10.0,<3.0.0;python_version=='2.7' # Apache-2.0
|
||||
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'
|
||||
oslo.concurrency>=3.0.0 # Apache-2.0
|
||||
oslo.i18n>=2.1.0 # Apache-2.0
|
||||
oslo.serialization>=1.10.0 # Apache-2.0
|
||||
oslo.utils>=3.20.0 # Apache-2.0
|
||||
pyghmi>=1.0.9
|
||||
PyYAML>=3.10.0 # MIT
|
||||
six>=1.9.0 # MIT
|
||||
|
28
setup.cfg
28
setup.cfg
@ -1,17 +1,18 @@
|
||||
[metadata]
|
||||
name = os_faults
|
||||
summary = OpenStack fault-injection library
|
||||
description-file =
|
||||
description_file =
|
||||
README.rst
|
||||
description-content-type = text/x-rst; charset=UTF-8
|
||||
description_content_type = text/x-rst; charset=UTF-8
|
||||
author = OpenStack
|
||||
author-email = openstack-discuss@lists.openstack.org
|
||||
author_email = openstack-discuss@lists.openstack.org
|
||||
url = http://os-faults.readthedocs.io/
|
||||
download_url = https://pypi.org/project/os-faults/
|
||||
project_urls =
|
||||
Bug Tracker = https://bugs.launchpad.net/os-faults
|
||||
Documentation = http://os-faults.readthedocs.io/
|
||||
Source Code = https://opendev.org/performa/os-faults/
|
||||
python_requires = >=3.8
|
||||
classifier =
|
||||
Environment :: OpenStack
|
||||
Intended Audience :: Information Technology
|
||||
@ -19,11 +20,11 @@ classifier =
|
||||
License :: OSI Approved :: Apache Software License
|
||||
Operating System :: POSIX :: Linux
|
||||
Programming Language :: Python
|
||||
Programming Language :: Python :: 2
|
||||
Programming Language :: Python :: 2.7
|
||||
Programming Language :: Python :: 3
|
||||
Programming Language :: Python :: 3.6
|
||||
Programming Language :: Python :: 3.7
|
||||
Programming Language :: Python :: 3.8
|
||||
Programming Language :: Python :: 3.9
|
||||
Programming Language :: Python :: 3.10
|
||||
Programming Language :: Python :: 3.11
|
||||
|
||||
[files]
|
||||
packages =
|
||||
@ -34,14 +35,6 @@ console_scripts =
|
||||
os-inject-fault = os_faults.cmd.cmd:main
|
||||
os-faults = os_faults.cmd.main:main
|
||||
|
||||
[build_sphinx]
|
||||
source-dir = doc/source
|
||||
build-dir = doc/build
|
||||
all_files = 1
|
||||
|
||||
[upload_sphinx]
|
||||
upload-dir = doc/build/html
|
||||
|
||||
[compile_catalog]
|
||||
directory = os_faults/locale
|
||||
domain = os_faults
|
||||
@ -55,8 +48,3 @@ input_file = os_faults/locale/os_faults.pot
|
||||
keywords = _ gettext ngettext l_ lazy_gettext
|
||||
mapping_file = babel.cfg
|
||||
output_file = os_faults/locale/os_faults.pot
|
||||
|
||||
[build_releasenotes]
|
||||
all_files = 1
|
||||
build-dir = releasenotes/build
|
||||
source-dir = releasenotes/source
|
||||
|
@ -1,8 +1,4 @@
|
||||
# The order of packages is significant, because pip processes them in the order
|
||||
# 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
|
||||
hacking>=6.1.0,<6.2.0 # Apache-2.0
|
||||
pytest # MIT
|
||||
pytest-cov # MIT
|
||||
pytest-html # Mozilla Public License 2.0 (MPL 2.0)
|
||||
@ -12,16 +8,7 @@ coverage>=4.0 # Apache-2.0
|
||||
ddt>=1.0.1 # MIT
|
||||
mock>=2.0 # BSD
|
||||
python-subunit>=0.0.18 # Apache-2.0/BSD
|
||||
sphinx!=1.6.6,!=1.6.7,<2.0.0;python_version=='2.7' # BSD
|
||||
sphinx!=1.6.6,!=1.6.7;python_version>='3.4' # BSD
|
||||
sphinxcontrib-programoutput # BSD
|
||||
sphinx_rtd_theme # MIT
|
||||
oslotest>=1.10.0,<4.0.0;python_version=='2.7' # Apache-2.0
|
||||
oslotest>=1.10.0;python_version>='3.6' # Apache-2.0
|
||||
oslotest>=1.10.0 # Apache-2.0
|
||||
testrepository>=0.0.18 # Apache-2.0/BSD
|
||||
testscenarios>=0.4 # Apache-2.0/BSD
|
||||
testtools>=1.4.0 # MIT
|
||||
|
||||
# releasenotes
|
||||
reno>=1.8.0,<3.0.0;python_version=='2.7' # Apache-2.0
|
||||
reno>=1.8.0;python_version>='3.6' # Apache-2.0
|
||||
|
41
tox.ini
41
tox.ini
@ -1,35 +1,38 @@
|
||||
[tox]
|
||||
minversion = 2.6
|
||||
envlist = pep8,py27,py36,cover
|
||||
skipsdist = True
|
||||
minversion = 3.18.0
|
||||
envlist = pep8,py3,cover
|
||||
ignore_basepython_conflict = True
|
||||
|
||||
[testenv]
|
||||
basepython = python3
|
||||
usedevelop = True
|
||||
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}/test-requirements.txt
|
||||
install_command = pip install -U {opts} {packages}
|
||||
setenv =
|
||||
VIRTUAL_ENV={envdir}
|
||||
whitelist_externals =
|
||||
allowlist_externals =
|
||||
find
|
||||
rm
|
||||
commands =
|
||||
find . -type f -name "*.pyc" -delete
|
||||
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]
|
||||
basepython = python3
|
||||
commands = flake8 . doc/ext
|
||||
|
||||
[testenv:venv]
|
||||
basepython = python3
|
||||
commands = {posargs}
|
||||
|
||||
[testenv:cover]
|
||||
basepython = python3
|
||||
commands =
|
||||
py.test --cov-config .coveragerc --cov-report html --cov=os_faults "os_faults/tests/unit"
|
||||
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 ''
|
||||
# 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
|
||||
basepython = python3
|
||||
setenv = {[testenv]setenv}
|
||||
OS_TEST_PATH=./os_faults/tests/devstack
|
||||
OS_DEBUG=True
|
||||
@ -50,13 +52,18 @@ commands =
|
||||
py.test -vvvv --html={envlogdir}/pytest_results.html --self-contained-html --durations=10 "os_faults/tests/devstack" {posargs}
|
||||
|
||||
[testenv:docs]
|
||||
basepython = python3
|
||||
allowlist_externals =
|
||||
rm
|
||||
deps =
|
||||
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
||||
-r{toxinidir}/doc/requirements.txt
|
||||
-r{toxinidir}/requirements.txt
|
||||
commands =
|
||||
rm -rf doc/build
|
||||
python setup.py build_sphinx --warning-is-error
|
||||
rm -rf doc/build
|
||||
sphinx-build -W --keep-going -b html doc/source doc/build/html
|
||||
|
||||
[testenv:releasenotes]
|
||||
basepython = python3
|
||||
deps = {[testenv:docs]deps}
|
||||
commands =
|
||||
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
||||
|
||||
@ -64,6 +71,8 @@ commands =
|
||||
# E123 skipped because it is ignored by default in the default pep8.
|
||||
# E125 skipped until https://github.com/jcrocholl/pep8/issues/126 is resolved.
|
||||
# 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
|
||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
||||
|
Loading…
x
Reference in New Issue
Block a user