2023-01-20 15:01:07 +01:00
|
|
|
from lolafect.lolaconfig import build_lolaconfig
|
2023-01-20 15:53:45 +01:00
|
|
|
from lolafect.connections import connect_to_trino, close_trino_connection
|
2023-01-20 15:01:07 +01:00
|
|
|
|
2023-01-23 14:06:48 +01:00
|
|
|
# __ __ _____ _ _ _____ _ _ _____ _
|
|
|
|
|
# \ \ / /\ | __ \| \ | |_ _| \ | |/ ____| |
|
2023-01-23 14:07:35 +01:00
|
|
|
# \ \ /\ / / \ | |__) | \| | | | | \| | | __| |
|
|
|
|
|
# \ \/ \/ / /\ \ | _ /| . ` | | | | . ` | | |_ | |
|
|
|
|
|
# \ /\ / ____ \| | \ \| |\ |_| |_| |\ | |__| |_|
|
|
|
|
|
# \/ \/_/ \_\_| \_\_| \_|_____|_| \_|\_____(_)
|
2023-01-20 15:01:07 +01:00
|
|
|
# This testing suite requires:
|
|
|
|
|
# - The calling shell to have permission in AWS
|
|
|
|
|
# - The calling shell to be within the Mercadão network
|
2023-01-23 12:46:56 +01:00
|
|
|
# - Do not use this tests as part of CI/CD pipelines since they are not idempotent and
|
2023-01-23 14:07:22 +01:00
|
|
|
# rely external resources. Instead, use them manually to check yourself that things
|
|
|
|
|
# are working properly.
|
2023-01-20 15:01:07 +01:00
|
|
|
TEST_LOLACONFIG = build_lolaconfig(flow_name="testing-suite")
|
|
|
|
|
|
|
|
|
|
|
2023-01-20 15:53:45 +01:00
|
|
|
def test_that_trino_connect_and_disconnect_works_properly():
|
2023-01-20 15:01:07 +01:00
|
|
|
|
2023-01-23 14:06:48 +01:00
|
|
|
connection = connect_to_trino.run(
|
|
|
|
|
trino_credentials=TEST_LOLACONFIG.TRINO_CREDENTIALS
|
|
|
|
|
)
|
2023-01-20 15:01:07 +01:00
|
|
|
|
|
|
|
|
connection.cursor().execute("SELECT 1")
|
|
|
|
|
|
2023-01-23 14:06:48 +01:00
|
|
|
close_trino_connection.run(trino_connection=connection)
|