Skip to content

Commit

Permalink
Update excluded tests list
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyiliev committed Dec 20, 2024
1 parent 09ddaae commit 6ac710b
Showing 1 changed file with 53 additions and 70 deletions.
123 changes: 53 additions & 70 deletions scripts/exclude_tests.diff
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
diff --git a/test/metabase/db/metadata_queries_test.clj b/test/metabase/db/metadata_queries_test.clj
index 7373655654..25eb5da352 100644
--- a/test/metabase/db/metadata_queries_test.clj
+++ b/test/metabase/db/metadata_queries_test.clj
@@ -45,13 +45,7 @@
(sort-by first)
(take 5))]
(is (= :type/Text (-> fields first :base_type)))
- (is (= expected (fetch! nil)))
- (testing "truncates text fields (see #13288)"
- (doseq [size [1 4 80]]
- (is (= (mapv (fn [[s]] [(subs (or s "") 0 (min size (count s)))])
- expected)
- (fetch! size))
- "Did not truncate a text field")))))
+ (is (= expected (fetch! nil)))))

(testing "substring checking"
(with-redefs [driver.u/database->driver (constantly (:engine (mt/db)))
diff --git a/test/metabase/driver_test.clj b/test/metabase/driver_test.clj
index a506be0a66..cf358e20b2 100644
index 823944f5a9..b7787a0505 100644
--- a/test/metabase/driver_test.clj
+++ b/test/metabase/driver_test.clj
@@ -106,7 +106,7 @@
@@ -107,7 +107,7 @@
(do
(tx/destroy-db! driver/*driver* dbdef)
details))]
Expand All @@ -30,7 +11,7 @@ index a506be0a66..cf358e20b2 100644
(binding [h2/*allow-testing-h2-connections* true]
(driver/can-connect? driver/*driver* details))
(catch Exception _
@@ -144,7 +144,7 @@
@@ -146,7 +146,7 @@
;; so fake it by changing the database details
(let [details (:details (mt/db))
new-details (case driver/*driver*
Expand All @@ -39,7 +20,7 @@ index a506be0a66..cf358e20b2 100644
:oracle (assoc details :service-name (mt/random-name))
:presto-jdbc (assoc details :catalog (mt/random-name)))]
(t2/update! :model/Database (u/the-id db) {:details new-details}))
@@ -152,9 +152,9 @@
@@ -154,9 +154,9 @@
(tx/destroy-db! driver/*driver* dbdef))
(testing "after deleting a database, sync should fail"
(testing "1: sync-and-analyze-database! should log a warning and fail early"
Expand All @@ -52,47 +33,50 @@ index a506be0a66..cf358e20b2 100644
(t2/delete! :model/Database (u/the-id db))))))))

diff --git a/test/metabase/query_processor_test/date_bucketing_test.clj b/test/metabase/query_processor_test/date_bucketing_test.clj
index 6e469bb152..f5f817715b 100644
index f8d56f350d..afc708c5b6 100644
--- a/test/metabase/query_processor_test/date_bucketing_test.clj
+++ b/test/metabase/query_processor_test/date_bucketing_test.clj
@@ -184,7 +184,7 @@

;; There's a bug here where we are reading in the UTC time as pacific, so we're 7 hours off
;; (This is fixed for Oracle now)
- (and (qp.test-util/tz-shifted-driver-bug? driver/*driver*) (not= driver/*driver* :oracle))
+ (and (qp.test-util/tz-shifted-driver-bug? driver/*driver*) (not= driver/*driver* :oracle) (not= driver/*driver* :materialize))
[["2015-06-01T10:31:00-07:00" 1]
["2015-06-01T16:06:00-07:00" 1]
["2015-06-01T17:23:00-07:00" 1]
@@ -242,7 +242,7 @@
["2015-06-02 08:20:00" 1]
["2015-06-02 11:11:00" 1]]

- (and (qp.test-util/tz-shifted-driver-bug? driver/*driver*) (not= driver/*driver* :oracle))
+ (and (qp.test-util/tz-shifted-driver-bug? driver/*driver*) (not= driver/*driver* :oracle) (not= driver/*driver* :materialize))
[["2015-06-01T10:31:00-04:00" 1]
["2015-06-01T16:06:00-04:00" 1]
["2015-06-01T17:23:00-04:00" 1]
@@ -195,7 +195,7 @@
(cond
;; There's a bug here where we are reading in the UTC time as pacific, so we're 7 hours off
;; (This is fixed for Oracle now)
- (and (qp.test-util/tz-shifted-driver-bug? driver) (not= driver :oracle))
+ (and (qp.test-util/tz-shifted-driver-bug? driver) (not= driver :oracle) (not= driver :materialize))
[["2015-06-01T10:31:00-07:00" 1]
["2015-06-01T16:06:00-07:00" 1]
["2015-06-01T17:23:00-07:00" 1]
@@ -267,7 +267,7 @@
(defmethod group-by-default-test-2-expected-rows :default
[driver]
(cond
- (and (qp.test-util/tz-shifted-driver-bug? driver) (not= driver :oracle))
+ (and (qp.test-util/tz-shifted-driver-bug? driver) (not= driver :oracle) (not= driver :materialize))
[["2015-06-01T10:31:00-04:00" 1]
["2015-06-01T16:06:00-04:00" 1]
["2015-06-01T17:23:00-04:00" 1]
diff --git a/test/metabase/query_processor_test/explicit_joins_test.clj b/test/metabase/query_processor_test/explicit_joins_test.clj
index ded26c8e97..4608b25854 100644
index 507902de93..55c3fbc5c6 100644
--- a/test/metabase/query_processor_test/explicit_joins_test.clj
+++ b/test/metabase/query_processor_test/explicit_joins_test.clj
@@ -270,8 +270,8 @@
@@ -277,11 +277,11 @@
[_driver _feature _database]
true)

-;;; mongodb doesn't support foreign keys required by some tests below.
+;;; mongodb and materialize do't support foreign keys required by some tests below.
;;;
;;; TODO -- not sure what exactly this means. Maybe it was talking about marking FKs automatically during sync? Since we
;;; now do that manually for DBs like MongoDB maybe we can enable these tests for Mongo.
-(defmethod driver/database-supports? [:mongo ::foreign-keys-as-required-by-tests]
+(defmethod driver/database-supports? [:materialize ::foreign-keys-as-required-by-tests]
[_driver _feature _database]
false)

(deftest ^:parallel select-*-source-query-test
(mt/test-drivers (disj (mt/normal-drivers-with-feature :left-join)
- ;; mongodb doesn't support foreign keys required by this test
- :mongo)
+ ;; mongodb and materialize don't support foreign keys required by this test
+ :mongo :materialize)
(testing "We should be able to run a query that for whatever reason ends up with a `SELECT *` for the source query"
(let [{:keys [rows columns]} (mt/format-rows-by [int int]
(mt/rows+column-names
diff --git a/test/metabase/test/data/dataset_definition_test.clj b/test/metabase/test/data/dataset_definition_test.clj
index 25ead15772..f830d1c2ff 100644
index b5bd814af2..6b4539c7f9 100644
--- a/test/metabase/test/data/dataset_definition_test.clj
+++ b/test/metabase/test/data/dataset_definition_test.clj
@@ -8,52 +8,8 @@
@@ -7,51 +7,8 @@
[metabase.timeseries-query-processor-test.util :as tqpt]
[toucan2.core :as t2]))

Expand All @@ -102,12 +86,12 @@ index 25ead15772..f830d1c2ff 100644
- ;; Timeseries drivers currently support only testing with pre-loaded dataset
- (remove (tqpt/timeseries-drivers)))
- (mt/dataset (mt/dataset-definition "custom-pk"
- ["user"
- [{:field-name "custom_id" :base-type :type/Integer :pk? true}]
- [[1]]]
- ["group"
- [{:field-name "user_custom_id" :base-type :type/Integer :fk "user"}]
- [[1]]])
- ["user"
- [{:field-name "custom_id" :base-type :type/Integer :pk? true}]
- [[1]]]
- ["group"
- [{:field-name "user_custom_id" :base-type :type/Integer :fk "user"}]
- [[1]]])
- (let [user-fields (t2/select [:model/Field :name :semantic_type :fk_target_field_id] :table_id (mt/id :user))
- group-fields (t2/select [:model/Field :name :semantic_type :fk_target_field_id] :table_id (mt/id :group))
- format-name #(ddl.i/format-name driver/*driver* %)]
Expand All @@ -116,15 +100,14 @@ index 25ead15772..f830d1c2ff 100644
- :fk_target_field_id nil
- :semantic_type :type/PK}]
- user-fields)))
- (when (driver.u/supports? driver/*driver* :foreign-keys (mt/db))
- (testing "user_custom_id is a FK non user.custom_id"
- (is (= #{{:name (format-name "user_custom_id")
- :fk_target_field_id (mt/id :user :custom_id)
- :semantic_type :type/FK}
- {:name (format-name "id")
- :fk_target_field_id nil
- :semantic_type :type/PK}}
- (set group-fields)))))))))
- (testing "user_custom_id is a FK non user.custom_id"
- (is (= #{{:name (format-name "user_custom_id")
- :fk_target_field_id (mt/id :user :custom_id)
- :semantic_type :type/FK}
- {:name (format-name "id")
- :fk_target_field_id nil
- :semantic_type :type/PK}}
- (set group-fields))))))))
-
(mt/defdataset composite-pk
[["songs"
Expand Down

0 comments on commit 6ac710b

Please sign in to comment.