Browse Source

Use upper-constraints file from requirements project

Change-Id: I26318898ced32248a2ff31a78ec15d49382b9027
changes/86/725186/10
Federico Ressi 1 year ago
parent
commit
388426812d
  1. 3
      bindep.txt
  2. 4
      infrared_plugin/plugin.spec
  3. 6
      roles/tests/Vagrantfile
  4. 12
      roles/tests/test_infrared_plugin.yaml
  5. 7
      roles/tobiko-common/defaults/main.yaml
  6. 35
      roles/tobiko-ensure-python3/tasks/constraints.yaml
  7. 3
      roles/tobiko-ensure-python3/tasks/install.yaml
  8. 3
      roles/tobiko-ensure-python3/tasks/python3.yaml
  9. 5
      roles/tobiko-tox/defaults/main.yaml
  10. 8
      tox.ini
  11. 2
      zuul.d/devstack.yaml
  12. 6
      zuul.d/infrared.yaml
  13. 3
      zuul.d/tripleo.yaml

3
bindep.txt

@ -22,7 +22,10 @@ libselinux-python [platform:rhel-7]
libselinux-python [platform:centos-7]
python-devel [platform:rhel-7]
python-devel [platform:centos-7]
python-pip [platform:centos-7]
python-pip [platform:rhel-7]
python-virtualenv [platform:centos-7]
python-virtualenv [platform:rhel-7]
# RHEL/CentOS 8
python3-libselinux [platform:rhel-8]

4
infrared_plugin/plugin.spec

@ -163,6 +163,10 @@ subparsers:
type: Value
help: test cases log file
ansible_variable: test_log_file
upper-constraints-file:
type: Value
help: URL or path to upper contraints file
ansible_variable: upper_constraints_file
- title: Collect stage
options:

6
roles/tests/Vagrantfile

