Skip to content

Commit

Permalink
✅ Initial Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchdawson1982 committed Oct 11, 2023
1 parent a04a346 commit cab4334
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions terraform/environments/data-platform/tests/run_smoke_tests.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import base64
import hashlib
import requests
import json
import boto3
import requests
import sys
import time

import boto3

file_path = "test_data.csv"
database = "test_product5"
table = "testing"
Expand Down Expand Up @@ -43,19 +45,19 @@ def md5_hash_file_contents(file) -> str:
upload_response = requests.post(response_json["URL"]["url"], files=multipart_form_data)
print(upload_response.status_code, upload_response.text)

print(f"Waiting for {database}.{table} to create in athena")
print(f"Waiting for {data_product_name}.{table_name} to create in athena")
time.sleep(10)

# Check for created table
try:
glue.get_table(DatabaseName=database, Name=table)
print(f"{database}.{table} found in glue")
glue.get_table(data_product_nameName=data_product_name, Name=table_name)
print(f"{data_product_name}.{table_name} found in glue")
except Exception as e:
raise e

# Clean up created table
try:
glue.delete_table(DatabaseName=database, Name=table)
print(f"{database}.{table} deleted from glue")
glue.delete_table(data_product_nameName=data_product_name, Name=table_name)
print(f"{data_product_name}.{table_name} deleted from glue")
except Exception as e:
raise e

0 comments on commit cab4334

Please sign in to comment.