Use local upper-constraints.txt

- Remove support for constrains file from infrared plugin
- Use file stored on tobiko repository by default

Change-Id: I0f835d753fb9d3a1670e8eb9b196e02e989d4262
This commit is contained in:
Federico Ressi 2021-10-26 10:31:40 +02:00
parent ee386f8d9b
commit 03b9eec659
15 changed files with 64 additions and 101 deletions

View File

@ -15,7 +15,15 @@ repos:
- id: end-of-file-fixer
- id: forbid-new-submodules
- id: requirements-txt-fixer
args: [requirements.txt, test-requirements.txt, extra-requirements.txt, linters-requirements.txt, doc/requirements.txt, infrared_plugin/requirements.txt]
args:
- doc/requirements.txt
- extra-requirements.txt
- infrared_plugin/requirements.txt
- linters-requirements.txt
- lower-constraints.txt
- requirements.txt
- test-requirements.txt
- upper-constraints.txt
- id: trailing-whitespace
- repo: https://gitlab.com/pycqa/flake8.git

View File

@ -184,10 +184,6 @@ 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
ignore-test-failures:
type: Flag
help: Ignore test execution errors

View File

@ -1,19 +1,21 @@
# from requirements.txt
coverage==5.3.1
decorator===4.4.2
deprecation==2.1.0
docker==4.4.1
dpkt >= 1.8.8
fixtures==3.0.0
Jinja2==2.11.2
keystoneauth1==4.3.0
mock==3.0.5
netaddr==0.8.0
neutron-lib==2.7.0
oslo.config==8.4.0
oslo.log==4.4.0
paramiko==2.7.2
pbr==5.5.1
podman==1.6.0
psutil==5.8.0
pytest==6.2.1
pytest-html==3.1.1
pytest-xdist==2.2.0
python-glanceclient==3.2.2
python-heatclient==2.3.0
python-ironicclient==4.6.1
@ -22,18 +24,6 @@ python-novaclient==17.2.1
python-octaviaclient==2.2.0
python-openstackclient==5.4.0
PyYAML==5.4.1
six==1.15.0
sshtunnel==0.3.1
stestr==3.1.0
testtools==2.4.0
validations-libs==1.1.0
# from test-requirements.txt
ansi2html==1.6.0
coverage==5.3.1
mock==3.0.5
psutil==5.8.0
pytest==6.2.1
pytest-html==3.1.1
pytest-xdist==2.2.0

View File

@ -53,9 +53,3 @@ 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

@ -1,35 +0,0 @@
---
- 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

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

View File

@ -50,7 +50,7 @@
- name: "upgrade '{{ python_command }}' packages to the latest versions"
command: >
'{{ python_info[python_command].executable }}' -m pip install '{{ item }}' \
--upgrade --user -c '{{ remote_constraints_file }}'
--upgrade --user
register: upgrade_python_packages
changed_when:
"'Successfully installed' in upgrade_python_packages.stdout"

View File

@ -17,12 +17,12 @@ tox_report_name:
tox_run_tests_timeout: 18000 # 5 hours
tox_constraints_file: '{{ remote_constraints_file }}'
tox_constraints: ''
tox_constrain_env:
TOX_REPORT_DIR: '{{ tox_report_dir }}'
TOX_REPORT_NAME: '{{ tox_report_name }}'
TOX_CONSTRAINTS_FILE: '{{ tox_constraints_file }}'
TOX_CONSTRAINTS: '{{ tox_constraints }}'
TOX_RUN_TESTS_TIMEOUT: '{{ tox_run_tests_timeout | float }}'
tox_succeeded_rc: 0

View File

@ -1,6 +1,6 @@
---
- name: "set Tox command line fact"
- name: set Tox command line fact
set_fact:
tox_command_line: >
{{ tox_command }}
@ -8,25 +8,23 @@
{{ tox_extra_args }}
- name: "normalize white spaces from Tox command line"
- name: normalize white spaces from Tox command line
set_fact:
tox_command_line: '{{ tox_command_line.split() | join(" ") }}'
- name: "combine environment variables"
- name: combine environment variables
set_fact:
tox_env: '{{ tox_environment | from_yaml | combine(tox_constrain_env) }}'
- name: "show tox variables"
debug:
msg:
tox_command_line: '{{ tox_command_line }}'
tox_description: '{{ tox_description }}'
tox_dir: '{{ tox_dir }}'
tox_env: '{{ tox_env }}'
tox_expected_rcs: '{{ tox_expected_rcs }}'
- name: show tox variables
debug: var="{{ item }}"
loop:
- tox_command_line
- tox_description
- tox_dir
- tox_env
- tox_expected_rcs
- name: "{{ tox_description }}"
command:

View File

@ -17,7 +17,6 @@ from __future__ import absolute_import
import os
import site
import sys
import typing
TOP_DIR = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))
@ -32,12 +31,8 @@ LOG = common.get_logger(__name__)
TOX_VERSION = os.environ.get('TOX_VERSION') or '>=3.8.0'
TOX_CONSTRAINTS_FILE = (
os.environ.get('TOX_CONSTRAINTS_FILE') or
'https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt')
TOX_CONSTRAINTS = (
os.environ.get('TOX_CONSTRAINTS') or f"'-c{TOX_CONSTRAINTS_FILE}'")
TOX_CONSTRAINTS = (os.environ.get('TOX_CONSTRAINTS') or
f"-c{TOP_DIR}/upper-constraints.txt")
def main():

View File

@ -35,8 +35,7 @@ setenv =
TOX_NUM_PROCESSES = {env:TOX_NUM_PROCESSES:auto}
TOX_REPORT_NAME = {env:TOX_REPORT_NAME:tobiko_results_{envname}}
TOX_REPORT_DIR = {env:TOX_REPORT_DIR:{envlogdir}}
TOX_CONSTRAINTS = {env:TOX_CONSTRAINTS:-c{env:TOX_CONSTRAINTS_FILE}}
TOX_CONSTRAINTS_FILE = {env:TOX_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
TOX_CONSTRAINTS = {env:TOX_CONSTRAINTS:-c{toxinidir}/upper-constraints.txt}
TOX_EXTRA_REQUIREMENTS = {env:TOX_EXTRA_REQUIREMENTS:-r{toxinidir}/extra-requirements.txt}
VIRTUAL_ENV = {envdir}
commands_pre =
@ -82,7 +81,7 @@ setenv =
{[testenv]setenv}
#fressi: There is a conflict between the last global constrains file and pylint
# requirements
TOX_CONSTRAINTS_FILE = https://opendev.org/openstack/requirements/raw/branch/stable/xena/upper-constraints.txt
TOX_CONSTRAINTS = -c{toxinidir}/upper-constraints.txt
[testenv:mypy]
@ -308,7 +307,6 @@ commands_pre =
commands =
ir tobiko --tobiko-src-dir '{toxinidir}' \
--collect-dir '{env:TOX_REPORT_DIR}' \
--upper-constraints '{env:TOX_CONSTRAINTS_FILE}' \
{posargs}

29
upper-constraints.txt Normal file
View File

@ -0,0 +1,29 @@
coverage===6.0.2
decorator===5.1.0
deprecation===2.1.0
docker===5.0.3
fixtures===3.0.0
Jinja2===3.0.2
keystoneauth1===4.4.0
mock===4.0.3
netaddr===0.8.0
neutron-lib===2.16.0
oslo.config===8.7.1
oslo.log===4.6.1
paramiko===2.8.0
pbr===5.6.0
psutil===5.8.0
pytest===6.2.5
pytest-html===3.1.1
pytest-xdist===2.4.0
python-glanceclient===3.5.0
python-heatclient===2.4.0
python-ironicclient===4.9.0
python-neutronclient===7.6.0
python-novaclient===17.6.0
python-octaviaclient===2.4.0
python-openstackclient===5.6.0
PyYAML===6.0
sshtunnel===0.4.0
testtools===2.5.0
validations-libs===1.4.0

View File

@ -30,7 +30,6 @@
pre-run: playbooks/infrared/pre.yaml
run: playbooks/infrared/run.yaml
required-projects:
- name: openstack/requirements
- name: x/tobiko
voting: true
vars:
@ -40,8 +39,6 @@
test_inventory_groups: {undercloud: [secondary]}
tox_envlist: infrared
tox_extra_args: -- --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'

View File

@ -21,14 +21,12 @@
- tobiko-infrared
vars:
rtd_webhook_id: '84947'
check:
jobs:
- requirements-check:
voting: false
periodic:
jobs:
- devstack-tobiko-octavia:
voting: false
- requirements-check:
voting: false
- tobiko-infrared
- tobiko-infrared-centos-7
- tobiko-infrared-fedora

View File

@ -4,7 +4,6 @@
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
@ -14,7 +13,6 @@
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