@ -18,6 +18,9 @@ TOX_INI_DIR = '../..'
TEST_DIR = File.dirname(__FILE__)
UPPER_CONSTRAINTS_FILE = ENV.fetch(
"UPPER_CONSTRAINTS_FILE",
"https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt")
# list of VMs
NODES = {
@ -120,6 +123,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
node.vm.provision "ansible" do |ansible|
ansible.limit = 'all'
ansible.playbook = playbook_file
ansible.extra_vars = {
'upper_constraints_file' => UPPER_CONSTRAINTS_FILE,
}
end
end
end

12
roles/tests/test_infrared_plugin.yaml

@ -16,12 +16,14 @@
state: absent
- name: "run Tox InfraRed plugin"
command: >
'{{ tox_executable }}' -e infrared --
--host secondary
--collect-dir '{{ test_collect_dir }}'
args:
command:
cmd: >
'{{ tox_executable }}' -e infrared --
--host secondary
--collect-dir '{{ test_collect_dir }}'
chdir: /vagrant
environment:
UPPER_CONSTRAINTS_FILE: '{{ remote_constraints_file }}'
ignore_errors: yes
register: run_tox

7
roles/tobiko-common/defaults/main.yaml

@ -63,3 +63,10 @@ test_log_file: '{{ test_report_dir | realpath }}/tobiko.log'
# Local where test cases results are being collected to
test_collect_dir: '{{ test_src_dir | realpath }}/{{ test_report_name }}'
# --- Workaround compatibility issues -----------------------------------------
upper_constraints_file:
'https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt'

35
roles/tobiko-ensure-python3/tasks/constraints.yaml

@ -0,0 +1,35 @@
---
- block:
- name: "look at remote host constraints file '{{ upper_constraints_file }}'"
stat:
path: '{{ upper_constraints_file | realpath }}'
when: "not upper_constraints_file.startswith('http')"
register: stat_upper_constraints_file
failed_when: 'not stat_upper_constraints_file.stat.exists'
- name: "set remote upper constraints file path"
set_fact:
remote_constraints_file: '{{ upper_constraints_file }}'
rescue:
- name: "create temporary upper requirements file"
tempfile:
state: file
suffix: .txt
register: create_upper_constraints_file
- debug: var=create_upper_constraints_file
- name: "copy upper requirements file"
copy:
src: '{{ upper_constraints_file }}'
dest: '{{ create_upper_constraints_file.path }}'
mode: "0644"
- name: "set remote upper constraints file path"
set_fact:
remote_constraints_file: '{{ create_upper_constraints_file.path }}'
- debug: var=upper_constraints_file

3
roles/tobiko-ensure-python3/tasks/install.yaml

@ -37,11 +37,12 @@
- name: "upgrade '{{ python_command }}' packages to the latest versions"
command: >
'{{ python_info[python_command].executable }}' -m pip install '{{ item }}' \
--upgrade --user
--upgrade --user -c '{{ remote_constraints_file }}'
loop:
- pip
- setuptools
- wheel
- virtualenv
- name: "show python_info facts"

3
roles/tobiko-ensure-python3/tasks/python3.yaml

@ -14,6 +14,9 @@
- (python_version | string).split(".")[0] == '3'
- include_tasks: constraints.yaml
- include_tasks: install.yaml
vars:
python_command: '{{ python3_command }}'

5
roles/tobiko-tox/defaults/main.yaml

@ -18,4 +18,7 @@ tox_report_env:
TOBIKO_TEST_REPORT_DIR: '{{ tox_report_dir }}'
TOBIKO_TEST_REPORT_NAME: '{{ tox_report_name }}'
tox_constrain_env: {}
tox_constraints_file: '{{ remote_constraints_file }}'
tox_constrain_env:
UPPER_CONSTRAINTS_FILE: '{{ tox_constraints_file }}'

8
tox.ini

@ -9,7 +9,7 @@ minversion = 3.4.0
[base]
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
-c{env:UPPER_CONSTRAINTS_FILE}
-r{toxinidir}/requirements.txt
passenv =
PS1
@ -18,11 +18,12 @@ setenv =
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
PS1=[tobiko@{envname}] {env:PS1:}
PYTHON={env:PYTHON:python3}
PYTHONWARNINGS=ignore::Warning,{env:PYTHONWARNINGS:}
TOBIKO_PREVENT_CREATE={env:TOBIKO_PREVENT_CREATE:false}
VIRTUAL_ENV={envdir}
PS1=[tobiko@{envname}] {env:PS1:}
UPPER_CONSTRAINTS_FILE={env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
commands =
stestr run {posargs}
@ -188,7 +189,7 @@ whitelist_externals =
rm
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
-c{env:UPPER_CONSTRAINTS_FILE}
-rinfrared-requirements.txt
passenv =
{[testenv:venv]passenv}
@ -213,6 +214,7 @@ commands =
ir tobiko \
--tobiko-src-dir {toxinidir} \
--collect-dir '{toxinidir}/test_results' \
--upper-constraints '{env:UPPER_CONSTRAINTS_FILE}' \
{posargs}

2
zuul.d/devstack.yaml

@ -12,6 +12,7 @@
- openstack/devstack-gate
- openstack/heat
- openstack/neutron
- openstack/requirements
- x/tobiko
timeout: 7200
vars:
@ -68,6 +69,7 @@
yaml: true
yml: true
tobiko_dir: '/opt/stack/tobiko'
upper_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/openstack/requirements/upper-constraints.txt'
pre-run: playbooks/devstack/pre.yaml
run: playbooks/devstack/run.yaml

6
zuul.d/infrared.yaml

@ -10,18 +10,20 @@
pre-run: playbooks/infrared/pre.yaml
run: playbooks/infrared/run.yaml
required-projects:
x/tobiko
- name: openstack/requirements
- name: x/tobiko
vars:
test_collect_dir: '{{ zuul_output_dir }}/logs'
test_inventory_file: '{{ zuul_work_dir }}/ansible_hosts'
tox_envlist: infrared
tox_extra_args: -- --host secondary --collect-dir {{ test_collect_dir | quote }}
tox_constraints_file: '{{ upper_constraints_file }}'
upper_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/openstack/requirements/upper-constraints.txt'
tox_environ:
ANSIBLE_INVENTORY: '{{ test_inventory_file }}'
zuul_output_dir: '{{ ansible_user_dir }}/zuul-output'
zuul_work_dir: "{{ zuul.projects['opendev.org/x/tobiko'].src_dir }}"
- job:
name: tobiko-tox-infrared-centos-7
parent: tobiko-tox-infrared

3
zuul.d/tripleo.yaml

@ -4,9 +4,9 @@
description: Base Tobiko TripleO job
parent: tripleo-ci-centos-8-scenario002-standalone
required-projects:
- openstack/requirements
- openstack/tripleo-ci
- x/tobiko
pre-run: playbooks/tripleo/pre.yaml
run: playbooks/tripleo/run.yaml
post-run: playbooks/tripleo/post.yaml
@ -14,6 +14,7 @@
test_conf:
keystone:
cloud_name: standalone
upper_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/openstack/requirements/upper-constraints.txt'
featureset: '052'
featureset_override:
run_tempest: false

Loading…
Cancel
Save