Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List enabled Query Runner types during build #4166

Merged
merged 6 commits into from
Sep 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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