Skip to content

Commit

Permalink
#70 Fixed the slc cli integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsimb committed Oct 3, 2024
1 parent 541d9c6 commit a6b49e6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from enum import Enum
from pathlib import Path
import click
import warnings
from exasol.python_extension_common.deployment.language_container_deployer import LanguageContainerDeployer


Expand Down Expand Up @@ -183,6 +184,12 @@ def language_container_deployer_main(
wait_for_completion: bool,
container_url: Optional[str] = None,
container_name: Optional[str] = None):
warnings.warn(
"language_container_deployer_main() function is deprecated and will be removed "
"in a future version. For CLI use the LanguageContainerDeployerCli class instead.",
DeprecationWarning,
stacklevel=2
)

deployer = LanguageContainerDeployer.create(
bucketfs_name=bucketfs_name,
Expand Down
29 changes: 22 additions & 7 deletions test/integration/cli/test_language_container_deployer_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
open_pyexasol_connection)
from exasol.python_extension_common.cli.language_container_deployer_cli import (
LanguageContainerDeployerCli)
from test.utils.db_utils import (assert_udf_running, open_schema)
from test.utils.db_utils import (assert_udf_running, create_schema)

CONTAINER_URL_ARG = 'container_url'
CONTAINER_NAME_ARG = 'container_name'


@pytest.fixture
def onprem_params(exasol_config,
@pytest.fixture(scope='session')
def onprem_params(backend_aware_onprem_database,
exasol_config,
bucketfs_config,
language_alias) -> dict[str, Any]:

Expand All @@ -40,12 +41,27 @@ def onprem_params(exasol_config,
}


@pytest.fixture(scope='session')
def saas_params(saas_host,
saas_pat,
saas_account_id,
backend_aware_saas_database_id,
language_alias) -> dict[str, Any]:
return {
StdParams.saas_url.name: saas_host,
StdParams.saas_account_id.name: saas_account_id,
StdParams.saas_database_id.name: backend_aware_saas_database_id,
StdParams.saas_token.name: saas_pat,
StdParams.path_in_bucket.name: 'container',
StdParams.language_alias.name: language_alias
}


def make_args_string(**kwargs) -> str:
return ' '.join(f'--{k} "{v}"' for k, v in kwargs.items())


def test_slc_deployer_cli_onprem_url(use_onprem,
backend_aware_onprem_database,
container_version,
container_name,
container_url_formatter,
Expand Down Expand Up @@ -73,12 +89,11 @@ def test_slc_deployer_cli_onprem_url(use_onprem,
runner.invoke(cmd, args=args)

with open_pyexasol_connection(**onprem_params) as conn:
open_schema(conn, db_schema)
create_schema(conn, db_schema)
assert_udf_running(conn, language_alias, db_schema)


def test_slc_deployer_cli_onprem_file(use_onprem,
backend_aware_onprem_database,
container_path,
language_alias,
db_schema,
Expand All @@ -97,5 +112,5 @@ def test_slc_deployer_cli_onprem_file(use_onprem,
runner.invoke(cmd, args=args)

with open_pyexasol_connection(**onprem_params) as conn:
open_schema(conn, db_schema)
create_schema(conn, db_schema)
assert_udf_running(conn, language_alias, db_schema)

0 comments on commit a6b49e6

Please sign in to comment.