diff --git a/.clj-kondo/test/hooks/clojure/test_test.clj b/.clj-kondo/test/hooks/clojure/test_test.clj index 19bf39b462102075526370191b98a63d2ba91b58..bcd487a1c905beffec5ec3d4a6ebdfb65da9f304 100644 --- a/.clj-kondo/test/hooks/clojure/test_test.clj +++ b/.clj-kondo/test/hooks/clojure/test_test.clj @@ -3,7 +3,6 @@ [clj-kondo.hooks-api :as api] [clj-kondo.impl.utils] [clojure.edn :as edn] - [clojure.java.io :as io] [clojure.test :refer :all] [hooks.clojure.test])) @@ -44,9 +43,13 @@ (testing "Make sure we keep hooks.clojure.test/driver-keywords up to date" (let [driver-keywords (-> (slurp ".clj-kondo/config.edn") edn/read-string - (get-in [:linters :metabase/disallow-hardcoded-driver-names-in-tests :drivers]))] - (doseq [^java.io.File file (.listFiles (io/file "modules/drivers")) - :when (.isDirectory file) - :let [driver (keyword (.getName file))]] + (get-in [:linters :metabase/disallow-hardcoded-driver-names-in-tests :drivers])) + driver-modules (->> (slurp "modules/drivers/deps.edn") + edn/read-string + :deps + vals + (keep (comp keyword :local/root)) + (into #{}))] + (doseq [driver driver-modules] (is (contains? driver-keywords driver) (format "hooks.clojure.test/driver-keywords should contain %s, please add it" driver)))))) diff --git a/test/metabase/api/pivots.clj b/test/metabase/api/pivots.clj index 359228bafdae263cf4391e6f79c9d44504803e87..5b2541e49ada0bc1e44271a2cd408e26093037ff 100644 --- a/test/metabase/api/pivots.clj +++ b/test/metabase/api/pivots.clj @@ -5,9 +5,7 @@ (defn applicable-drivers "Drivers that these pivot table tests should run on" [] - (disj (mt/normal-drivers-with-feature :expressions :left-join) - ;; mongodb doesn't support foreign keys required by this test - :mongo + (disj (mt/normal-drivers-with-feature :expressions :left-join :metadata/key-constraints) ;; Disable on Redshift due to OutOfMemory issue (see #18834) :redshift)) diff --git a/test/metabase/events/view_log_test.clj b/test/metabase/events/view_log_test.clj index 56448181b8d24d29a833350f27bc44ed49b1766b..a377b8e0e0ccb15ec112f158db1da770a0a351cd 100644 --- a/test/metabase/events/view_log_test.clj +++ b/test/metabase/events/view_log_test.clj @@ -61,7 +61,12 @@ (latest-view (mt/user->id :crowberto) (u/id coll)))))))) (deftest update-view-dashboard-timestamp-test - (let [now (t/offset-date-time) + ;; the DB might save `last_used_at` with a different level of precision than the JVM does, on some machines + ;; `offset-date-time` returns nanosecond precision (9 decimal places) but `last_viewed_at` is coming back with + ;; microsecond precision (6 decimal places). We don't care about such a small difference, just strip it off of the + ;; times we're comparing. + (let [now (-> (t/offset-date-time) + (.withNano 0)) one-hour-ago (t/minus now (t/hours 1)) two-hours-ago (t/minus now (t/hours 2))] (testing "update with multiple dashboards of the same ids will set timestamp to the latest"