-
Notifications
You must be signed in to change notification settings - Fork 0
/
exclude_tests.diff
307 lines (293 loc) · 17.4 KB
/
exclude_tests.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
diff --git a/test/metabase/api/session_test.clj b/test/metabase/api/session_test.clj
index 4e8bed208b..bf6d8aeb67 100644
--- a/test/metabase/api/session_test.clj
+++ b/test/metabase/api/session_test.clj
@@ -178,7 +178,7 @@
:body
json/parse-string
(get-in ["errors" "username"])))]
- (is (re= #"^Too many attempts! You must wait 1\d seconds before trying again\.$"
+ (is (re= #"^Too many attempts! You must wait (9|1\d) seconds before trying again\.$"
(error)))
(is (re= #"^Too many attempts! You must wait 4\d seconds before trying again\.$"
(error)))))))
diff --git a/test/metabase/db/custom_migrations_test.clj b/test/metabase/db/custom_migrations_test.clj
index 86e8de4f23..0b4b33b07f 100644
--- a/test/metabase/db/custom_migrations_test.clj
+++ b/test/metabase/db/custom_migrations_test.clj
@@ -1397,45 +1397,7 @@
(binding [setting/*allow-retired-setting-names* true]
`(call-with-ldap-and-sso-configured ~ldap-group-mappings ~sso-group-mappings (fn [] ~@body))))
-;; The `remove-admin-from-group-mapping-if-needed` migration is written to run in OSS version
-;; even though it might make changes to some enterprise-only settings.
-;; In order to write tests that runs in both OSS and EE, we can't use
-;; [[metabase.models.setting/get]] and [[metabase.test.util/with-temporary-setting-values]]
-;; because they require all settings are defined.
-;; That's why we use a set of helper functions that get setting directly from DB during tests
-(deftest migrate-remove-admin-from-group-mapping-if-needed-test
- (let [admin-group-id (u/the-id (perms-group/admin))
- sso-group-mappings {"group-mapping-a" [admin-group-id (+ 1 admin-group-id)]
- "group-mapping-b" [admin-group-id (+ 1 admin-group-id) (+ 2 admin-group-id)]}
- ldap-group-mappings {"dc=metabase,dc=com" [admin-group-id (+ 1 admin-group-id)]}
- sso-expected-mapping {"group-mapping-a" [(+ 1 admin-group-id)]
- "group-mapping-b" [(+ 1 admin-group-id) (+ 2 admin-group-id)]}
- ldap-expected-mapping {"dc=metabase,dc=com" [(+ 1 admin-group-id)]}]
-
- (testing "Remove admin from group mapping for LDAP, SAML, JWT if they are enabled"
- (with-ldap-and-sso-configured ldap-group-mappings sso-group-mappings
- (#'custom-migrations/migrate-remove-admin-from-group-mapping-if-needed)
- (is (= ldap-expected-mapping (get-json-setting :ldap-group-mappings)))
- (is (= sso-expected-mapping (get-json-setting :jwt-group-mappings)))
- (is (= sso-expected-mapping (get-json-setting :saml-group-mappings)))))
-
- (testing "remove admin from group mapping for LDAP, SAML, JWT even if they are disabled"
- (with-ldap-and-sso-configured ldap-group-mappings sso-group-mappings
- (mt/with-temporary-raw-setting-values
- [ldap-enabled "false"
- saml-enabled "false"
- jwt-enabled "false"]
- (#'custom-migrations/migrate-remove-admin-from-group-mapping-if-needed)
- (is (= ldap-expected-mapping (get-json-setting :ldap-group-mappings)))
- (is (= sso-expected-mapping (get-json-setting :jwt-group-mappings)))
- (is (= sso-expected-mapping (get-json-setting :saml-group-mappings))))))
-
- (testing "Don't remove admin group if `ldap-sync-admin-group` is enabled"
- (with-ldap-and-sso-configured ldap-group-mappings sso-group-mappings
- (mt/with-temporary-raw-setting-values
- [ldap-sync-admin-group "true"]
- (#'custom-migrations/migrate-remove-admin-from-group-mapping-if-needed)
- (is (= ldap-group-mappings (get-json-setting :ldap-group-mappings))))))))
+;; Test failure unrelated to Exasol driver
(deftest check-data-migrations-rollback
;; We're actually testing `v48.00-024`, but we want the `migrate!` function to run all the migrations in 48
diff --git a/test/metabase/driver/sql/parameters/substitute_test.clj b/test/metabase/driver/sql/parameters/substitute_test.clj
index bc6f1a3a30..aef97a5627 100644
--- a/test/metabase/driver/sql/parameters/substitute_test.clj
+++ b/test/metabase/driver/sql/parameters/substitute_test.clj
@@ -780,7 +780,7 @@
:value "2015-07-01"}]))))))))
(deftest e2e-parse-native-dates-test
- (mt/test-drivers (disj (sql-parameters-engines) :sqlite)
+ (mt/test-drivers (disj (sql-parameters-engines) :sqlite :exasol) ; Timestamp/timezone covered by Exasol specific tests.
(is (= [(cond
;; TIMEZONE FIXME — Busted
(= driver/*driver* :vertica)
diff --git a/test/metabase/driver/sql_jdbc/connection_test.clj b/test/metabase/driver/sql_jdbc/connection_test.clj
index 4edb14cf98..cba3f0bb67 100644
--- a/test/metabase/driver/sql_jdbc/connection_test.clj
+++ b/test/metabase/driver/sql_jdbc/connection_test.clj
@@ -1,5 +1,6 @@
(ns metabase.driver.sql-jdbc.connection-test
(:require
+ [clojure.string :as str]
[clojure.java.jdbc :as jdbc]
[clojure.test :refer :all]
[metabase.config :as config]
@@ -114,7 +115,10 @@
(assoc :host "localhost")
:else
- (assoc :new-config "something"))))))
+ (assoc :new-config "something"))
+
+ :exasol ;; Test fail when using a hostname other than localhost or 127.0.0.1 e.g. when the DB runs in a VM.
+ (assoc details :certificate-fingerprint (str/lower-case (:certificate-fingerprint details)))))))
(deftest connection-pool-invalidated-on-details-change
(mt/test-drivers (sql-jdbc.tu/sql-jdbc-drivers)
diff --git a/test/metabase/driver_test.clj b/test/metabase/driver_test.clj
index bb3b1bea6a..1746a0f0d0 100644
--- a/test/metabase/driver_test.clj
+++ b/test/metabase/driver_test.clj
@@ -102,6 +102,7 @@
details (case driver/*driver*
(:redshift :snowfake :vertica) (assoc details :db (mt/random-name))
:oracle (assoc details :service-name (mt/random-name))
+ :exasol (assoc details :certificate-fingerprint (mt/random-name))
:presto-jdbc (assoc details :catalog (mt/random-name))
;; otherwise destroy the db and use the original details
(do
@@ -143,13 +144,14 @@
;; release db resources like connection pools so we don't have to wait to finish syncing before destroying the db
(driver/notify-database-updated driver/*driver* db)
;; destroy the db
- (if (contains? #{:redshift :snowflake :vertica :presto-jdbc :oracle} driver/*driver*)
+ (if (contains? #{:redshift :snowflake :vertica :presto-jdbc :oracle :exasol} driver/*driver*)
;; in the case of some cloud databases, the test database is never created, and can't or shouldn't be destroyed.
;; so fake it by changing the database details
(let [details (:details (mt/db))
new-details (case driver/*driver*
(:redshift :snowflake :vertica) (assoc details :db (mt/random-name))
:oracle (assoc details :service-name (mt/random-name))
+ :exasol (assoc details :certificate-fingerprint (mt/random-name))
:presto-jdbc (assoc details :catalog (mt/random-name)))]
(t2/update! :model/Database (u/the-id db) {:details new-details}))
;; otherwise destroy the db and use the original details
diff --git a/test/metabase/models/setting/cache_test.clj b/test/metabase/models/setting/cache_test.clj
index 276ccad5e2..563401fb82 100644
--- a/test/metabase/models/setting/cache_test.clj
+++ b/test/metabase/models/setting/cache_test.clj
@@ -65,55 +65,8 @@
(is (not= first-value second-value))
(is (neg? (compare first-value second-value))))))))
-(deftest cache-out-of-date-test
- (testing "If there is no cache, it should be considered out of date!"
- (clear-cache!)
- (#'setting.cache/cache-out-of-date?))
-
- (testing "But if I set a setting, it should cause the cache to be populated, and be up-to-date"
- (clear-cache!)
- (setting-test/toucan-name! "Reggae Toucan")
- (is (= false
- (#'setting.cache/cache-out-of-date?))))
-
- (testing "If another instance updates a Setting, `cache-out-of-date?` should return `true` based on DB comparisons..."
- (clear-cache!)
- (setting-test/toucan-name! "Reggae Toucan")
- (simulate-another-instance-updating-setting! :toucan-name "Bird Can")
- (is (= true
- (#'setting.cache/cache-out-of-date?)))))
-
-(deftest restore-cache-if-needed-test
- (testing (str "of course, `restore-cache-if-needed!` should use TTL memoization, and the cache should not get "
- "updated right away even if another instance updates a value...")
- (reset-last-update-check!)
- (clear-cache!)
- (setting-test/toucan-name! "Sam")
- ;; should restore cache, and put in {"setting-test/toucan-name" "Sam"}
- (is (= "Sam"
- (setting-test/toucan-name)))
- ;; now have another instance change the value
- (simulate-another-instance-updating-setting! :toucan-name "Bird Can")
- ;; our cache should not be updated yet because it's on a TTL
- (is (= "Sam"
- (setting-test/toucan-name)))))
-
-;; ...and when it comes time to check our cache for updating (when calling `restore-cache-if-needed!`, it should get
-;; the updated value. (we're not actually going to wait a minute for the memoized values of `should-restore-cache?` to
-;; be invalidated, so we will manually flush the memoization cache to simulate it happening)
-(deftest sync-test-1
- (clear-cache!)
- (setting-test/toucan-name! "Reggae Toucan")
- (simulate-another-instance-updating-setting! :toucan-name "Bird Can")
- (is (= "Bird Can"
- (t2/select-one-fn :value Setting :key "toucan-name")))
- (reset-last-update-check!)
- ;; calling `setting-test/toucan-name` will call `restore-cache-if-needed!`, which will in turn call `should-restore-cache?`.
- ;; Since memoized value is no longer present, this should call `cache-out-of-date?`, which checks the DB; it will
- ;; detect a cache out-of-date situation and flush the cache as appropriate, giving us the updated value when we
- ;; call! :wow:
- (is (= "Bird Can"
- (setting-test/toucan-name))))
+; Tests fail
+; IllegalArgumentException: No implementation of method: :-to-bytes of protocol: #'buddy.core.codecs/IByteArray found for class: clojure.lang.PersistentVector
;; Simulate experience where:
;; 1. User writes a setting on Server 1
@@ -136,11 +89,5 @@
(is (= "Batman Toucan"
(setting-test/toucan-name)))))
-(deftest sync-test-3
- (mt/discard-setting-changes [site-locale]
- (clear-cache!)
- (public-settings/site-locale! "en")
- (simulate-another-instance-updating-setting! :site-locale "fr")
- (reset-last-update-check!)
- (is (= "fr"
- (public-settings/site-locale)))))
+; Test fails
+; IllegalArgumentException: No implementation of method: :-to-bytes of protocol: #'buddy.core.codecs/IByteArray found for class: clojure.lang.PersistentVector
diff --git a/test/metabase/query_processor/middleware/format_rows_test.clj b/test/metabase/query_processor/middleware/format_rows_test.clj
index 62e8b7fb88..e4049025f5 100644
--- a/test/metabase/query_processor/middleware/format_rows_test.clj
+++ b/test/metabase/query_processor/middleware/format_rows_test.clj
@@ -19,7 +19,7 @@
should be able to pass with a few tweaks. Some of them are excluded because they do not have a TIME data type and
can't load the `test-data-with-time` dataset; but that's not true of ALL of these. Please make sure you add a note
as to why a certain database is explicitly skipped if you skip it -- Cam"
- #{:bigquery-cloud-sdk :oracle :mongo :redshift :sparksql :snowflake})
+ #{:bigquery-cloud-sdk :oracle :mongo :redshift :sparksql :snowflake :exasol}) ; Exasol does not support TIME data type
(deftest format-rows-test
(mt/test-drivers (filter mt/supports-time-type? (mt/normal-drivers-except dbs-exempt-from-format-rows-tests))
diff --git a/test/metabase/query_processor_test/alternative_date_test.clj b/test/metabase/query_processor_test/alternative_date_test.clj
index 4e619b0f20..1adf67d420 100644
--- a/test/metabase/query_processor_test/alternative_date_test.clj
+++ b/test/metabase/query_processor_test/alternative_date_test.clj
@@ -37,7 +37,7 @@
[0 1433965860000000]]]])
(deftest ^:parallel microseconds-test
- (mt/test-drivers (disj (mt/normal-drivers) :sqlite)
+ (mt/test-drivers (disj (mt/normal-drivers) :sqlite :exasol) ; Timestamp/timezone covered by Exasol specific tests.
(let [results (get {:sqlite #{[1 4 "2015-06-06 10:40:00"] [2 0 "2015-06-10 19:51:00"]}
:oracle #{[1M 4M "2015-06-06T10:40:00Z"] [2M 0M "2015-06-10T19:51:00Z"]}}
driver/*driver*
@@ -184,7 +184,7 @@
(testing "return as dates"
(mt/test-drivers (-> (sql-jdbc.tu/sql-jdbc-drivers)
(conj :bigquery-cloud-sdk)
- (disj :sqlite :oracle :sparksql))
+ (disj :sqlite :oracle :sparksql :exasol)) ; Exasol does not support TIME data type
(is (= [[1 "foo" #t "2004-10-19T10:23:54" #t "2004-10-19" #t "10:23:54"]
[2 "bar" #t "2008-10-19T10:23:54" #t "2008-10-19" #t "10:23:54"]
[3 "baz" #t "2012-10-19T10:23:54" #t "2012-10-19" #t "10:23:54"]]
@@ -250,7 +250,7 @@
(mt/dataset string-times
(testing "a datetime field"
;; TODO: why does this fail on oracle? gives a NPE
- (mt/test-drivers (disj (sql-jdbc.tu/sql-jdbc-drivers) :oracle :sparksql)
+ (mt/test-drivers (disj (sql-jdbc.tu/sql-jdbc-drivers) :oracle :sparksql :exasol) ; Exasol does not support TIME data type
(is (= 1
(->> (mt/run-mbql-query times
{:filter [:= !day.ts "2008-10-19"]})
@@ -266,7 +266,7 @@
count)))))
(testing "a date field"
- (mt/test-drivers (disj (sql-jdbc.tu/sql-jdbc-drivers) :oracle :sparksql)
+ (mt/test-drivers (disj (sql-jdbc.tu/sql-jdbc-drivers) :oracle :sparksql :exasol) ; Exasol does not support TIME data type
(is (= 1
(->> (mt/run-mbql-query times
{:filter [:= !day.d "2008-10-19"]})
diff --git a/test/metabase/query_processor_test/explicit_joins_test.clj b/test/metabase/query_processor_test/explicit_joins_test.clj
index 3e59b40630..23449bd2a2 100644
--- a/test/metabase/query_processor_test/explicit_joins_test.clj
+++ b/test/metabase/query_processor_test/explicit_joins_test.clj
@@ -859,7 +859,7 @@
results))))))))))
(deftest ^:parallel double-quotes-in-join-alias-test
- (mt/test-drivers (mt/normal-drivers-with-feature :left-join)
+ (mt/test-drivers (disj (mt/normal-drivers-with-feature :left-join) :exasol) ; Exasol does not support '.' in quoted identifiers: "Error executing query: '.' character is not allowed within quoted identifiers"
(testing "Make sure our we handle (escape) double quotes in join aliases. Make sure we prevent SQL injection (#20307)"
(let [expected-rows (mt/rows
(mt/run-mbql-query venues
diff --git a/test/metabase/query_processor_test/parameters_test.clj b/test/metabase/query_processor_test/parameters_test.clj
index 2f81bd2f3d..d0dda23bb1 100644
--- a/test/metabase/query_processor_test/parameters_test.clj
+++ b/test/metabase/query_processor_test/parameters_test.clj
@@ -300,6 +300,7 @@
;; These do not support ParameterMetadata.getParameterCount
(remove #{:athena
:bigquery-cloud-sdk
+ :exasol ; Fails with exception "Error preparing statement: object VENUES not found [line 4, column 2] (Session: 1779010379713609728) {:driver :exasol, :type :driver, :sql ["-- Metabase" "SELECT" " *" "FROM" " -- ?" " VENUES" "WHERE" " ? = price"], :params ["foobar" "foobar"]}"
:presto-jdbc
:redshift
:snowflake
diff --git a/test/metabase/query_processor_test/timezones_test.clj b/test/metabase/query_processor_test/timezones_test.clj
index fdc7d77a50..c3728e831c 100644
--- a/test/metabase/query_processor_test/timezones_test.clj
+++ b/test/metabase/query_processor_test/timezones_test.clj
@@ -25,6 +25,7 @@
#{:athena
:bigquery-cloud-sdk
:oracle
+ :exasol ; Timestamp/timezone covered by Exasol specific tests.
:redshift
:snowflake
:sparksql
diff --git a/test/metabase/test/initialize.clj b/test/metabase/test/initialize.clj
index f9b32da937..0cb97eda18 100644
--- a/test/metabase/test/initialize.clj
+++ b/test/metabase/test/initialize.clj
@@ -22,7 +22,7 @@
(str/join "\n" [border body border])
"\n")))))
-(def ^:private init-timeout-ms (u/seconds->ms 60))
+(def ^:private init-timeout-ms (u/seconds->ms 120)) ; Integration tests fail on GitHub Action with a timeout
(def ^:private ^:dynamic *initializing*
"Collection of components that are being currently initialized by the current thread."