Skip to content

Commit b94313b

Browse files
author
saul-data
committed
fix env variables for github actions
1 parent a8d18ce commit b94313b

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/dataplane/DataStorage/s3/test_s3.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ def test_s3():
1919
load_dotenv()
2020
RUN_ID = os.environ["DP_RUNID"]
2121

22+
S3_HOST = os.environ["S3_HOST"]
23+
2224
# S3 connection
2325
S3Connect = boto3.client(
2426
's3',
25-
endpoint_url="http://minio:9000",
27+
endpoint_url=S3_HOST,
2628
aws_access_key_id="admin",
2729
aws_secret_access_key="hello123",
2830
config=Config(signature_version='s3v4'),
@@ -43,7 +45,7 @@ def test_s3():
4345
# Store the data with key hello - run id will be attached
4446
rs = s3_upload(Bucket=bucket,
4547
S3Client=S3Connect,
46-
TargetFilePath=f"/s3test/myfile {RUN_ID}.csv",
48+
TargetFilePath=f"s3test/myfile {RUN_ID}.csv",
4749
SourceFilePath=CURRENT_DIRECTORY+"/test_s3_cities.csv",
4850
UploadMethod="File"
4951
)
@@ -55,7 +57,7 @@ def test_s3():
5557

5658
rs = s3_download(Bucket=bucket,
5759
S3Client=S3Connect,
58-
S3FilePath=f"/s3test/myfile {RUN_ID}.csv",
60+
S3FilePath=f"s3test/myfile {RUN_ID}.csv",
5961
LocalFilePath=CURRENT_DIRECTORY+"/test_cities_delete.csv",
6062
DownloadMethod="File"
6163
)

src/dataplane/DataStorage/s3/test_s3_object.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ def test_s3_object():
1515
# Dataplane run id
1616
os.environ["DP_RUNID"] = generate('1234567890abcdef', 10)
1717

18-
# Sharepoint connection
1918
load_dotenv()
2019

2120
RUN_ID = os.environ["DP_RUNID"]
2221

22+
S3_HOST = os.environ["S3_HOST"]
23+
2324
# S3 connection
2425
S3Connect = boto3.client(
2526
's3',
26-
endpoint_url="http://minio:9000",
27+
endpoint_url=S3_HOST,
2728
aws_access_key_id="admin",
2829
aws_secret_access_key="hello123",
2930
config=Config(signature_version='s3v4'),
@@ -48,7 +49,7 @@ def test_s3_object():
4849
# Store the data with key hello - run id will be attached
4950
rs = s3_upload(Bucket=bucket,
5051
S3Client=S3Connect,
51-
TargetFilePath=f"/s3test/object myfile {RUN_ID}.csv",
52+
TargetFilePath=f"s3test/object myfile {RUN_ID}.csv",
5253
UploadObject=UploadObject,
5354
UploadMethod="Object"
5455
)
@@ -59,7 +60,7 @@ def test_s3_object():
5960
# ---------- RETRIEVE FILE FROM S3 ------------
6061
rs = s3_download(Bucket=bucket,
6162
S3Client=S3Connect,
62-
S3FilePath=f"/s3test/object myfile {RUN_ID}.csv",
63+
S3FilePath=f"s3test/object myfile {RUN_ID}.csv",
6364
DownloadMethod="Object"
6465
)
6566
print(rs)

0 commit comments

Comments
 (0)