From 03b9eec659d45133f1646e98dcdab7cb1c39cce3 Mon Sep 17 00:00:00 2001 From: Federico Ressi Date: Tue, 26 Oct 2021 10:31:40 +0200 Subject: [PATCH] Use local upper-constraints.txt - Remove support for constrains file from infrared plugin - Use file stored on tobiko repository by default Change-Id: I0f835d753fb9d3a1670e8eb9b196e02e989d4262 --- .pre-commit-config.yaml | 10 +++++- infrared_plugin/plugin.spec | 4 --- lower-constraints.txt | 22 ++++-------- roles/tobiko-common/defaults/main.yaml | 6 ---- .../tasks/constraints.yaml | 35 ------------------- .../tasks/ensure-python3.yaml | 3 -- .../tobiko-ensure-python3/tasks/install.yaml | 2 +- roles/tobiko-tox/defaults/main.yaml | 4 +-- roles/tobiko-tox/tasks/tox.yaml | 24 ++++++------- tools/install.py | 9 ++--- tox.ini | 6 ++-- upper-constraints.txt | 29 +++++++++++++++ zuul.d/infrared.yaml | 3 -- zuul.d/project.yaml | 6 ++-- zuul.d/tripleo.yaml | 2 -- 15 files changed, 64 insertions(+), 101 deletions(-) delete mode 100644 roles/tobiko-ensure-python3/tasks/constraints.yaml create mode 100644 upper-constraints.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ac65ddaf8..ee059ff51 100644 --- a/.pre-commit-config.yaml +++ b/.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 diff --git a/infrared_plugin/plugin.spec b/infrared_plugin/plugin.spec index 3c707c2a6..3910eb544 100644 --- a/infrared_plugin/plugin.spec +++ b/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 diff --git a/lower-constraints.txt b/lower-constraints.txt index 06066ac88..e8d734a29 100644 --- a/lower-constraints.txt +++ b/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 diff --git a/roles/tobiko-common/defaults/main.yaml b/roles/tobiko-common/defaults/main.yaml index b91adf113..8f33223c4 100644 --- a/roles/tobiko-common/defaults/main.yaml +++ b/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' diff --git a/roles/tobiko-ensure-python3/tasks/constraints.yaml b/roles/tobiko-ensure-python3/tasks/constraints.yaml deleted file mode 100644 index 4633f038b..000000000 --- a/roles/tobiko-ensure-python3/tasks/constraints.yaml +++ /dev/null @@ -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 diff --git a/roles/tobiko-ensure-python3/tasks/ensure-python3.yaml b/roles/tobiko-ensure-python3/tasks/ensure-python3.yaml index cd9018364..ea5352a3e 100644 --- a/roles/tobiko-ensure-python3/tasks/ensure-python3.yaml +++ b/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 diff --git a/roles/tobiko-ensure-python3/tasks/install.yaml b/roles/tobiko-ensure-python3/tasks/install.yaml index a77cc6c40..99ef5f44f 100644 --- a/roles/tobiko-ensure-python3/tasks/install.yaml +++ b/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" diff --git a/roles/tobiko-tox/defaults/main.yaml b/roles/tobiko-tox/defaults/main.yaml index 1cafd17f3..f11fdb092 100644 --- a/roles/tobiko-tox/defaults/main.yaml +++ b/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 diff --git a/roles/tobiko-tox/tasks/tox.yaml b/roles/tobiko-tox/tasks/tox.yaml index ce136f0e1..3dca56752 100644 --- a/roles/tobiko-tox/tasks/tox.yaml +++ b/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: diff --git a/tools/install.py b/tools/install.py index 5f77f15dd..5d5a7fe8c 100755 --- a/tools/install.py +++ b/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(): diff --git a/tox.ini b/tox.ini index 56ed537a9..ba61c569d 100644 --- a/tox.ini +++ b/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} diff --git a/upper-constraints.txt b/upper-constraints.txt new file mode 100644 index 000000000..4777bc52d --- /dev/null +++ b/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 diff --git a/zuul.d/infrared.yaml b/zuul.d/infrared.yaml index 8dc952247..842c5b52d 100644 --- a/zuul.d/infrared.yaml +++ b/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' diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index b118f9758..7a20d00f0 100644 --- a/zuul.d/project.yaml +++ b/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 diff --git a/zuul.d/tripleo.yaml b/zuul.d/tripleo.yaml index abd9c5533..cf4446d96 100644 --- a/zuul.d/tripleo.yaml +++ b/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