Skip to content
Snippets Groups Projects
Commit 50802892 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

unit test fixes.

parent cdfd816c
No related branches found
No related tags found
No related merge requests found
......@@ -880,29 +880,29 @@
;; SQL Server, Mongo, and Redshift don't have a concept of timezone so results are all grouped by UTC
(i/has-questionable-timezone-support? *data-loader*)
[["2015-06-01T07:00:00.000Z" 6]
["2015-06-02T07:00:00.000Z" 10]
["2015-06-03T07:00:00.000Z" 4]
["2015-06-04T07:00:00.000Z" 9]
["2015-06-05T07:00:00.000Z" 9]
["2015-06-06T07:00:00.000Z" 8]
["2015-06-07T07:00:00.000Z" 8]
["2015-06-08T07:00:00.000Z" 9]
["2015-06-09T07:00:00.000Z" 7]
["2015-06-10T07:00:00.000Z" 9]]
[["2015-06-01T00:00:00.000Z" 6]
["2015-06-02T00:00:00.000Z" 10]
["2015-06-03T00:00:00.000Z" 4]
["2015-06-04T00:00:00.000Z" 9]
["2015-06-05T00:00:00.000Z" 9]
["2015-06-06T00:00:00.000Z" 8]
["2015-06-07T00:00:00.000Z" 8]
["2015-06-08T00:00:00.000Z" 9]
["2015-06-09T00:00:00.000Z" 7]
["2015-06-10T00:00:00.000Z" 9]]
;; Postgres, MySQL, and H2 -- grouped by DB timezone, US/Pacific in this case
:else
[["2015-06-01T07:00:00.000Z" 8]
["2015-06-02T07:00:00.000Z" 9]
["2015-06-03T07:00:00.000Z" 9]
["2015-06-04T07:00:00.000Z" 4]
["2015-06-05T07:00:00.000Z" 11]
["2015-06-06T07:00:00.000Z" 8]
["2015-06-07T07:00:00.000Z" 6]
["2015-06-08T07:00:00.000Z" 10]
["2015-06-09T07:00:00.000Z" 6]
["2015-06-10T07:00:00.000Z" 10]])
[["2015-06-01T00:00:00.000Z" 8]
["2015-06-02T00:00:00.000Z" 9]
["2015-06-03T00:00:00.000Z" 9]
["2015-06-04T00:00:00.000Z" 4]
["2015-06-05T00:00:00.000Z" 11]
["2015-06-06T00:00:00.000Z" 8]
["2015-06-07T00:00:00.000Z" 6]
["2015-06-08T00:00:00.000Z" 10]
["2015-06-09T00:00:00.000Z" 6]
["2015-06-10T00:00:00.000Z" 10]])
(->> (dataset sad-toucan-incidents
(run-query incidents
(ql/aggregation (ql/count))
......@@ -1227,18 +1227,6 @@
(expect-with-non-timeseries-dbs
(cond
(contains? #{:redshift :sqlserver :bigquery} *engine*)
[["2015-06-01T17:31:00.000Z" 1]
["2015-06-01T23:06:00.000Z" 1]
["2015-06-02T00:23:00.000Z" 1]
["2015-06-02T01:55:00.000Z" 1]
["2015-06-02T04:04:00.000Z" 1]
["2015-06-02T04:19:00.000Z" 1]
["2015-06-02T09:13:00.000Z" 1]
["2015-06-02T12:37:00.000Z" 1]
["2015-06-02T15:20:00.000Z" 1]
["2015-06-02T18:11:00.000Z" 1]]
(= *engine* :sqlite)
[["2015-06-01 10:31:00" 1]
["2015-06-01 16:06:00" 1]
......@@ -1251,7 +1239,7 @@
["2015-06-02 08:20:00" 1]
["2015-06-02 11:11:00" 1]]
:else
(contains? #{:redshift :sqlserver :bigquery :mongo :h2} *engine*)
[["2015-06-01T10:31:00.000Z" 1]
["2015-06-01T16:06:00.000Z" 1]
["2015-06-01T17:23:00.000Z" 1]
......@@ -1261,7 +1249,19 @@
["2015-06-02T02:13:00.000Z" 1]
["2015-06-02T05:37:00.000Z" 1]
["2015-06-02T08:20:00.000Z" 1]
["2015-06-02T11:11:00.000Z" 1]])
["2015-06-02T11:11:00.000Z" 1]]
:else
[["2015-06-01T03:31:00.000Z" 1]
["2015-06-01T09:06:00.000Z" 1]
["2015-06-01T10:23:00.000Z" 1]
["2015-06-01T11:55:00.000Z" 1]
["2015-06-01T14:04:00.000Z" 1]
["2015-06-01T14:19:00.000Z" 1]
["2015-06-01T19:13:00.000Z" 1]
["2015-06-01T22:37:00.000Z" 1]
["2015-06-02T01:20:00.000Z" 1]
["2015-06-02T04:11:00.000Z" 1]])
(sad-toucan-incidents-with-bucketing :default))
(expect-with-non-timeseries-dbs
......@@ -1279,18 +1279,6 @@
["2015-06-02 11:11:00" 1]]
(i/has-questionable-timezone-support? *data-loader*)
[["2015-06-01T17:31:00.000Z" 1]
["2015-06-01T23:06:00.000Z" 1]
["2015-06-02T00:23:00.000Z" 1]
["2015-06-02T01:55:00.000Z" 1]
["2015-06-02T04:04:00.000Z" 1]
["2015-06-02T04:19:00.000Z" 1]
["2015-06-02T09:13:00.000Z" 1]
["2015-06-02T12:37:00.000Z" 1]
["2015-06-02T15:20:00.000Z" 1]
["2015-06-02T18:11:00.000Z" 1]]
:else
[["2015-06-01T10:31:00.000Z" 1]
["2015-06-01T16:06:00.000Z" 1]
["2015-06-01T17:23:00.000Z" 1]
......@@ -1300,7 +1288,19 @@
["2015-06-02T02:13:00.000Z" 1]
["2015-06-02T05:37:00.000Z" 1]
["2015-06-02T08:20:00.000Z" 1]
["2015-06-02T11:11:00.000Z" 1]])
["2015-06-02T11:11:00.000Z" 1]]
:else
[["2015-06-01T03:31:00.000Z" 1]
["2015-06-01T09:06:00.000Z" 1]
["2015-06-01T10:23:00.000Z" 1]
["2015-06-01T11:55:00.000Z" 1]
["2015-06-01T14:04:00.000Z" 1]
["2015-06-01T14:19:00.000Z" 1]
["2015-06-01T19:13:00.000Z" 1]
["2015-06-01T22:37:00.000Z" 1]
["2015-06-02T01:20:00.000Z" 1]
["2015-06-02T04:11:00.000Z" 1]])
(sad-toucan-incidents-with-bucketing :minute))
(expect-with-non-timeseries-dbs
......@@ -1331,18 +1331,6 @@
["2015-06-02 13:00:00" 1]]
(i/has-questionable-timezone-support? *data-loader*)
[["2015-06-01T17:00:00.000Z" 1]
["2015-06-01T23:00:00.000Z" 1]
["2015-06-02T00:00:00.000Z" 1]
["2015-06-02T01:00:00.000Z" 1]
["2015-06-02T04:00:00.000Z" 2]
["2015-06-02T09:00:00.000Z" 1]
["2015-06-02T12:00:00.000Z" 1]
["2015-06-02T15:00:00.000Z" 1]
["2015-06-02T18:00:00.000Z" 1]
["2015-06-02T20:00:00.000Z" 1]]
:else
[["2015-06-01T10:00:00.000Z" 1]
["2015-06-01T16:00:00.000Z" 1]
["2015-06-01T17:00:00.000Z" 1]
......@@ -1352,7 +1340,19 @@
["2015-06-02T05:00:00.000Z" 1]
["2015-06-02T08:00:00.000Z" 1]
["2015-06-02T11:00:00.000Z" 1]
["2015-06-02T13:00:00.000Z" 1]])
["2015-06-02T13:00:00.000Z" 1]]
:else
[["2015-06-01T03:00:00.000Z" 1]
["2015-06-01T09:00:00.000Z" 1]
["2015-06-01T10:00:00.000Z" 1]
["2015-06-01T11:00:00.000Z" 1]
["2015-06-01T14:00:00.000Z" 2]
["2015-06-01T19:00:00.000Z" 1]
["2015-06-01T22:00:00.000Z" 1]
["2015-06-02T01:00:00.000Z" 1]
["2015-06-02T04:00:00.000Z" 1]
["2015-06-02T06:00:00.000Z" 1]])
(sad-toucan-incidents-with-bucketing :hour))
(expect-with-non-timeseries-dbs
......@@ -1376,28 +1376,28 @@
["2015-06-10" 9]]
(i/has-questionable-timezone-support? *data-loader*)
[["2015-06-01T07:00:00.000Z" 6]
["2015-06-02T07:00:00.000Z" 10]
["2015-06-03T07:00:00.000Z" 4]
["2015-06-04T07:00:00.000Z" 9]
["2015-06-05T07:00:00.000Z" 9]
["2015-06-06T07:00:00.000Z" 8]
["2015-06-07T07:00:00.000Z" 8]
["2015-06-08T07:00:00.000Z" 9]
["2015-06-09T07:00:00.000Z" 7]
["2015-06-10T07:00:00.000Z" 9]]
[["2015-06-01T00:00:00.000Z" 6]
["2015-06-02T00:00:00.000Z" 10]
["2015-06-03T00:00:00.000Z" 4]
["2015-06-04T00:00:00.000Z" 9]
["2015-06-05T00:00:00.000Z" 9]
["2015-06-06T00:00:00.000Z" 8]
["2015-06-07T00:00:00.000Z" 8]
["2015-06-08T00:00:00.000Z" 9]
["2015-06-09T00:00:00.000Z" 7]
["2015-06-10T00:00:00.000Z" 9]]
:else
[["2015-06-01T07:00:00.000Z" 8]
["2015-06-02T07:00:00.000Z" 9]
["2015-06-03T07:00:00.000Z" 9]
["2015-06-04T07:00:00.000Z" 4]
["2015-06-05T07:00:00.000Z" 11]
["2015-06-06T07:00:00.000Z" 8]
["2015-06-07T07:00:00.000Z" 6]
["2015-06-08T07:00:00.000Z" 10]
["2015-06-09T07:00:00.000Z" 6]
["2015-06-10T07:00:00.000Z" 10]])
[["2015-06-01T00:00:00.000Z" 8]
["2015-06-02T00:00:00.000Z" 9]
["2015-06-03T00:00:00.000Z" 9]
["2015-06-04T00:00:00.000Z" 4]
["2015-06-05T00:00:00.000Z" 11]
["2015-06-06T00:00:00.000Z" 8]
["2015-06-07T00:00:00.000Z" 6]
["2015-06-08T00:00:00.000Z" 10]
["2015-06-09T00:00:00.000Z" 6]
["2015-06-10T00:00:00.000Z" 10]])
(sad-toucan-incidents-with-bucketing :day))
(expect-with-non-timeseries-dbs
......@@ -1428,18 +1428,18 @@
["2015-06-28" 7]]
(i/has-questionable-timezone-support? *data-loader*)
[["2015-05-31T07:00:00.000Z" 46]
["2015-06-07T07:00:00.000Z" 47]
["2015-06-14T07:00:00.000Z" 40]
["2015-06-21T07:00:00.000Z" 60]
["2015-06-28T07:00:00.000Z" 7]]
[["2015-05-31T00:00:00.000Z" 46]
["2015-06-07T00:00:00.000Z" 47]
["2015-06-14T00:00:00.000Z" 40]
["2015-06-21T00:00:00.000Z" 60]
["2015-06-28T00:00:00.000Z" 7]]
:else
[["2015-05-31T07:00:00.000Z" 49]
["2015-06-07T07:00:00.000Z" 47]
["2015-06-14T07:00:00.000Z" 39]
["2015-06-21T07:00:00.000Z" 58]
["2015-06-28T07:00:00.000Z" 7]])
[["2015-05-31T00:00:00.000Z" 49]
["2015-06-07T00:00:00.000Z" 47]
["2015-06-14T00:00:00.000Z" 39]
["2015-06-21T00:00:00.000Z" 58]
["2015-06-28T00:00:00.000Z" 7]])
(sad-toucan-incidents-with-bucketing :week))
(expect-with-non-timeseries-dbs
......@@ -1448,7 +1448,7 @@
(contains? #{:sqlserver :sqlite} *engine*)
[[23 54] [24 46] [25 39] [26 61]]
(contains? #{:mongo :redshift :bigquery} *engine*)
(contains? #{:mongo :redshift :bigquery :h2} *engine*)
[[23 46] [24 47] [25 40] [26 60] [27 7]]
:else
......@@ -1456,7 +1456,7 @@
(sad-toucan-incidents-with-bucketing :week-of-year))
(expect-with-non-timeseries-dbs
[[(if (= *engine* :sqlite) "2015-06-01", "2015-06-01T07:00:00.000Z") 200]]
[[(if (= *engine* :sqlite) "2015-06-01", "2015-06-01T00:00:00.000Z") 200]]
(sad-toucan-incidents-with-bucketing :month))
(expect-with-non-timeseries-dbs
......@@ -1464,7 +1464,7 @@
(sad-toucan-incidents-with-bucketing :month-of-year))
(expect-with-non-timeseries-dbs
[[(if (= *engine* :sqlite) "2015-04-01", "2015-04-01T07:00:00.000Z") 200]]
[[(if (= *engine* :sqlite) "2015-04-01", "2015-04-01T00:00:00.000Z") 200]]
(sad-toucan-incidents-with-bucketing :quarter))
(expect-with-non-timeseries-dbs
......
......@@ -96,5 +96,5 @@
:engine (constantly :h2)
:format-name (fn [_ table-or-field-name]
(s/upper-case table-or-field-name))
:has-questionable-timezone-support? (constantly false)
:has-questionable-timezone-support? (constantly true)
:id-field-type (constantly :BigIntegerField)}))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment