Skip to content

Commit

Permalink
Fixed yaml test runner
Browse files Browse the repository at this point in the history
Signed-off-by: saimedhi <[email protected]>
  • Loading branch information
saimedhi committed Mar 15, 2024
1 parent d36a882 commit 2f1c3a5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test_opensearchpy/test_server/test_rest_api_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,13 @@ def __init__(self, client: Any) -> None:
self._setup_code: Any = None
self._teardown_code: Any = None
self._state: Any = {}
self._test_id: Any = None

def use_spec(self, test_spec: Any) -> None:
self._setup_code = test_spec.pop("setup", None)
self._run_code = test_spec.pop("run", None)
self._teardown_code = test_spec.pop("teardown", None)
self._test_id = test_spec.pop("test_id", None)

def setup(self) -> Any:
"""Pull skips from individual tests to not do unnecessary setup."""
Expand Down Expand Up @@ -417,7 +419,7 @@ def _resolve(self, value: Any) -> Any:
value = value.replace(key_replace, v)
break

if isinstance(value, string_types):
if (isinstance(value, string_types) and "cat" in self._test_id):
value = value.strip()
elif isinstance(value, dict):
value = dict((k, self._resolve(v)) for (k, v) in value.items())
Expand Down Expand Up @@ -528,6 +530,7 @@ def load_rest_api_tests() -> None:
"setup": setup_steps,
"run": test_step,
"teardown": teardown_steps,
"test_id": pytest_param_id,
}
# Skip either 'test_name' or 'test_name[x]'
if pytest_test_name in SKIP_TESTS or pytest_param_id in SKIP_TESTS:
Expand Down

0 comments on commit 2f1c3a5

Please sign in to comment.