Skip to content
Snippets Groups Projects
Commit 1497b645 authored by Cam Saul's avatar Cam Saul
Browse files

test fix

parent fbd35aaa
Branches
Tags
No related merge requests found
......@@ -36,7 +36,7 @@
This will reuse `*jdbc-metadata*` if it's already set (to avoid opening extra connections).
Otherwise it will open a new metadata connection and bind `*jdbc-metadata*` so it's available in subsequent calls to `with-jdbc-metadata` within F."
[database f]
{:pre [(map? database)]}
;; Does this work if DATABASE is a delay *or* a map ?
(if *jdbc-metadata* (f *jdbc-metadata*)
(jdbc/with-db-metadata [md (driver/connection database)]
(binding [*jdbc-metadata* md]
......
......@@ -11,9 +11,8 @@
;; ## GET /api/meta/field/:id
(expect
(match-$ (let [field-id (field->id :users :name)] ; !!! field->id causes lazy loading of the test data and Metabase DB
(sel :one Field :id field-id)) ; If it's not evaluated before sel then the Metabase DB won't exist when sel
{:description nil ; is executed
(match-$ (sel :one Field :id (field->id :users :name))
{:description nil
:table_id (table->id :users)
:table (match-$ (sel :one Table :id (table->id :users))
{:description nil
......@@ -35,7 +34,7 @@
:id (table->id :users)
:db_id (:id @test-db)
:created_at $})
:special_type nil
:special_type "category" ; metabase.driver.generic-sql.sync/check-for-low-cardinality should have marked this as such because it had no other special_type
:name "NAME"
:updated_at $
:active true
......
......@@ -218,7 +218,7 @@
:table_id $
:name "ID"
:description nil
:base_type "IntegerField"
:base_type "BigIntegerField"
:preview_display $
:position $
:field_type "info"
......
......@@ -407,7 +407,7 @@
:row_count 15
:data {:rows [[1] [3] [6] [10] [15] [21] [28] [36] [45] [55] [66] [78] [91] [105] [120]]
:columns ["ID"]
:cols [{:extra_info {} :special_type :id, :base_type :IntegerField, :description nil, :name "ID", :table_id (table->id :users), :id (field->id :users :id)}]}}
:cols [{:extra_info {} :special_type :id, :base_type :BigIntegerField, :description nil, :name "ID", :table_id (table->id :users), :id (field->id :users :id)}]}}
(process-and-run {:type :query
:database @db-id
:query {:limit nil
......@@ -421,8 +421,8 @@
:row_count 15
:data {:rows [4 12 13 22 34 44 57 72 78 85 90 104 115 118 120]
:columns ["CAST(LAST_LOGIN AS DATE)" "ID"]
:cols [{:extra_info {} :special_type nil, :base_type :DateTimeField, :description nil, :name "LAST_LOGIN", :table_id (table->id :users), :id (field->id :users :last_login)}
{:extra_info {} :special_type :id, :base_type :IntegerField, :description nil, :name "ID", :table_id (table->id :users), :id (field->id :users :id)}]}}
:cols [{:extra_info {} :special_type :category :base_type :DateTimeField, :description nil, :name "LAST_LOGIN", :table_id (table->id :users), :id (field->id :users :last_login)}
{:extra_info {} :special_type :id, :base_type :BigIntegerField, :description nil, :name "ID", :table_id (table->id :users), :id (field->id :users :id)}]}}
(-> (process-and-run {:type :query
:database @db-id
:query {:limit nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment