Skip to content

Commit

Permalink
Add sanity check tests for the docker setup to the notebook tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tkilias committed Jan 29, 2024
1 parent dedf48d commit c1fee21
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 212 deletions.
5 changes: 4 additions & 1 deletion test/integration/test_notebooks_in_dss_docker_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@ def test_notebook(notebook_test_container, notebook_test_file):
command_echo_virtual_env = 'bash -c "echo $VIRTUAL_ENV"'
virtual_env = exec_command(command_echo_virtual_env, container)
command_run_test = f'{virtual_env}/bin/python -m pytest --setup-show -s {notebook_test_file}'
exec_command(command_run_test, container, print_output=True, environment=os.environ)
environ = os.environ.copy()
environ["NBTEST_ACTIVE"] = "TRUE"
nbtest_environ = {key: value for key, value in environ if key.startswith("NBTEST_")}
exec_command(command_run_test, container, print_output=True, environment=nbtest_environ)
9 changes: 9 additions & 0 deletions test/notebooks/nbtest_environment_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import os


def test_assert_working_directory():
assert os.getcwd() == os.environ["NOTEBOOK_FOLDER_INITIAL"]


def test_assert_environ_nbtest_active():
assert os.environ["NBTEST_ACTIVE"] == "TRUE"
22 changes: 22 additions & 0 deletions test/notebooks/nbtest_itde.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from exasol.secret_store import Secrets
from exasol.itde_manager import (
bring_itde_up,
take_itde_down
)
from exasol.connections import open_pyexasol_connection

def test_itde(tmp_path):
store_path = tmp_path / 'tmp_config.sqlite'
store_password = "password"
secrets = Secrets(store_path, master_password=store_password)
bring_itde_up(secrets)
try:
con = open_pyexasol_connection(secrets)
try:
result = con.execute("select 1").fetchmany()
assert result[0][0] == 1
finally:
con.close()
finally:
take_itde_down(secrets)

7 changes: 0 additions & 7 deletions test/notebooks/nbtest_links.py

This file was deleted.

18 changes: 0 additions & 18 deletions test/notebooks/nbtest_sklearn.py

This file was deleted.

186 changes: 0 additions & 186 deletions test/notebooks/notebook_test_utils.py

This file was deleted.

0 comments on commit c1fee21

Please sign in to comment.