Use upper-constraints file from requirements project

Change-Id: I26318898ced32248a2ff31a78ec15d49382b9027
This commit is contained in:
Federico Ressi 2020-05-04 10:28:39 +02:00
parent 905b60633c
commit 388426812d
13 changed files with 84 additions and 13 deletions

View File

@ -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]

View File

@ -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:

View File

@ -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

View File

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

View File

@ -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'

View File

@ -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

View File

@ -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"

View File

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

View File

@ -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 }}'

View File

@ -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}

View File

@ -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

View File

@ -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

View File

@ -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