diff --git a/test/integration/conftest.py b/test/integration/conftest.py index 902ce35..52eada4 100644 --- a/test/integration/conftest.py +++ b/test/integration/conftest.py @@ -1,5 +1,3 @@ -from pathlib import Path - import pytest import click import requests @@ -46,11 +44,12 @@ def container_url(container_version) -> str: @pytest.fixture(scope='session') -def container_path(tmp_path: Path, container_url) -> Path: +def container_path(tmpdir_factory, container_url, container_name) -> str: - slc_path = tmp_path / SLC_NAME - response = requests.get(container_url) + response = requests.get(container_url, allow_redirects=True) response.raise_for_status() - with slc_path.open('wb') as f: + slc_path = tmpdir_factory.mktemp('container').join(container_name) + slc_path = str(slc_path) + with open(slc_path, 'wb') as f: f.write(response.content) return slc_path diff --git a/test/integration/test_language_container_deployer.py b/test/integration/test_language_container_deployer.py index c8fa830..7948434 100644 --- a/test/integration/test_language_container_deployer.py +++ b/test/integration/test_language_container_deployer.py @@ -34,7 +34,7 @@ def test_language_container_deployer( connection_factory: Callable[[config.Exasol], ExaConnection], exasol_config: config.Exasol, bucketfs_config: config.BucketFs, - container_path: Path): + container_path: str): """ Tests the deployment of a container in one call, including the activation at the System level. """ @@ -48,7 +48,7 @@ def test_language_container_deployer( deployer = create_container_deployer(language_alias=language_alias, pyexasol_connection=pyexasol_connection, bucketfs_config=bucketfs_config) - deployer.run(container_file=container_path, alter_system=True, allow_override=True) + deployer.run(container_file=Path(container_path), alter_system=True, allow_override=True) new_connection = stack.enter_context(connection_factory(exasol_config)) assert_udf_running(new_connection, language_alias, schema) @@ -88,7 +88,7 @@ def test_language_container_deployer_activation_fail( connection_factory: Callable[[config.Exasol], ExaConnection], exasol_config: config.Exasol, bucketfs_config: config.BucketFs, - container_path: Path, + container_path: str, container_name: str): """ Tests that an attempt to activate a container using alias that already exists @@ -104,7 +104,7 @@ def test_language_container_deployer_activation_fail( deployer = create_container_deployer(language_alias=language_alias, pyexasol_connection=pyexasol_connection, bucketfs_config=bucketfs_config) - deployer.run(container_file=container_path, alter_system=True, allow_override=True) + deployer.run(container_file=Path(container_path), alter_system=True, allow_override=True) new_connection = stack.enter_context(connection_factory(exasol_config)) deployer = create_container_deployer(language_alias=language_alias, pyexasol_connection=new_connection, diff --git a/test/integration/test_language_container_deployer_cli.py b/test/integration/test_language_container_deployer_cli.py index 412a575..7e74bac 100644 --- a/test/integration/test_language_container_deployer_cli.py +++ b/test/integration/test_language_container_deployer_cli.py @@ -16,7 +16,7 @@ def call_language_definition_deployer_cli(func, exasol_config: config.Exasol, bucketfs_config: config.BucketFs, language_alias: str, - container_path: Optional[Path] = None, + container_path: Optional[str] = None, version: Optional[str] = None, use_ssl_cert_validation: bool = False): parsed_url = urlparse(bucketfs_config.url) @@ -43,13 +43,13 @@ def call_language_definition_deployer_cli(func, args_list += [ "--no-use-ssl-cert-validation" ] - if version is not None: + if version: args_list += [ "--version", version, ] - if container_path is not None: + if container_path: args_list += [ - "--container-file", str(container_path), + "--container-file", container_path, ] runner = CliRunner() result = runner.invoke(func, args_list) @@ -61,7 +61,7 @@ def test_language_container_deployer_cli_with_container_file( connection_factory: Callable[[config.Exasol], ExaConnection], exasol_config: config.Exasol, bucketfs_config: config.BucketFs, - container_path: Path, + container_path: str, main_func ): test_name: str = request.node.name @@ -135,7 +135,7 @@ def test_language_container_deployer_cli_with_check_cert( connection_factory: Callable[[config.Exasol], ExaConnection], exasol_config: config.Exasol, bucketfs_config: config.BucketFs, - container_path: Path, + container_path: str, main_func ): expected_exception_message = '[SSL: CERTIFICATE_VERIFY_FAILED]'