From 77db039aff771672b2c7a68132420230b7e69412 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Sun, 22 Sep 2019 12:42:06 +0300 Subject: [PATCH 1/5] Add CLI command to list enabled query runner types --- redash/cli/data_sources.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/redash/cli/data_sources.py b/redash/cli/data_sources.py index fa7c7a8032..8fbd33e34a 100644 --- a/redash/cli/data_sources.py +++ b/redash/cli/data_sources.py @@ -35,6 +35,15 @@ def list(organization=None): ds.id, ds.name, ds.type, ds.options.to_json())) +@manager.command() +def list_types(): + print ("Enabled Query Runners:") + types = sorted(query_runners.keys()) + for query_runner_type in types: + print(query_runner_type) + print("Total of {}.".format(len(types))) + + def validate_data_source_type(type): if type not in query_runners.keys(): print("Error: the type \"{}\" is not supported (supported types: {})." From 0d84a2a05b232a6711708d25a5b690625f5205c1 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Sun, 22 Sep 2019 12:43:17 +0300 Subject: [PATCH 2/5] List data source types during build --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index bb4fe96603..a0aa9f2f5a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,6 +32,9 @@ jobs: - run: name: Create Test Database command: docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests;" + - run: + name: List Enabled Query Runners + command: docker-compose run --rm shell manage db list_types - run: name: Run Tests command: docker-compose run --name tests redash tests --junitxml=junit.xml --cov-report xml --cov=redash --cov-config .coveragerc tests/ From e9892b6aaa780adcd4f816313bdfea37414531ad Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Sun, 22 Sep 2019 12:46:42 +0300 Subject: [PATCH 3/5] Remove space to appease @rauchy and CodeClimate. --- redash/cli/data_sources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redash/cli/data_sources.py b/redash/cli/data_sources.py index 8fbd33e34a..acd9d51909 100644 --- a/redash/cli/data_sources.py +++ b/redash/cli/data_sources.py @@ -37,7 +37,7 @@ def list(organization=None): @manager.command() def list_types(): - print ("Enabled Query Runners:") + print("Enabled Query Runners:") types = sorted(query_runners.keys()) for query_runner_type in types: print(query_runner_type) From 2db87c2546fdcd8b71f4b93e2d03aea520de21f3 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Sun, 22 Sep 2019 12:59:07 +0300 Subject: [PATCH 4/5] :facepalm: --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a0aa9f2f5a..19f58c260b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,7 +34,7 @@ jobs: command: docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests;" - run: name: List Enabled Query Runners - command: docker-compose run --rm shell manage db list_types + command: docker-compose run --rm redash shell manage ds list_types - run: name: Run Tests command: docker-compose run --name tests redash tests --junitxml=junit.xml --cov-report xml --cov=redash --cov-config .coveragerc tests/ From 43bc19f2d74d97d0c1225dffabd0e483084c32c9 Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Sun, 22 Sep 2019 13:24:49 +0300 Subject: [PATCH 5/5] Fix command --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 19f58c260b..3e0e99a101 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,7 +34,7 @@ jobs: command: docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests;" - run: name: List Enabled Query Runners - command: docker-compose run --rm redash shell manage ds list_types + command: docker-compose run --rm redash manage ds list_types - run: name: Run Tests command: docker-compose run --name tests redash tests --junitxml=junit.xml --cov-report xml --cov=redash --cov-config .coveragerc tests/