This is an automated email from the ASF dual-hosted git repository.
dpgaspar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new f13ba25 fix(tests): custom filter flaky tests on dash and charts
(#9679)
f13ba25 is described below
commit f13ba2561cd325c4bd4dc3c4700b618f195b89ed
Author: Daniel Vaz Gaspar <[email protected]>
AuthorDate: Wed Apr 29 08:36:11 2020 +0100
fix(tests): custom filter flaky tests on dash and charts (#9679)
---
tests/charts/api_tests.py | 10 ++++++----
tests/dashboards/api_tests.py | 10 ++++++----
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/tests/charts/api_tests.py b/tests/charts/api_tests.py
index 0a7ab58..558e2e9 100644
--- a/tests/charts/api_tests.py
+++ b/tests/charts/api_tests.py
@@ -556,9 +556,9 @@ class ChartApiTests(SupersetTestCase,
ApiOwnersTestCaseMixin):
Chart API: Test get charts custom filter
"""
admin = self.get_user("admin")
- chart1 = self.insert_chart("foo", [admin.id], 1, description="ZY_bar")
+ chart1 = self.insert_chart("foo_a", [admin.id], 1,
description="ZY_bar")
chart2 = self.insert_chart("zy_foo", [admin.id], 1,
description="desc1")
- chart3 = self.insert_chart("foo", [admin.id], 1,
description="desc1zy_")
+ chart3 = self.insert_chart("foo_b", [admin.id], 1,
description="desc1zy_")
chart4 = self.insert_chart("bar", [admin.id], 1, description="foo")
arguments = {
@@ -567,6 +567,8 @@ class ChartApiTests(SupersetTestCase,
ApiOwnersTestCaseMixin):
],
"order_column": "slice_name",
"order_direction": "asc",
+ "keys": ["none"],
+ "columns": ["slice_name", "description"],
}
self.login(username="admin")
uri = f"api/v1/chart/?q={prison.dumps(arguments)}"
@@ -576,8 +578,8 @@ class ChartApiTests(SupersetTestCase,
ApiOwnersTestCaseMixin):
self.assertEqual(data["count"], 3)
expected_response = [
- {"description": "ZY_bar", "slice_name": "foo",},
- {"description": "desc1zy_", "slice_name": "foo",},
+ {"description": "ZY_bar", "slice_name": "foo_a",},
+ {"description": "desc1zy_", "slice_name": "foo_b",},
{"description": "desc1", "slice_name": "zy_foo",},
]
for index, item in enumerate(data["result"]):
diff --git a/tests/dashboards/api_tests.py b/tests/dashboards/api_tests.py
index f8119f5..23cdd88 100644
--- a/tests/dashboards/api_tests.py
+++ b/tests/dashboards/api_tests.py
@@ -195,9 +195,9 @@ class DashboardApiTests(SupersetTestCase,
ApiOwnersTestCaseMixin):
Dashboard API: Test get dashboards custom filter
"""
admin = self.get_user("admin")
- dashboard1 = self.insert_dashboard("foo", "ZY_bar", [admin.id])
+ dashboard1 = self.insert_dashboard("foo_a", "ZY_bar", [admin.id])
dashboard2 = self.insert_dashboard("zy_foo", "slug1", [admin.id])
- dashboard3 = self.insert_dashboard("foo", "slug1zy_", [admin.id])
+ dashboard3 = self.insert_dashboard("foo_b", "slug1zy_", [admin.id])
dashboard4 = self.insert_dashboard("bar", "foo", [admin.id])
arguments = {
@@ -206,6 +206,8 @@ class DashboardApiTests(SupersetTestCase,
ApiOwnersTestCaseMixin):
],
"order_column": "dashboard_title",
"order_direction": "asc",
+ "keys": ["none"],
+ "columns": ["dashboard_title", "slug"],
}
self.login(username="admin")
uri = f"api/v1/dashboard/?q={prison.dumps(arguments)}"
@@ -215,8 +217,8 @@ class DashboardApiTests(SupersetTestCase,
ApiOwnersTestCaseMixin):
self.assertEqual(data["count"], 3)
expected_response = [
- {"slug": "ZY_bar", "dashboard_title": "foo",},
- {"slug": "slug1zy_", "dashboard_title": "foo",},
+ {"slug": "ZY_bar", "dashboard_title": "foo_a",},
+ {"slug": "slug1zy_", "dashboard_title": "foo_b",},
{"slug": "slug1", "dashboard_title": "zy_foo",},
]
for index, item in enumerate(data["result"]):