Skip to content

Commit

Permalink
only yield if dest is s3
Browse files Browse the repository at this point in the history
  • Loading branch information
guenp committed Feb 10, 2025
1 parent f42fdd3 commit 4ecf192
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/functional/adapter/test_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,18 @@ def extroot(self, tmp_path_factory, dest):
extroot = str(tmp_path_factory.getbasetemp() / "external")
if not os.path.exists(extroot):
os.mkdir(extroot)
return extroot

elif dest == DEST_S3:
extroot = os.path.join("dbt-duckdb", "test_external", f"pytest-{uuid4()}")
yield os.path.join("s3://", BUCKET_NAME, extroot)
session = boto3.Session(
aws_access_key_id=os.getenv("S3_MD_ORG_KEY"),
aws_secret_access_key=os.getenv("S3_MD_ORG_SECRET"),
)
s3 = session.resource('s3')
bucket = s3.Bucket('md-ecosystem-public')
bucket.objects.filter(Prefix=extroot).delete()
yield os.path.join("s3://", BUCKET_NAME, extroot)
session = boto3.Session(
aws_access_key_id=os.getenv("S3_MD_ORG_KEY"),
aws_secret_access_key=os.getenv("S3_MD_ORG_SECRET"),
)
s3 = session.resource('s3')
bucket = s3.Bucket('md-ecosystem-public')
bucket.objects.filter(Prefix=extroot).delete()

@pytest.fixture(scope="class")
def dbt_profile_target(self, profile_type, dbt_profile_target, extroot):
Expand Down

0 comments on commit 4ecf192

Please # to comment.