From 2945010168e9277baf52ab1db44d49b8157253ee Mon Sep 17 00:00:00 2001 From: Eduardo Olivares Date: Thu, 11 Apr 2024 12:25:59 +0200 Subject: [PATCH] Fix ovn_migration and ovn_migration_sanity testenvs For some reason, an env variable's (RUN_TESTS_EXTRA_ARGS) default value was not properly overwritten on these testenvs. Its default value has been removed, since it's not relevant for other testenvs. Besides this, the marker skip_during_ovn_migration has been added to the test test_equal_containers_state because it should not be executed after ovn-migration (list of containers changes, so comparison between previous and new containers is not relevant). Also, the background ping test will be skipped for ovn_migration and ovn_migration_sanity testenvs because the may be traffic loss during the migration process. Change-Id: I71de87e5216ac2d6c7e198ea6236fe189b79408d --- pytest.ini | 1 + tobiko/tests/sanity/containers/test_containers.py | 2 ++ tox.ini | 12 ++++++++---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pytest.ini b/pytest.ini index 965a29277..4dce5efdb 100644 --- a/pytest.ini +++ b/pytest.ini @@ -5,6 +5,7 @@ markers = ovn_migration: test cases for testing OVN migration minimal: most relevant and lightweight test cases skip_during_ovn_migration: test cases which shouldn't be run in the OVS to OVN migration jobs + background: test traffic loss using a background process sending pings to a VM instance # rp_uuid = 887ab577-b89e-4b12-9d8f-03f7a0a5b14a diff --git a/tobiko/tests/sanity/containers/test_containers.py b/tobiko/tests/sanity/containers/test_containers.py index 3fad4fa4b..573184492 100644 --- a/tobiko/tests/sanity/containers/test_containers.py +++ b/tobiko/tests/sanity/containers/test_containers.py @@ -22,6 +22,7 @@ import time import testtools from oslo_log import log import pandas +import pytest import tobiko from tobiko.openstack import neutron @@ -207,6 +208,7 @@ class TripleoContainersHealthTest(BaseContainersHealtTest): def test_ovn_containers_running(self): tripleo_containers.assert_ovn_containers_running() + @pytest.mark.skip_during_ovn_migration def test_equal_containers_state(self, expected_containers_list=None, timeout=120, interval=5, recreate_expected=False): diff --git a/tox.ini b/tox.ini index f113bbf0c..38f3af375 100644 --- a/tox.ini +++ b/tox.ini @@ -26,9 +26,9 @@ setenv = OS_STDOUT_CAPTURE = {env:OS_STDOUT_CAPTURE:true} OS_STDERR_CAPTURE = {env:OS_STDERR_CAPTURE:true} OS_TEST_PATH = {toxinidir}/tobiko/tests/unit + TOBIKO_TEST_PATH = {env:OS_TEST_PATH} PYTEST_TIMEOUT = {env:PYTEST_TIMEOUT:300} PYTHONWARNINGS = ignore::Warning,{env:PYTHONWARNINGS:} - RUN_TESTS_EXTRA_ARGS = {env:OS_TEST_PATH} TOBIKO_PREVENT_CREATE = {env:TOBIKO_PREVENT_CREATE:false} TOX_COVER = {env:TOX_COVER:false} TOX_COVER_DIR = {env:TOX_COVER_DIR:{toxinidir}/cover} @@ -39,7 +39,7 @@ setenv = TOX_EXTRA_REQUIREMENTS = {env:TOX_EXTRA_REQUIREMENTS:-r{toxinidir}/extra-requirements.txt} VIRTUAL_ENV = {envdir} commands = - {envpython} {toxinidir}/tools/run_tests.py {posargs:{env:RUN_TESTS_EXTRA_ARGS}} + {envpython} {toxinidir}/tools/run_tests.py {posargs:{env:TOBIKO_TEST_PATH}} [testenv:py3] @@ -230,7 +230,9 @@ passenv = {[integration]passenv} setenv = {[testenv:scenario]setenv} OS_TEST_PATH = {toxinidir}/tobiko/tests/scenario - RUN_TESTS_EXTRA_ARGS = -m "not skip_during_ovn_migration and not flaky" {env:OS_TEST_PATH} + RUN_TESTS_EXTRA_ARGS = -m "not skip_during_ovn_migration and not background and not flaky" +commands = + {envpython} {toxinidir}/tools/run_tests.py {env:RUN_TESTS_EXTRA_ARGS} {posargs:{env:TOBIKO_TEST_PATH}} [testenv:nova] @@ -269,7 +271,9 @@ envdir = {[integration]envdir} passenv = {[integration]passenv} setenv = {[testenv:sanity]setenv} - RUN_TESTS_EXTRA_ARGS = -m "ovn_migration and not skip_during_ovn_migration and not flaky" {env:OS_TEST_PATH} + RUN_TESTS_EXTRA_ARGS = -m "ovn_migration and not skip_during_ovn_migration and not background and not flaky" +commands = + {envpython} {toxinidir}/tools/run_tests.py {env:RUN_TESTS_EXTRA_ARGS} {posargs:{env:TOBIKO_TEST_PATH}} [testenv:shiftstack_sanity]