diff --git a/tests/deployment/test_deploy_cli.py b/tests/deployment/test_deploy_cli.py index 3b3f95d..fa01f8e 100644 --- a/tests/deployment/test_deploy_cli.py +++ b/tests/deployment/test_deploy_cli.py @@ -47,7 +47,7 @@ def test_deploy_cli_main(backend, db_conn, deploy_params): args_list.append("--no-use-ssl-cert-validation") runner = CliRunner() - result = runner.invoke(deploy_cli.main, args_list) + result = runner.invoke(deploy_cli.main, args_list, catch_exceptions=False) assert result.exit_code == 0 all_schemas = get_all_schemas(db_conn) diff --git a/tests/deployment/test_deploy_create_statements.py b/tests/deployment/test_deploy_create_statements.py index 6ee21ea..8c2dc16 100644 --- a/tests/deployment/test_deploy_create_statements.py +++ b/tests/deployment/test_deploy_create_statements.py @@ -1,4 +1,5 @@ import pytest +import exasol.bucketfs as bfs from exasol_sagemaker_extension.deployment.deploy_create_statements import \ DeployCreateStatements @@ -28,10 +29,10 @@ def get_all_scripts(db_conn): @pytest.mark.slow -def test_deploy_create_statements(db_conn, deploy_params): +def test_deploy_create_statements(backend, db_conn, deploy_params): # We validate the server certificate in SaaS, but not in the Docker DB - cert_validation = "saas_url" in deploy_params + cert_validation = backend == bfs.path.StorageBackend.saas DeployCreateStatements.create_and_run(**deploy_params, schema=DB_SCHEMA, use_ssl_cert_validation=cert_validation) diff --git a/tests/fixtures/database_connection_fixture.py b/tests/fixtures/database_connection_fixture.py index 7062f7e..178f146 100644 --- a/tests/fixtures/database_connection_fixture.py +++ b/tests/fixtures/database_connection_fixture.py @@ -33,7 +33,7 @@ def _open_pyexasol_connection(**kwargs) -> pyexasol.ExaConnection: compression=True) -@pytest.fixture(scope='session', params=[bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.saas]) +@pytest.fixture(scope='session', params=[bfs.path.StorageBackend.saas]) def backend(request) -> bfs.path.StorageBackend: # Here we are going to add # pytest.skip() diff --git a/tests/fixtures/prepare_environment_fixture.py b/tests/fixtures/prepare_environment_fixture.py index 8606be3..4ef98e6 100644 --- a/tests/fixtures/prepare_environment_fixture.py +++ b/tests/fixtures/prepare_environment_fixture.py @@ -9,11 +9,10 @@ import pyexasol import exasol.bucketfs as bfs import pytest -from click.testing import CliRunner -from exasol_sagemaker_extension.deployment import deploy_cli +from exasol_sagemaker_extension.deployment.deploy_create_statements import DeployCreateStatements from tests.ci_tests.utils.parameters import ( - get_arg_list, reg_model_setup_params, cls_model_setup_params) + reg_model_setup_params, cls_model_setup_params) def _open_schema(db_conn: pyexasol.ExaConnection, model_setup): @@ -23,14 +22,9 @@ def _open_schema(db_conn: pyexasol.ExaConnection, model_setup): def _deploy_scripts(backend: bfs.path.StorageBackend, deploy_params: dict[str, Any], schema: str): - args_list = get_arg_list(**deploy_params, schema=schema) - if backend == bfs.path.StorageBackend.saas: - args_list.append("--use-ssl-cert-validation") - else: - args_list.append("--no-use-ssl-cert-validation") - - runner = CliRunner() - runner.invoke(deploy_cli.main, args_list) + cert_validation = backend == bfs.path.StorageBackend.saas + DeployCreateStatements.create_and_run(**deploy_params, schema=schema, + use_ssl_cert_validation=cert_validation) def _create_tables(db_conn, model_setup):