Browse Source

Use local upper-constraints.txt

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

Change-Id: I0f835d753fb9d3a1670e8eb9b196e02e989d4262
changes/19/815419/19
Federico Ressi 7 months ago
parent
commit
03b9eec659
  1. 10
      .pre-commit-config.yaml
  2. 4
      infrared_plugin/plugin.spec
  3. 22
      lower-constraints.txt
  4. 6
      roles/tobiko-common/defaults/main.yaml
  5. 35
      roles/tobiko-ensure-python3/tasks/constraints.yaml
  6. 3
      roles/tobiko-ensure-python3/tasks/ensure-python3.yaml
  7. 2
      roles/tobiko-ensure-python3/tasks/install.yaml
  8. 4
      roles/tobiko-tox/defaults/main.yaml
  9. 24
      roles/tobiko-tox/tasks/tox.yaml
  10. 9
      tools/install.py
  11. 6
      tox.ini
  12. 29
      upper-constraints.txt
  13. 3
      zuul.d/infrared.yaml
  14. 6
      zuul.d/project.yaml
  15. 2
      zuul.d/tripleo.yaml

10
.pre-commit-config.yaml

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

4
infrared_plugin/plugin.spec

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

22
lower-constraints.txt

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

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

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

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

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

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

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

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

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

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

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

24
roles/tobiko-tox/tasks/tox.yaml

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

9
tools/install.py

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

6
tox.ini

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

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

3
zuul.d/infrared.yaml

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

6
zuul.d/project.yaml

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

2
zuul.d/tripleo.yaml

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

Loading…
Cancel
Save