From f421247c73e78d32e0cad9e57ce021720eeac5fb Mon Sep 17 00:00:00 2001 From: Shylesh Kumar Mohan Date: Wed, 18 Dec 2024 22:08:53 +0530 Subject: [PATCH] Handle default values for DR params in test function for non-DR cases Signed-off-by: Shylesh Kumar Mohan --- tests/conftest.py | 14 +++++++------- tests/functional/upgrade/test_upgrade.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 28ead9fa528..9ed529f1a5b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -525,13 +525,13 @@ def pytest_collection_modifyitems(session, config, items): log.info( f"MARKERS = {[(i.name, i.args, i.kwargs) for i in item.iter_markers()]}" ) - # Update PREUPGRADE_CONFIG for each of the Config class - # so that in case of Y stream upgrade we will have preupgrade configurations for reference - # across the tests as Y stream upgrade will reload the config of target version - for cluster in ocsci_config.clusters: - for k in cluster.__dataclass_fields__.keys(): - if k != "PREUPGRADE_CONFIG": - cluster.PREUPGRADE_CONFIG[k] = deepcopy(getattr(cluster, k)) + # Update PREUPGRADE_CONFIG for each of the Config class + # so that in case of Y stream upgrade we will have preupgrade configurations for reference + # across the tests as Y stream upgrade will reload the config of target version + for cluster in ocsci_config.clusters: + for k in cluster.__dataclass_fields__.keys(): + if k != "PREUPGRADE_CONFIG": + cluster.PREUPGRADE_CONFIG[k] = deepcopy(getattr(cluster, k)) def pytest_collection_finish(session): diff --git a/tests/functional/upgrade/test_upgrade.py b/tests/functional/upgrade/test_upgrade.py index 07d9158e518..d2a0dc0706a 100644 --- a/tests/functional/upgrade/test_upgrade.py +++ b/tests/functional/upgrade/test_upgrade.py @@ -91,7 +91,7 @@ def test_osd_reboot(teardown, upgrade_stats): @ocs_upgrade @polarion_id(get_polarion_id(upgrade=True)) @multicluster_roles(["mdr-all-odf"]) -def test_upgrade(zone_rank, role_rank, config_index, upgrade_stats): +def test_upgrade(zone_rank=None, role_rank=None, config_index=None, upgrade_stats=None): """ Tests upgrade procedure of OCS cluster