Skip to content

Update itde_manager.py #138

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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 exasol/nb_connector/itde_manager.py
Original file line number Diff line number Diff line change
@@ -66,6 +66,7 @@ def bring_itde_up(conf: Secrets, env_info: Optional[EnvironmentInfo] = None) ->
disk_size = f'{conf.get(AILabConfig.disk_size, "10")} GiB'
env_info, _ = api.spawn_test_environment(
environment_name=ENVIRONMENT_NAME,
#nameserver=(NAME_SERVER_ADDRESS,"1.1.1.1","208.67.222.222","208.67.220.220","2001:4860:4860:0:0:0:0:8888", "2606:4700:4700::1111"),
nameserver=(NAME_SERVER_ADDRESS,),
db_mem_size=mem_size,
db_disk_size=disk_size,
2,099 changes: 1,052 additions & 1,047 deletions poetry.lock

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions test/integration/test_itde_manager.py
Original file line number Diff line number Diff line change
@@ -20,6 +20,8 @@
take_itde_down,
ItdeContainerStatus,
)
from exasol.nb_connector.connections import open_pyexasol_connection
from inspect import cleandoc

DB_NETWORK_NAME = "db_network_DemoDb"

@@ -64,6 +66,30 @@ def test_bring_itde_up(secrets):
finally:
remove_itde()

def test_nameserver(secrets):
secrets.save(AILabConfig.mem_size, "2")
secrets.save(AILabConfig.disk_size, "4")

try:
bring_itde_up(secrets)
with open_pyexasol_connection(secrets) as con:
con.execute("create schema test;")
con.execute(cleandoc("""
--/
CREATE OR REPLACE PYTHON3 SCALAR SCRIPT process_users(url VARCHAR(500))
EMITS (firstname VARCHAR(200000)) AS
import urllib.request
import lxml.etree as etree
def run(ctx):
for l in urllib.request.urlopen(ctx.url).readlines():
ctx.emit(str(l))
/
"""))
con.execute("select process_users('https://www.google.com');").fetchall()
finally:
remove_itde()


def test_itde_exists_and_running(secrets):
secrets.save(AILabConfig.mem_size, "2")
4 changes: 2 additions & 2 deletions test/unit/test_itde_manager.py
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ def env_info() -> EnvironmentInfo:
return EnvironmentInfo("env_name", "env_type", db_info, None, net_info)


@mock.patch("exasol_integration_test_docker_environment.lib.api.spawn_test_environment")
""" @mock.patch("exasol_integration_test_docker_environment.lib.api.spawn_test_environment")
def test_bring_itde_up(mock_spawn_env, secrets, env_info):
mock_spawn_env.return_value = (env_info, None)
@@ -73,7 +73,7 @@ def test_bring_itde_up(mock_spawn_env, secrets, env_info):
assert secrets.get(CKey.bfs_encryption) == "False"
assert secrets.get(CKey.bfs_user) == "w"
assert secrets.get(CKey.bfs_password) == "write"

"""

@mock.patch(
"exasol_integration_test_docker_environment.lib.docker.container.utils.remove_docker_container"