forked from Kuadrant/testsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Kuadrant#364 from pehala/session_gw
Make gateway fixture session scope
- Loading branch information
Showing
17 changed files
with
111 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
"""Conftest for all tests requiring direct access to Authorino Operator""" | ||
|
||
import pytest | ||
|
||
from testsuite.gateway.envoy import Envoy | ||
from testsuite.openshift.authorino import AuthorinoCR, Authorino | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def gateway(request, authorino, openshift, blame, label, testconfig) -> Envoy: | ||
"""Deploys Envoy that wires up the Backend behind the reverse-proxy and Authorino instance""" | ||
gw = Envoy( | ||
openshift, | ||
blame("gw"), | ||
authorino, | ||
testconfig["service_protection"]["envoy"]["image"], | ||
labels={"app": label}, | ||
) | ||
request.addfinalizer(gw.delete) | ||
gw.commit() | ||
gw.wait_for_ready(timeout=10 * 60) | ||
return gw | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def authorino_parameters(): | ||
"""Optional parameters for Authorino creation, passed to the __init__""" | ||
return {} | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def authorino(openshift, blame, request, testconfig, label, authorino_parameters) -> Authorino: | ||
"""Module scoped Authorino instance, with specific parameters""" | ||
authorino_config = testconfig["service_protection"]["authorino"] | ||
if not authorino_config["deploy"]: | ||
return pytest.skip("Can't change parameters of already deployed Authorino") | ||
|
||
labels = authorino_parameters.setdefault("label_selectors", []) | ||
labels.append(f"testRun={label}") | ||
|
||
authorino_parameters.setdefault("name", blame("authorino")) | ||
|
||
authorino = AuthorinoCR.create_instance( | ||
openshift, | ||
image=authorino_config.get("image"), | ||
log_level=authorino_config.get("log_level"), | ||
**authorino_parameters, | ||
) | ||
request.addfinalizer(authorino.delete) | ||
authorino.commit() | ||
authorino.wait_for_ready() | ||
return authorino |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters