Skip to content

Commit

Permalink
Merge pull request #893 from mastastny/fix_test_metrics_hierarchies
Browse files Browse the repository at this point in the history
Fix test metrics hierarchies
  • Loading branch information
dhlavac authored Dec 2, 2024
2 parents 9fa6c32 + 4d163e2 commit 8b39dd3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions testsuite/tests/ui/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import pytest_html
from auth0.management import auth0
from selenium.common import InvalidSessionIdException, WebDriverException
from threescale_api.errors import ApiClientError
from threescale_api.resources import Account, ApplicationPlan, Service
from PIL import Image

Expand Down Expand Up @@ -252,7 +253,11 @@ def _custom_ui_backend(name: str, system_name: str, description: str = "", endpo
backend.create(name, system_name, description, endpoint)
backend = resilient.resource_read_by_name(threescale.backends, system_name)
if autoclean and not testconfig["skip_cleanup"]:
request.addfinalizer(backend.delete)

@backoff.on_exception(backoff.fibo, ApiClientError, max_tries=3, jitter=None)
def finalizer():
backend.delete()

return backend

return _custom_ui_backend
Expand All @@ -265,8 +270,9 @@ def ui_backend(custom_ui_backend, request):
return custom_ui_backend(name, name)


# custom_ui_backend dependency forces delete product first (backend cannot be deleted when is used by some product)
@pytest.fixture(scope="module")
def custom_ui_product(custom_admin_login, navigator, threescale, testconfig, request):
def custom_ui_product(custom_admin_login, navigator, threescale, testconfig, request, custom_ui_backend):
"""Parametrized custom Product created via UI"""

def _custom_ui_product(name: str, system_name: str, description: str = "", autoclean=True):
Expand Down

0 comments on commit 8b39dd3

Please sign in to comment.