Skip to content

Commit 4217db5

Browse files
authored
Add support to reuse tests in upgrade and install scenarios (#697)
1 parent 6ca7af8 commit 4217db5

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,17 @@ def _add_upgrade_test(_item: Item, _upgrade_deployment_modes: list[str]) -> bool
244244
_item=item, _upgrade_deployment_modes=upgrade_deployment_modes
245245
):
246246
pre_upgrade_tests.append(item)
247+
# Add support to be able to reuse tests in both upgrade and fresh install scenarios
248+
if "install" in item.keywords:
249+
non_upgrade_tests.append(item)
247250

248251
elif "post_upgrade" in item.keywords and _add_upgrade_test(
249252
_item=item, _upgrade_deployment_modes=upgrade_deployment_modes
250253
):
251254
post_upgrade_tests.append(item)
255+
# Add support to be able to reuse tests in both upgrade and fresh install scenarios
256+
if "install" in item.keywords:
257+
non_upgrade_tests.append(item)
252258

253259
else:
254260
non_upgrade_tests.append(item)

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ markers =
2222
downstream_only: Tests that are specific to downstream
2323
cluster_health: Tests that verifies that cluster is healthy to begin testing
2424
skip_must_gather: Tests that does not require must-gather for triaging
25+
install: Tests that are relevant for install scenario. To be used with upgrade marker, to indicate tests that are valid for both install and upgrade
2526

2627
# Model server
2728
modelmesh: Mark tests which are model mesh tests

tests/model_registry/model_catalog/test_default_model_catalog.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ def test_config_map_exists(self: Self, model_catalog_config_map: ConfigMap):
7777
),
7878
],
7979
)
80+
@pytest.mark.post_upgrade
81+
@pytest.mark.install
8082
def test_model_catalog_resources_exists(
8183
self: Self, admin_client: DynamicClient, model_registry_namespace: str, resource_name: Any
8284
):

0 commit comments

Comments
 (0)