From d7ae37ef251203b0baa3a44d5c8b0050c10dac1c Mon Sep 17 00:00:00 2001 From: ckunki Date: Tue, 24 Sep 2024 15:46:42 +0200 Subject: [PATCH] Prepare using pytest-exasol-slc 0.3.0 fixtures deployed_slc --- tests/integration_tests/with_db/conftest.py | 47 +++++++++++++-------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/tests/integration_tests/with_db/conftest.py b/tests/integration_tests/with_db/conftest.py index 6cda87d..388a020 100644 --- a/tests/integration_tests/with_db/conftest.py +++ b/tests/integration_tests/with_db/conftest.py @@ -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)