DB now comes from config

This commit is contained in:
Pablo Martin 2023-02-02 15:05:53 +01:00
parent 3dfac07cb5
commit 2f62b34543
3 changed files with 12 additions and 9 deletions

View file

@ -19,6 +19,7 @@ from lolafect.connections import open_ssh_tunnel_with_s3_pkey, close_ssh_tunnel
TEST_LOLACONFIG = build_lolaconfig(flow_name="testing-suite")
def test_validation_on_mysql_succeeds():
test_query = """
@ -54,10 +55,11 @@ def test_validation_on_mysql_succeeds():
"host": ssh_tunnel.local_bind_address[0],
"port": ssh_tunnel.local_bind_address[1],
"user": TEST_LOLACONFIG.DW_CREDENTIALS["user"],
"password": TEST_LOLACONFIG.DW_CREDENTIALS["password"]
"password": TEST_LOLACONFIG.DW_CREDENTIALS["password"],
"db": TEST_LOLACONFIG.DW_CREDENTIALS["default_db"]
},
query=test_query,
expectations=test_expectations
expectations=test_expectations,
)
closed_tunnel = close_ssh_tunnel.run(ssh_tunnel)
@ -95,17 +97,17 @@ def test_validation_on_mysql_fails():
remote_target_port=TEST_LOLACONFIG.DW_CREDENTIALS["port"],
)
validation_result = run_data_test_on_mysql.run(
name="lolafect-testing-test_validation_on_mysql_fails",
mysql_credentials={
"host": ssh_tunnel.local_bind_address[0],
"port": ssh_tunnel.local_bind_address[1],
"user": TEST_LOLACONFIG.DW_CREDENTIALS["user"],
"password": TEST_LOLACONFIG.DW_CREDENTIALS["password"]
"password": TEST_LOLACONFIG.DW_CREDENTIALS["password"],
"db": TEST_LOLACONFIG.DW_CREDENTIALS["default_db"]
},
query=test_query,
expectations=test_expectations
expectations=test_expectations,
)
closed_tunnel = close_ssh_tunnel.run(ssh_tunnel)