Skip to content

Commit def4ae6

Browse files
committed
add some test fixtures for running in LocalStack
1 parent 2eb396a commit def4ae6

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

.github/workflows/build_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ jobs:
178178
PYTEST_ADDOPTS: --color=yes --tb=short
179179
TOX_PARALLEL_NO_SPINNER: 1
180180
shell: bash
181+
timeout-minutes: 22
181182
- name: Combine coverages
182183
run: python -m tox run -e coverage --skip-missing-interpreters false
183184
shell: bash

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ console_scripts =
7979

8080
[options.extras_require]
8181
development =
82+
boto3
8283
Cython
8384
coverage
8485
more-itertools

test/integ/conftest.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,35 @@ def print_help() -> None:
8383
)
8484

8585

86+
# START changes for LocalStack
87+
88+
89+
@pytest.fixture(scope="session", autouse=True)
90+
def create_external_volume():
91+
import boto3
92+
93+
# create S3 bucket in LocalStack
94+
s3_client = boto3.client(
95+
"s3",
96+
endpoint_url="http://localhost:4566",
97+
aws_access_key_id="test",
98+
aws_secret_access_key="test",
99+
)
100+
s3_client.create_bucket(Bucket="test")
101+
102+
# create a local external volume which is required by some of the tests
103+
query = (
104+
"CREATE EXTERNAL VOLUME IF NOT EXISTS python_connector_iceberg_exvol STORAGE_LOCATIONS = "
105+
"((NAME = 'sl1' STORAGE_PROVIDER='S3' STORAGE_BASE_URL='s3://test' "
106+
"STORAGE_AWS_ROLE_ARN='arn:aws:iam::000000000000:role/test'))"
107+
)
108+
connection = create_connection("default")
109+
connection.cursor().execute(query)
110+
111+
112+
# END changes for LocalStack
113+
114+
86115
@pytest.fixture(scope="session")
87116
def is_public_test() -> bool:
88117
return is_public_testaccount()

0 commit comments

Comments
 (0)