Skip to content

Commit 3ade919

Browse files
committed
test(e2e): add RHIdentity feature tag handling
Register @RHIdentity tag in before_feature and after_feature hooks to switch configuration to rh-identity auth mode during feature execution and restore the original configuration afterwards. Signed-off-by: Major Hayden <major@redhat.com>
1 parent 2e2c3b5 commit 3ade919

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/e2e/features/environment.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,15 @@ def before_feature(context: Context, feature: Feature) -> None:
251251
switch_config(context.feature_config)
252252
restart_container("lightspeed-stack")
253253

254+
if "RHIdentity" in feature.tags:
255+
mode_dir = "library-mode" if context.is_library_mode else "server-mode"
256+
context.feature_config = (
257+
f"tests/e2e/configuration/{mode_dir}/lightspeed-stack-auth-rh-identity.yaml"
258+
)
259+
context.default_config_backup = create_config_backup("lightspeed-stack.yaml")
260+
switch_config(context.feature_config)
261+
restart_container("lightspeed-stack")
262+
254263
if "Feedback" in feature.tags:
255264
context.hostname = os.getenv("E2E_LSC_HOSTNAME", "localhost")
256265
context.port = os.getenv("E2E_LSC_PORT", "8080")
@@ -273,6 +282,11 @@ def after_feature(context: Context, feature: Feature) -> None:
273282
restart_container("lightspeed-stack")
274283
remove_config_backup(context.default_config_backup)
275284

285+
if "RHIdentity" in feature.tags:
286+
switch_config(context.default_config_backup)
287+
restart_container("lightspeed-stack")
288+
remove_config_backup(context.default_config_backup)
289+
276290
if "Feedback" in feature.tags:
277291
for conversation_id in context.feedback_conversations:
278292
url = f"http://{context.hostname}:{context.port}/v1/conversations/{conversation_id}"

0 commit comments

Comments
 (0)