diff --git a/playbooks/devstack.yaml b/playbooks/tobiko-devstack.yaml similarity index 95% rename from playbooks/devstack.yaml rename to playbooks/tobiko-devstack.yaml index 053a10c8f..9e3d6d3b3 100644 --- a/playbooks/devstack.yaml +++ b/playbooks/tobiko-devstack.yaml @@ -20,3 +20,7 @@ - hosts: all roles: - orchestrate-devstack + +- hosts: tempest + roles: + - run-tox diff --git a/roles/run-tox/defaults/main.yaml b/roles/run-tox/defaults/main.yaml new file mode 100644 index 000000000..47a02d3d2 --- /dev/null +++ b/roles/run-tox/defaults/main.yaml @@ -0,0 +1,3 @@ +tox_dir: /opt/stack/tobiko +tox_envlist: neutron +tox_extra_args: '' diff --git a/roles/run-tox/tasks/main.yaml b/roles/run-tox/tasks/main.yaml new file mode 100644 index 000000000..bc7be2f7d --- /dev/null +++ b/roles/run-tox/tasks/main.yaml @@ -0,0 +1,29 @@ +# The number of vcpus is not available on all systems. +# See https://github.com/ansible/ansible/issues/30688 +# When not available, we fall back to ansible_processor_cores +- name: Get hw.logicalcpu from sysctl + shell: sysctl hw.logicalcpu | cut -d' ' -f2 + register: sysctl_hw_logicalcpu + when: ansible_processor_vcpus is not defined + +- name: Number of cores + set_fact: + num_cores: "{{ansible_processor_vcpus|default(sysctl_hw_logicalcpu.stdout)}}" + +- name: Set concurrency for cores == 3 or less + set_fact: + default_concurrency: "{{ num_cores }}" + when: num_cores|int <= 3 + +- name: Limit max concurrency when more than 3 vcpus are available + set_fact: + default_concurrency: "{{ num_cores|int // 2 }}" + when: num_cores|int > 3 + +- name: Run Tobiko + command: tox -e {{tox_envlist}} {{tox_extra_args}} -- --concurrency={{default_concurrency}} + args: + chdir: "{{tox_dir}}" + become: true + become_user: stack + diff --git a/zuul.d/devstack.yaml b/zuul.d/tobiko-devstack.yaml similarity index 94% rename from zuul.d/devstack.yaml rename to zuul.d/tobiko-devstack.yaml index 0faf9c3f7..12ca437f7 100644 --- a/zuul.d/devstack.yaml +++ b/zuul.d/tobiko-devstack.yaml @@ -11,6 +11,7 @@ set the nodeset to a multi-node one. required-projects: - openstack-infra/devstack-gate + - openstack/heat - openstack/neutron - openstack/tobiko timeout: 7200 @@ -19,6 +20,7 @@ USE_PYTHON3: true NETWORK_API_EXTENSIONS: address-scope,agent,allowed-address-pairs,auto-allocated-topology,availability_zone,binding,default-subnetpools,dhcp_agent_scheduler,dns-domain-ports,dns-integration,dvr,empty-string-filtering,ext-gw-mode,external-net,extra_dhcp_opt,extraroute,filter-validation,fip-port-details,flavors,ip-substring-filtering,l3-flavors,l3-ha,l3_agent_scheduler,logging,metering,multi-provider,net-mtu,net-mtu-writable,network-ip-availability,network_availability_zone,pagination,port-security,project-id,provider,qos,qos-bw-minimum-ingress,qos-fip,quotas,quota_details,rbac-policies,router,router_availability_zone,security-group,port-mac-address-regenerate,port-security-groups-filtering,segment,service-type,sorting,standard-attr-description,standard-attr-revisions,standard-attr-segment,standard-attr-timestamp,standard-attr-tag,subnet_allocation,trunk,trunk-details,uplink-status-propagation devstack_plugins: + heat: git://git.openstack.org/openstack/heat.git neutron: git://git.openstack.org/openstack/neutron.git tobiko: git://git.openstack.org/openstack/tobiko.git devstack_services: @@ -47,8 +49,8 @@ log: true yaml: true yml: true - run: playbooks/devstack.yaml - # post-run: playbooks/post-tobiko.yaml + run: playbooks/tobiko-devstack.yaml + # post-run: playbooks/post-tobiko-devstack.yaml irrelevant-files: - ^.*\.rst$ - ^api-ref/.*$