Skip to content

Commit 788bf22

Browse files
authored
fix: call updated_global_config early in the flow (#192)
* Create size-labeler.yml * Delete .github/workflows/size-labeler.yml * model mesh - add auth tests * xx * fix: call updated_global_config early in the flow
1 parent f755739 commit 788bf22

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

conftest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,9 @@ def pytest_fixture_setup(fixturedef: FixtureDef[Any], request: FixtureRequest) -
211211
def pytest_runtest_setup(item: Item) -> None:
212212
"""
213213
Performs the following actions:
214-
1. Adds skip fixture for kserve if serverless or authorino operators are not installed.
215-
2. Adds skip fixture for serverless if authorino/serverless/service mesh are not deployed.
214+
1. Updates global config (`updated_global_config`)
215+
2. Adds skip fixture for kserve if serverless or authorino operators are not installed.
216+
3. Adds skip fixture for serverless if authorino/serverless/service mesh are not deployed.
216217
"""
217218

218219
BASIC_LOGGER.info(f"\n{separator(symbol_='-', val=item.name)}")
@@ -230,6 +231,9 @@ def pytest_runtest_setup(item: Item) -> None:
230231
elif KServeDeploymentType.MODEL_MESH.lower() in item.keywords:
231232
item.fixturenames.insert(0, "enabled_modelmesh_in_dsc")
232233

234+
# The above fixtures require the global config to be updated before being called
235+
item.fixturenames.insert(0, "updated_global_config")
236+
233237

234238
def pytest_runtest_call(item: Item) -> None:
235239
BASIC_LOGGER.info(f"{separator(symbol_='-', val='CALL')}")

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def tests_tmp_dir(request: FixtureRequest, tmp_path_factory: TempPathFactory) ->
5151
shutil.rmtree(path=str(tests_tmp_path), ignore_errors=True)
5252

5353

54-
@pytest.fixture(scope="session", autouse=True)
54+
@pytest.fixture(scope="session")
5555
def updated_global_config(request: FixtureRequest, admin_client: DynamicClient) -> None:
5656
if get_operator_distribution(client=admin_client) == "Open Data Hub":
5757
py_config["distribution"] = "upstream"

0 commit comments

Comments
 (0)