Skip to content

Commit

Permalink
Prepare using pytest-exasol-slc 0.3.0 fixtures
Browse files Browse the repository at this point in the history
deployed_slc
  • Loading branch information
ckunki committed Sep 24, 2024
1 parent 504a592 commit d7ae37e
Showing 1 changed file with 29 additions and 18 deletions.
47 changes: 29 additions & 18 deletions tests/integration_tests/with_db/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,33 @@ def slc_builder(use_onprem, use_saas) -> LanguageContainerBuilder:
else:
yield None

import exasol.bucketfs as bfs
from exasol.python_extension_common.deployment.language_container_deployer import LanguageContainerDeployer
# can be removed as soon as the following issues is fixed and
# a new version of PYTSLC is released
# https://github.com/exasol/pytest-plugins/issues/58

@pytest.fixture(scope="session")
def upload_slc(slc_builder, export_slc, pyexasol_connection, backend_aware_bucketfs_params):
"""
The fixture uploads language container to a database, according to the selected
backends.
"""
if (slc_builder is not None) and (export_slc is not None):
# pyexasol_connection = pyexasol.connect(**backend_aware_database_params)
bucketfs_path = bfs.path.build_path(**backend_aware_bucketfs_params,
path='container')
deployer = LanguageContainerDeployer(pyexasol_connection=pyexasol_connection,
bucketfs_path=bucketfs_path,
language_alias=LANGUAGE_ALIAS)
deployer.run(container_file=export_slc, alter_system=True, allow_override=True)
def language_alias():
return LANGUAGE_ALIAS

TODO: replace by fixture deployed_slc from pytest-exasol-slc version >= 0.3.0
@pytest.fixture(scope="session")
def upload_slc(deploy_slc) -> None:
deploy_slc(LANGUAGE_ALIAS)


# import exasol.bucketfs as bfs
# from exasol.python_extension_common.deployment.language_container_deployer import LanguageContainerDeployer
# # can be removed as soon as the following issues is fixed and
# # a new version of PYTSLC is released
# # https://github.com/exasol/pytest-plugins/issues/58
# @pytest.fixture(scope="session")
# def upload_slc(slc_builder, export_slc, pyexasol_connection, backend_aware_bucketfs_params):
# """
# The fixture uploads language container to a database, according to the selected
# backends.
# """
# if (slc_builder is not None) and (export_slc is not None):
# # pyexasol_connection = pyexasol.connect(**backend_aware_database_params)
# bucketfs_path = bfs.path.build_path(**backend_aware_bucketfs_params,
# path='container')
# deployer = LanguageContainerDeployer(pyexasol_connection=pyexasol_connection,
# bucketfs_path=bucketfs_path,
# language_alias=LANGUAGE_ALIAS)
# deployer.run(container_file=export_slc, alter_system=True, allow_override=True)

0 comments on commit d7ae37e

Please sign in to comment.