From bf590d91849967f2623c4f511819bcc714a3a7d4 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Fri, 12 Jul 2019 16:32:16 -0700 Subject: [PATCH 1/4] Set examples as published=True --- superset/data/birth_names.py | 1 + superset/data/deck.py | 1 + superset/data/misc_dashboard.py | 1 + superset/data/world_bank.py | 1 + 4 files changed, 4 insertions(+) diff --git a/superset/data/birth_names.py b/superset/data/birth_names.py index 9040847ab07..a22190f3cb7 100644 --- a/superset/data/birth_names.py +++ b/superset/data/birth_names.py @@ -388,6 +388,7 @@ def load_birth_names(): if not dash: dash = Dash() + dash.published = True js = textwrap.dedent( # pylint: disable=line-too-long """\ diff --git a/superset/data/deck.py b/superset/data/deck.py index 53445d5af29..3a15c422546 100644 --- a/superset/data/deck.py +++ b/superset/data/deck.py @@ -499,6 +499,7 @@ def load_deck_dash(): if not dash: dash = Dash() + dash.published = True js = POSITION_JSON pos = json.loads(js) update_slice_ids(pos, slices) diff --git a/superset/data/misc_dashboard.py b/superset/data/misc_dashboard.py index 53aaf6e9468..ba82bd137b3 100644 --- a/superset/data/misc_dashboard.py +++ b/superset/data/misc_dashboard.py @@ -33,6 +33,7 @@ def load_misc_dashboard(): if not dash: dash = Dash() + dash.published = True js = textwrap.dedent( """\ { diff --git a/superset/data/world_bank.py b/superset/data/world_bank.py index a64bd2ba1e9..870681b583b 100644 --- a/superset/data/world_bank.py +++ b/superset/data/world_bank.py @@ -328,6 +328,7 @@ def load_world_bank_health_n_pop(): if not dash: dash = Dash() + dash.published = True js = textwrap.dedent( """\ { From 683259ee223d2fa31fa8e65fcd73524fe769e563 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Tue, 16 Jul 2019 09:33:41 -0700 Subject: [PATCH 2/4] Move 2 dashboards to tests --- superset/cli.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/superset/cli.py b/superset/cli.py index cb363c2b595..292303b634d 100755 --- a/superset/cli.py +++ b/superset/cli.py @@ -81,9 +81,6 @@ def load_examples_run(load_test_data): print("Loading [Birth names]") data.load_birth_names() - print("Loading [Unicode test data]") - data.load_unicode_test_data() - if not load_test_data: print("Loading [Random time series data]") data.load_random_time_series_data() @@ -118,8 +115,11 @@ def load_examples_run(load_test_data): print("Loading DECK.gl demo") data.load_deck_dash() - print("Loading [Tabbed dashboard]") - data.load_tabbed_dashboard() + print("Loading [Tabbed dashboard]") + data.load_tabbed_dashboard() + + print("Loading [Unicode test data]") + data.load_unicode_test_data() @app.cli.command() From 0f59b36f97ac75c0299b8d03754161e6a8b60848 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Tue, 16 Jul 2019 10:33:50 -0700 Subject: [PATCH 3/4] tabbed_dashboard --- tests/load_examples_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/load_examples_test.py b/tests/load_examples_test.py index 6ca3b2d38f7..33c58dde76d 100644 --- a/tests/load_examples_test.py +++ b/tests/load_examples_test.py @@ -32,5 +32,8 @@ def test_load_world_bank_health_n_pop(self): def test_load_birth_names(self): data.load_birth_names() + def test_load_tabbed_dashboard(self): + data.load_tabbed_dashboard() + def test_load_test_users_run(self): load_test_users_run() From acd1172c4e97a64ef44ee5208721382ec4ba66b5 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Tue, 16 Jul 2019 14:03:28 -0700 Subject: [PATCH 4/4] Use tests/load_examples_test for cypress --- superset/assets/cypress_build.sh | 1 - tox.ini | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/superset/assets/cypress_build.sh b/superset/assets/cypress_build.sh index bb1af41e45d..70cf797f77f 100755 --- a/superset/assets/cypress_build.sh +++ b/superset/assets/cypress_build.sh @@ -22,7 +22,6 @@ cd "$(dirname "$0")" #run all the python steps in a background process time superset db upgrade time superset load_test_users -time superset load_examples --load-test-data time superset init echo "[completed python build steps]" flask run -p 8081 --with-threads --reload --debugger & diff --git a/tox.ini b/tox.ini index 189862e8bba..c67a1be0c16 100644 --- a/tox.ini +++ b/tox.ini @@ -55,13 +55,14 @@ whitelist_externals = [testenv:black] commands = black --check setup.py superset tests -deps = +deps = -rrequirements-dev.txt [testenv:cypress-dashboard] commands = npm install -g npm@'>=6.5.0' pip install -e {toxinidir}/ + nosetests tests/load_examples_test.py {toxinidir}/superset/assets/cypress_build.sh dashboard deps = -rrequirements.txt @@ -75,6 +76,7 @@ setenv = commands = npm install -g npm@'>=6.5.0' pip install -e {toxinidir}/ + nosetests tests/load_examples_test.py {toxinidir}/superset/assets/cypress_build.sh explore deps = -rrequirements.txt @@ -88,6 +90,7 @@ setenv = commands = npm install -g npm@'>=6.5.0' pip install -e {toxinidir}/ + nosetests tests/load_examples_test.py {toxinidir}/superset/assets/cypress_build.sh sqllab deps = -rrequirements.txt