Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions e2e-tests/src/project_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def run_common_interactive_flow(
child_answer(child, r"What type of datasource do you want to add\?", database.datasource_type)
child_answer(child, r"Datasource name\?:", database.datasource_name)

child_answer(child, r"profiling\.enabled\?", "")
if isinstance(database, SnowflakeDB):
(child_answer_safe(child, r"connection\.account\?:", database.account),)
child_answer(child, r"connection\.warehouse\? \(Optional\):", database.warehouse)
Expand Down
12 changes: 9 additions & 3 deletions e2e-tests/src/utils/pexpect_utils.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
import allure
from pexpect import spawn
from pexpect import TIMEOUT, spawn
from pexpect.popen_spawn import PopenSpawn


@allure.step("Answering prompt '{pattern}' with '{value}'")
def child_answer(child: PopenSpawn | spawn, pattern: str, value: str | None) -> None:
child.expect(pattern)
try:
child.expect(pattern)
except TIMEOUT as e:
raise AssertionError(f"Timed out while waiting for a prompt with the pattern {pattern}") from e
child.sendline("" if value is None else str(value))


@allure.step("Answering sensitive prompt '{pattern}'")
def child_answer_safe(child: PopenSpawn | spawn, pattern: str, value: str | None) -> None:
child.expect(pattern)
try:
child.expect(pattern)
except TIMEOUT as e:
raise AssertionError(f"Timed out while waiting for a prompt with the pattern {pattern}") from e
send_secret(child, "" if value is None else str(value))


Expand Down
Loading