Skip to content

Commit ef7abe3

Browse files
committed
move cache_admin_client in conftest to avoid ci failures when no cluster is available
1 parent f9c330d commit ef7abe3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

conftest.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -786,10 +786,10 @@ def _update_os_related_config():
786786

787787
py_config[key] = items_list
788788
config_default_storage_class(session=session)
789-
admin_client = utilities.cluster.cache_admin_client()
790789
# Set py_config["servers"] and py_config["os_login_param"]
791790
# Send --tc=server_url:<url> to override servers URL
792791
if not skip_if_pytest_flags_exists(pytest_config=session.config):
792+
admin_client = utilities.cluster.cache_admin_client()
793793
py_config["version_explorer_url"] = get_cnv_version_explorer_url(pytest_config=session.config)
794794
if not session.config.getoption("--skip-artifactory-check"):
795795
py_config["server_url"] = py_config["server_url"] or get_artifactory_server_url(
@@ -800,8 +800,7 @@ def _update_os_related_config():
800800
}
801801
py_config["os_login_param"] = get_cnv_tests_secret_by_name(secret_name="os_login")
802802

803-
# must be at the end to make sure we create it only after all pytest_sessionstart checks pass.
804-
if not skip_if_pytest_flags_exists(pytest_config=session.config):
803+
# must be at the end to make sure we create it only after all pytest_sessionstart checks pass.
805804
stop_if_run_in_progress(client=admin_client)
806805
deploy_run_in_progress_namespace(client=admin_client)
807806
deploy_run_in_progress_config_map(client=admin_client, session=session)

0 commit comments

Comments
 (0)