diff --git a/Vagrantfile b/Vagrantfile index 875a33a..2f965ac 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -8,7 +8,7 @@ VAGRANTFILE_API_VERSION = "2" CPUS = 4 # Customize the amount of memory on the VM -MEMORY = ENV.fetch("VM_SIZE", "4096").to_i +MEMORY = ENV.fetch("VM_SIZE", "8192").to_i # Every Vagrant development environment requires a box. You can search for # boxes at https://vagrantcloud.com/search. diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 585fda3..dbea0f4 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -3,10 +3,10 @@ TOBIKO_PLUGIN_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) function install_tobiko_deps { - if [ "${TOBIKO_BINDEP}" != "" ]; then - install_python3 - install_bindep "${TOBIKO_DIR}/bindep.txt" test - fi + install_python3 + git_clone "${TOBIKO_REPO}" "${TOBIKO_DIR}" "${TOBIKO_VERSION}" + install_bindep "${TOBIKO_DIR}/bindep.txt" test + pip_install 'tox>=3.8.0' } diff --git a/devstack/settings b/devstack/settings index f4c4fd1..4b0ad13 100644 --- a/devstack/settings +++ b/devstack/settings @@ -13,8 +13,6 @@ TOBIKO_CONF_FILE=${TOBIKO_CONF_FILE:-/etc/tobiko/tobiko.conf} TOBIKO_DEBUG=${TOBIKO_DEBUG:-True} TOBIKO_LOG_FILE=${TOBIKO_LOG_FILE:-${LOGDIR}/tobiko.log} -TOBIKO_BINDEP=${BINDEP_CMD:+-bindep} - # --- Glance settings --- TOBIKO_GLANCE_IMAGE_DIR=${TOBIKO_GLANCE_IMAGE_DIR:-} diff --git a/playbooks/vagrant/local.conf b/playbooks/vagrant/local.conf index e3a5554..f7d5ce3 100644 --- a/playbooks/vagrant/local.conf +++ b/playbooks/vagrant/local.conf @@ -27,4 +27,4 @@ enable_plugin heat https://opendev.org/openstack/heat.git # Configure Tobiko ------------------------------------------------------------ -enable_plugin devstack-tobiko-plugin https://opendev.org/x/devstack-plugin-tobiko.git +enable_plugin devstack-plugin-tobiko https://opendev.org/x/devstack-plugin-tobiko.git diff --git a/roles/devstack-tobiko-common/defaults/main.yaml b/roles/devstack-tobiko-common/defaults/main.yaml index f3e9b1a..b8b7bb5 100644 --- a/roles/devstack-tobiko-common/defaults/main.yaml +++ b/roles/devstack-tobiko-common/defaults/main.yaml @@ -21,4 +21,15 @@ devstack_dir: '{{ devstack_dest_dir }}/devstack' sudo_secure_path: '' -tobiko_dir: '{{ devstack_dest_dir }}/tobiko' +test_dir: '{{ devstack_dest_dir }}/tobiko' +tox_envlist: '' +tox_extra_args: '' +tox_command_executable: 'tox' +tox_command_line: >- + {{ tox_command_executable }} + {% if (tox_envlist | length) > 0 %} + -e '{{ tox_envlist }}' + {% endif %} + {% if (tox_extra_args | length) > 0 %} + {{ tox_extra_args }} + {% endif %} diff --git a/roles/devstack-tobiko-run-tests/tasks/run-tests.yaml b/roles/devstack-tobiko-run-tests/tasks/run-tests.yaml index 57fda0b..2b02852 100644 --- a/roles/devstack-tobiko-run-tests/tasks/run-tests.yaml +++ b/roles/devstack-tobiko-run-tests/tasks/run-tests.yaml @@ -1,7 +1,18 @@ --- -- name: run tobiko test cases - command: - cmd: > - tox -e {{ tox_envlist }} - chdir: '{{ tobiko_dir }}' +- name: 'Run test cases: {{ tox_command_line }}' + become: true + become_user: stack + shell: + cmd: | + sudo su -l stack -c "cd '{{ test_dir }}' && {{ tox_command_line }}" 2>&1 + rc=$? + echo "*** FINISHED ***" + exit $rc + register: run_tox + ignore_errors: true + + +- name: Show test cases output + debug: var=run_tox.stdout_lines + failed_when: run_tox is failed diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 6989742..55c2420 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -15,9 +15,8 @@ - openstack/heat - openstack/neutron - openstack/requirements - - openstack/validations-libs - - x/tobiko - x/devstack-plugin-tobiko + - x/tobiko timeout: 7200 vars: devstack_localrc: @@ -42,7 +41,7 @@ devstack_plugins: heat: https://opendev.org/openstack/heat.git neutron: https://opendev.org/openstack/neutron.git - tobiko: https://opendev.org/x/devstack-plugin-tobiko.git + devstack-plugin-tobiko: https://opendev.org/x/devstack-plugin-tobiko.git devstack_services: heat: true h-api: true