Skip to content

Commit

Permalink
List enabled Query Runner types during build (#4166)
Browse files Browse the repository at this point in the history
* Add CLI command to list enabled query runner types
  • Loading branch information
arikfr authored Sep 22, 2019
1 parent ed22b63 commit a3e8477
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 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/
Expand Down
9 changes: 9 additions & 0 deletions redash/cli/data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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: {})."
Expand Down

0 comments on commit a3e8477

Please sign in to comment.