mirror of https://github.com/apache/superset.git
chore(tests): Fix MySQL logic (#29356)
This commit is contained in:
parent
c12b4e9cba
commit
f9f70e3e55
|
@ -255,8 +255,8 @@ def test_run_sync_query_cta_config(test_client, ctas_method):
|
||||||
lambda d, u, s, sql: CTAS_SCHEMA_NAME,
|
lambda d, u, s, sql: CTAS_SCHEMA_NAME,
|
||||||
)
|
)
|
||||||
def test_run_async_query_cta_config(test_client, ctas_method):
|
def test_run_async_query_cta_config(test_client, ctas_method):
|
||||||
if backend() in {"sqlite", "mysql"}:
|
if backend() == "sqlite":
|
||||||
# sqlite doesn't support schemas, mysql is flaky
|
# sqlite doesn't support schemas
|
||||||
return
|
return
|
||||||
tmp_table_name = f"{TEST_ASYNC_CTA_CONFIG}_{ctas_method.lower()}"
|
tmp_table_name = f"{TEST_ASYNC_CTA_CONFIG}_{ctas_method.lower()}"
|
||||||
result = run_sql(
|
result = run_sql(
|
||||||
|
@ -286,10 +286,6 @@ def test_run_async_query_cta_config(test_client, ctas_method):
|
||||||
@pytest.mark.usefixtures("load_birth_names_data", "login_as_admin")
|
@pytest.mark.usefixtures("load_birth_names_data", "login_as_admin")
|
||||||
@pytest.mark.parametrize("ctas_method", [CtasMethod.TABLE, CtasMethod.VIEW])
|
@pytest.mark.parametrize("ctas_method", [CtasMethod.TABLE, CtasMethod.VIEW])
|
||||||
def test_run_async_cta_query(test_client, ctas_method):
|
def test_run_async_cta_query(test_client, ctas_method):
|
||||||
if backend() == "mysql":
|
|
||||||
# failing
|
|
||||||
return
|
|
||||||
|
|
||||||
table_name = f"{TEST_ASYNC_CTA}_{ctas_method.lower()}"
|
table_name = f"{TEST_ASYNC_CTA}_{ctas_method.lower()}"
|
||||||
result = run_sql(
|
result = run_sql(
|
||||||
test_client,
|
test_client,
|
||||||
|
@ -317,10 +313,6 @@ def test_run_async_cta_query(test_client, ctas_method):
|
||||||
@pytest.mark.usefixtures("load_birth_names_data", "login_as_admin")
|
@pytest.mark.usefixtures("load_birth_names_data", "login_as_admin")
|
||||||
@pytest.mark.parametrize("ctas_method", [CtasMethod.TABLE, CtasMethod.VIEW])
|
@pytest.mark.parametrize("ctas_method", [CtasMethod.TABLE, CtasMethod.VIEW])
|
||||||
def test_run_async_cta_query_with_lower_limit(test_client, ctas_method):
|
def test_run_async_cta_query_with_lower_limit(test_client, ctas_method):
|
||||||
if backend() == "mysql":
|
|
||||||
# failing
|
|
||||||
return
|
|
||||||
|
|
||||||
tmp_table = f"{TEST_ASYNC_LOWER_LIMIT}_{ctas_method.lower()}"
|
tmp_table = f"{TEST_ASYNC_LOWER_LIMIT}_{ctas_method.lower()}"
|
||||||
result = run_sql(
|
result = run_sql(
|
||||||
test_client,
|
test_client,
|
||||||
|
|
|
@ -1548,8 +1548,6 @@ def test_report_schedule_working_timeout(create_report_slack_chart_working):
|
||||||
datetime.utcnow(),
|
datetime.utcnow(),
|
||||||
).run()
|
).run()
|
||||||
|
|
||||||
# Only needed for MySQL, understand why
|
|
||||||
db.session.commit()
|
|
||||||
logs = db.session.query(ReportExecutionLog).all()
|
logs = db.session.query(ReportExecutionLog).all()
|
||||||
# Two logs, first is created by fixture
|
# Two logs, first is created by fixture
|
||||||
assert len(logs) == 2
|
assert len(logs) == 2
|
||||||
|
@ -2076,9 +2074,6 @@ def test_grace_period_error(email_mock, create_invalid_sql_alert_email_chart):
|
||||||
datetime.utcnow(),
|
datetime.utcnow(),
|
||||||
).run()
|
).run()
|
||||||
|
|
||||||
# Only needed for MySQL, understand why
|
|
||||||
db.session.commit()
|
|
||||||
|
|
||||||
# Assert the email smtp address, asserts a notification was sent with the error
|
# Assert the email smtp address, asserts a notification was sent with the error
|
||||||
assert email_mock.call_args[0][0] == DEFAULT_OWNER_EMAIL
|
assert email_mock.call_args[0][0] == DEFAULT_OWNER_EMAIL
|
||||||
assert (
|
assert (
|
||||||
|
|
Loading…
Reference in New Issue