Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test metrics hierarchies #893

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading