diff options
-rw-r--r-- | .zuul.yaml | 10 | ||||
-rw-r--r-- | playbooks/legacy/tempest-dsvm-neutron-src-python-troveclient/post.yaml | 15 | ||||
-rw-r--r-- | playbooks/legacy/tempest-dsvm-neutron-src-python-troveclient/run.yaml | 62 | ||||
-rw-r--r-- | tox.ini | 6 | ||||
-rw-r--r-- | troveclient/tests/test_v1_shell.py | 11 |
5 files changed, 15 insertions, 89 deletions
@@ -13,9 +13,7 @@ - openstack-tox-lower-constraints - job: name: python-troveclient-tempest-neutron-src - parent: legacy-dsvm-base - run: playbooks/legacy/tempest-dsvm-neutron-src-python-troveclient/run.yaml - post-run: playbooks/legacy/tempest-dsvm-neutron-src-python-troveclient/post.yaml + parent: devstack-tempest timeout: 7800 required-projects: - openstack-dev/devstack @@ -27,4 +25,10 @@ - openstack/trove-dashboard - openstack/tempest - openstack/trove-tempest-plugin + vars: + tox_envlist: 'full' + devstack_localrc: + TEMPEST_PLUGINS: '/opt/stack/trove-tempest-plugin' + devstack_plugins: + trove: git://git.openstack.org/openstack/trove diff --git a/playbooks/legacy/tempest-dsvm-neutron-src-python-troveclient/post.yaml b/playbooks/legacy/tempest-dsvm-neutron-src-python-troveclient/post.yaml deleted file mode 100644 index e07f551..0000000 --- a/playbooks/legacy/tempest-dsvm-neutron-src-python-troveclient/post.yaml +++ /dev/null @@ -1,15 +0,0 @@ -- hosts: primary - tasks: - - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node - synchronize: - src: '{{ ansible_user_dir }}/workspace/' - dest: '{{ zuul.executor.log_root }}' - mode: pull - copy_links: true - verify_host: true - rsync_opts: - - --include=/logs/** - - --include=*/ - - --exclude=* - - --prune-empty-dirs diff --git a/playbooks/legacy/tempest-dsvm-neutron-src-python-troveclient/run.yaml b/playbooks/legacy/tempest-dsvm-neutron-src-python-troveclient/run.yaml deleted file mode 100644 index 985b9e6..0000000 --- a/playbooks/legacy/tempest-dsvm-neutron-src-python-troveclient/run.yaml +++ /dev/null @@ -1,62 +0,0 @@ -- hosts: all - name: tempest-python-trovelient-neutron-src, copied from - old job gate-tempest-dsvm-neutron-src-python-troveclient-ubuntu-xenial - tasks: - - - name: Ensure legacy workspace directory - file: - path: '{{ ansible_user_dir }}/workspace' - state: directory - - - shell: - cmd: | - set -e - set -x - cat > clonemap.yaml << EOF - clonemap: - - name: openstack-infra/devstack-gate - dest: devstack-gate - EOF - /usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \ - git://git.openstack.org \ - openstack-infra/devstack-gate - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' - - - shell: - cmd: | - set -e - set -x - cat << 'EOF' >>"/tmp/dg-local.conf" - [[local|localrc]] - enable_plugin trove git://git.openstack.org/openstack/trove - TEMPEST_PLUGINS='/opt/stack/new/trove-tempest-plugin' - - EOF - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' - - - shell: - cmd: | - set -e - set -x - export PYTHONUNBUFFERED=true - export DEVSTACK_GATE_TROVE=1 - export DEVSTACK_GATE_TEMPEST=1 - export DEVSTACK_GATE_TEMPEST_FULL=1 - export DEVSTACK_GATE_NEUTRON=1 - export BRANCH_OVERRIDE=default - if [ "$BRANCH_OVERRIDE" != "default" ] ; then - export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE - fi - export PROJECTS="openstack/trove-dashboard $PROJECTS" - export PROJECTS="openstack/trove-tempest-plugin $PROJECTS" - export DEVSTACK_PROJECT_FROM_GIT=python-troveclient - cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh - ./safe-devstack-vm-gate-wrap.sh - - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' @@ -25,6 +25,7 @@ whitelist_externals = find rm [testenv:debug] +basepython = python3 commands = oslo_debug_helper -t troveclient/tests {posargs} [testenv:debug-py27] @@ -36,12 +37,15 @@ basepython = python3.5 commands = oslo_debug_helper -t troveclient/tests {posargs} [testenv:pep8] +basepython = python3 commands = flake8 [testenv:venv] +basepython = python3 commands = {posargs} [testenv:cover] +basepython = python3 commands = coverage erase python setup.py testr --coverage --testr-args='{posargs}' @@ -49,6 +53,7 @@ commands = coverage report [testenv:docs] +basepython = python3 deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -r{toxinidir}/requirements.txt @@ -58,6 +63,7 @@ commands = sphinx-build -W -b html doc/source doc/build/html [testenv:releasenotes] +basepython = python3 deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -r{toxinidir}/requirements.txt diff --git a/troveclient/tests/test_v1_shell.py b/troveclient/tests/test_v1_shell.py index 689cb5a..59b0ab1 100644 --- a/troveclient/tests/test_v1_shell.py +++ b/troveclient/tests/test_v1_shell.py @@ -13,13 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. -try: - # handle py34 - import builtins -except ImportError: - # and py27 - import __builtin__ as builtins - import base64 import fixtures import mock @@ -699,7 +692,7 @@ class ShellTest(utils.TestCase): self.assert_called('GET', '/modules/4321') def test_module_create(self): - with mock.patch.object(builtins, 'open'): + with mock.patch('argparse.open'): return_value = b'mycontents' expected_contents = str(return_value.decode('utf-8')) mock_encode = mock.Mock(return_value=return_value) @@ -787,7 +780,7 @@ class ShellTest(utils.TestCase): def test_module_retrieve(self): with mock.patch.object(troveclient.v1.modules.Module, '__getattr__', mock.Mock(return_value='4321')): - with mock.patch.object(builtins, 'open'): + with mock.patch('troveclient.v1.instances.open'): self.run_command('module-retrieve 1234') self.assert_called( 'GET', |