Skip to content

Commit 0aa4d28

Browse files
committed
add some test fixtures for running in LocalStack
1 parent 0536283 commit 0aa4d28

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

setup.cfg

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

8181
[options.extras_require]
8282
development =
83+
boto3
8384
Cython
8485
coverage
8586
more-itertools

test/integ/conftest.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,30 @@ 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("s3", endpoint_url="http://localhost:4566")
95+
s3_client.create_bucket(Bucket="test")
96+
97+
# create a local external volume which is required by some of the tests
98+
query = (
99+
"CREATE EXTERNAL VOLUME IF NOT EXISTS python_connector_iceberg_exvol STORAGE_LOCATIONS = "
100+
"((NAME = 'sl1' STORAGE_PROVIDER='S3' STORAGE_BASE_URL='s3://test' "
101+
"STORAGE_AWS_ROLE_ARN='arn:aws:iam::000000000000:role/test'))"
102+
)
103+
connection = create_connection("default")
104+
connection.cursor().execute(query)
105+
106+
107+
# END changes for LocalStack
108+
109+
86110
@pytest.fixture(scope="session")
87111
def is_public_test() -> bool:
88112
return is_public_testaccount()

0 commit comments

Comments
 (0)