diff --git a/extra-requirements.txt b/extra-requirements.txt index 59339e08f..2f508340f 100644 --- a/extra-requirements.txt +++ b/extra-requirements.txt @@ -1,3 +1,2 @@ pandas # BSD -python-openstackclient # APACHE-2.0 validations-libs # APACHE-2.0 diff --git a/lower-constraints.txt b/lower-constraints.txt index a1341b8cd..53a1b0bd9 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -1,27 +1,22 @@ # Tobiko framework requirements -coverage==5.3.0 -docker==4.4.0 +docker==4.4.1 fixtures==3.0.0 -keystoneauth1==4.3.0 Jinja2==2.11.2 -junitxml==0.7.0 -mock==3.0.5 +keystoneauth1==4.3.0 netaddr==0.8.0 neutron-lib==2.7.0 -os-testr==2.0.0 oslo.config==8.4.0 oslo.log==4.4.0 paramiko==2.7.2 pbr==5.5.1 podman==1.6.0 -python-heatclient==2.3.0 python-glanceclient==3.2.2 +python-heatclient==2.3.0 python-neutronclient==7.2.1 python-novaclient==17.2.1 python-octaviaclient==2.2.0 python-openstackclient==5.4.0 -python-subunit==1.4.0 six==1.15.0 sshtunnel==0.3.1 stestr==3.1.0 diff --git a/requirements.txt b/requirements.txt index d7ad7d507..86472ec29 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,8 @@ # Tobiko framework requirements -docker>=4.4.0 # Apache-2.0 +docker>=4.4.1 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD Jinja2>=2.11.2 # BSD -junitxml>=0.7.0 # MIT keystoneauth1>=4.3.0 # Apache-2.0 netaddr>=0.8.0 # BSD neutron-lib>=2.7.0 # Apache-2.0 diff --git a/roles/tobiko-run/vars/test-workflow-gate.yaml b/roles/tobiko-run/vars/test-workflow-gate.yaml index 827e6116e..b54e71256 100644 --- a/roles/tobiko-run/vars/test-workflow-gate.yaml +++ b/roles/tobiko-run/vars/test-workflow-gate.yaml @@ -4,21 +4,32 @@ test_workflow_steps: - tox_description: 'run unit test cases' tox_envlist: py3 tox_step_name: unit + tox_environment: + TOX_RERUNS: 0 - tox_description: 'run functional test cases' tox_envlist: functional tox_step_name: functional + tox_environment: + TOX_RERUNS: 2 + TOX_RERUNS_DELAY: 60 - tox_description: 'create workload resources' tox_envlist: scenario tox_step_name: create_resources + tox_environment: + TOX_RERUNS: 2 + TOX_RERUNS_DELAY: 60 # - tox_description: 'run disruptive test cases' # tox_envlist: faults # tox_step_name: faults +# tox_environment: +# TOX_RERUNS: 0 - tox_description: 'verify workload resources' tox_envlist: scenario tox_step_name: verify_resources tox_environment: TOBIKO_PREVENT_CREATE: yes + TOX_RERUNS: 0 diff --git a/test-requirements.txt b/test-requirements.txt index a46e3eebf..fb9a558ef 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,4 +6,5 @@ mock>=2.0.0 # BSD psutil>=5.7.2 # BSD pytest>=6.0.0 # MIT pytest-html>=3.0.0 # MPL-2.0 +pytest-rerunfailures>=9.0.0 # MPL-2.0 pytest-xdist[psutil]>=2.0.0 # MIT diff --git a/tools/run_tests.py b/tools/run_tests.py index e9f69c54a..456c6998b 100755 --- a/tools/run_tests.py +++ b/tools/run_tests.py @@ -51,6 +51,10 @@ TOX_NUM_PROCESSES = os.environ.get('TOX_NUM_PROCESSES') or 'auto' TOX_RUN_TESTS_TIMEOUT = float(os.environ.get('TOX_RUN_TESTS_TIMEOUT') or 0.) +TOX_RERUNS = int(os.environ.get('TOX_RERUNS') or 0) +TOX_RERUNS_DELAY = int(os.environ.get('TOX_RERUNS_DELAY') or 5) + + TOX_PYDEV_DEBUG = bool( os.environ.get('TOX_PYDEV_DEBUG', 'false').lower() in ['true', 'yes', '1']) @@ -142,9 +146,13 @@ def debug_test_cases(): def run_test_cases(): xdist_options = '' if TOX_NUM_PROCESSES != '1': - xdist_options = f"--numprocesses {TOX_NUM_PROCESSES} --dist loadscope" + xdist_options = f"--numprocesses '{TOX_NUM_PROCESSES}' --dist loadscope" + rerun_options = '' + if TOX_RERUNS: + rerun_options = f"--reruns '{TOX_RERUNS}' --reruns-delay '{TOX_RERUNS_DELAY}'" common.execute(f"pytest " f"{xdist_options} " + f"{rerun_options} " f"--junitxml={TOX_REPORT_XML} " f"--html={TOX_REPORT_HTML} --self-contained-html " f"{common.get_posargs()}",