Skip to content

Commit

Permalink
fix: tests on database, dataset, saved_queries apis (apache#28397)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgaspar authored and SRK committed May 10, 2024
1 parent 7a2de9f commit a0b94d5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,5 @@ fi

if [ $RUN_TESTS -eq 1 ]
then
pytest --durations=0 --maxfail=1 "${TEST_MODULE}"
pytest -vv --durations=0 "${TEST_MODULE}"
fi
9 changes: 9 additions & 0 deletions tests/integration_tests/databases/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def test_get_items(self):
"allow_cvas",
"allow_dml",
"allow_file_upload",
"allow_multi_catalog",
"allow_run_async",
"allows_cost_estimate",
"allows_subquery",
Expand Down Expand Up @@ -3256,6 +3257,7 @@ def test_available(self, app, get_available_engine_specs):
"sqlalchemy_uri_placeholder": "postgresql://user:password@host:port/dbname[?key=value&key=value...]",
"engine_information": {
"supports_file_upload": True,
"supports_dynamic_catalog": True,
"disable_ssh_tunneling": False,
},
},
Expand All @@ -3279,6 +3281,7 @@ def test_available(self, app, get_available_engine_specs):
"sqlalchemy_uri_placeholder": "bigquery://{project_id}",
"engine_information": {
"supports_file_upload": True,
"supports_dynamic_catalog": False,
"disable_ssh_tunneling": True,
},
},
Expand Down Expand Up @@ -3334,6 +3337,7 @@ def test_available(self, app, get_available_engine_specs):
"sqlalchemy_uri_placeholder": "redshift+psycopg2://user:password@host:port/dbname[?key=value&key=value...]",
"engine_information": {
"supports_file_upload": True,
"supports_dynamic_catalog": False,
"disable_ssh_tunneling": False,
},
},
Expand All @@ -3357,6 +3361,7 @@ def test_available(self, app, get_available_engine_specs):
"sqlalchemy_uri_placeholder": "gsheets://",
"engine_information": {
"supports_file_upload": True,
"supports_dynamic_catalog": False,
"disable_ssh_tunneling": True,
},
},
Expand Down Expand Up @@ -3412,6 +3417,7 @@ def test_available(self, app, get_available_engine_specs):
"sqlalchemy_uri_placeholder": "mysql://user:password@host:port/dbname[?key=value&key=value...]",
"engine_information": {
"supports_file_upload": True,
"supports_dynamic_catalog": False,
"disable_ssh_tunneling": False,
},
},
Expand All @@ -3423,6 +3429,7 @@ def test_available(self, app, get_available_engine_specs):
"sqlalchemy_uri_placeholder": "engine+driver://user:password@host:port/dbname[?key=value&key=value...]",
"engine_information": {
"supports_file_upload": True,
"supports_dynamic_catalog": False,
"disable_ssh_tunneling": False,
},
},
Expand Down Expand Up @@ -3455,6 +3462,7 @@ def test_available_no_default(self, app, get_available_engine_specs):
"sqlalchemy_uri_placeholder": "mysql://user:password@host:port/dbname[?key=value&key=value...]",
"engine_information": {
"supports_file_upload": True,
"supports_dynamic_catalog": False,
"disable_ssh_tunneling": False,
},
},
Expand All @@ -3466,6 +3474,7 @@ def test_available_no_default(self, app, get_available_engine_specs):
"sqlalchemy_uri_placeholder": "engine+driver://user:password@host:port/dbname[?key=value&key=value...]",
"engine_information": {
"supports_file_upload": True,
"supports_dynamic_catalog": False,
"disable_ssh_tunneling": False,
},
},
Expand Down
2 changes: 2 additions & 0 deletions tests/integration_tests/datasets/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def test_get_dataset_list(self):
response = json.loads(rv.data.decode("utf-8"))
assert response["count"] == 1
expected_columns = [
"catalog",
"changed_by",
"changed_by_name",
"changed_on_delta_humanized",
Expand Down Expand Up @@ -368,6 +369,7 @@ def test_get_dataset_item(self):
"cache_timeout": None,
"database": {
"backend": main_db.backend,
"allow_multi_catalog": False,
"database_name": "examples",
"id": 1,
},
Expand Down
1 change: 1 addition & 0 deletions tests/integration_tests/queries/saved_queries/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ def test_get_saved_query(self):

expected_result = {
"id": saved_query.id,
"catalog": None,
"database": {"id": saved_query.database.id, "database_name": "examples"},
"description": "cool description",
"changed_by": None,
Expand Down
2 changes: 2 additions & 0 deletions tests/unit_tests/databases/api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ def test_database_connection(
"driver": "gsheets",
"engine_information": {
"disable_ssh_tunneling": True,
"supports_dynamic_catalog": False,
"supports_file_upload": True,
},
"expose_in_sqllab": True,
Expand Down Expand Up @@ -308,6 +309,7 @@ def test_database_connection(
"driver": "gsheets",
"engine_information": {
"disable_ssh_tunneling": True,
"supports_dynamic_catalog": False,
"supports_file_upload": True,
},
"expose_in_sqllab": True,
Expand Down

0 comments on commit a0b94d5

Please sign in to comment.