Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Set *warn-on-reflection* for clj-kondo 2026.10.20 (#85898)

Chris Trutere36cd62be052
diff --git a/bin/build/src/metabuild_common/env.clj b/bin/build/src/metabuild_common/env.clj
index 76a0ecc7caf..73be2feea9b 100644
--- a/bin/build/src/metabuild_common/env.clj
+++ b/bin/build/src/metabuild_common/env.clj
@@ -3,6 +3,8 @@
[clojure.string :as str]
[environ.core :as env]))
+(set! *warn-on-reflection* true)
+
(defn env-or-throw
"Fetch an env var value or throw an Exception if it is unset."
[k]
diff --git a/enterprise/backend/src/metabase_enterprise/audit_app/query_processor/middleware/handle_audit_queries.clj b/enterprise/backend/src/metabase_enterprise/audit_app/query_processor/middleware/handle_audit_queries.clj
index 08f09977893..5f9f846b80c 100644
--- a/enterprise/backend/src/metabase_enterprise/audit_app/query_processor/middleware/handle_audit_queries.clj
+++ b/enterprise/backend/src/metabase_enterprise/audit_app/query_processor/middleware/handle_audit_queries.clj
@@ -53,6 +53,8 @@
[metabase.util.malli.registry :as mr]
[metabase.util.malli.schema :as ms]))
+(set! *warn-on-reflection* true)
+
(defn- check-results-and-metadata-keys-match
"Primarily for dev and debugging purposes. We can probably take this out when shipping the finished product."
[results metadata]
diff --git a/enterprise/backend/test/metabase_enterprise/remote_sync/impl_test.clj b/enterprise/backend/test/metabase_enterprise/remote_sync/impl_test.clj
index ef2284430ca..8e5586d9926 100644
--- a/enterprise/backend/test/metabase_enterprise/remote_sync/impl_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/remote_sync/impl_test.clj
@@ -25,6 +25,8 @@
[metabase.util.yaml :as yaml]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
(use-fixtures :once (fixtures/initialize :db))
;; `reindex!` below is ok in a parallel test since it's not actually executing anything
diff --git a/enterprise/backend/test/metabase_enterprise/remote_sync/source/ingestable_test.clj b/enterprise/backend/test/metabase_enterprise/remote_sync/source/ingestable_test.clj
index 01715759e0e..251116fefb2 100644
--- a/enterprise/backend/test/metabase_enterprise/remote_sync/source/ingestable_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/remote_sync/source/ingestable_test.clj
@@ -10,6 +10,8 @@
[metabase.test.fixtures :as fixtures]
[metabase.users.settings]))
+(set! *warn-on-reflection* true)
+
(comment metabase.audit-app.events.audit-log/keep-me
metabase.users.settings/keep-me)
diff --git a/enterprise/backend/test/metabase_enterprise/remote_sync/source/wrapping_source_test.clj b/enterprise/backend/test/metabase_enterprise/remote_sync/source/wrapping_source_test.clj
index 301c063ad24..bf7dbfe90e2 100644
--- a/enterprise/backend/test/metabase_enterprise/remote_sync/source/wrapping_source_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/remote_sync/source/wrapping_source_test.clj
@@ -4,6 +4,8 @@
[metabase-enterprise.remote-sync.source :as source]
[metabase-enterprise.remote-sync.source.protocol :as source.p]))
+(set! *warn-on-reflection* true)
+
(defrecord MockSourceSnapshot [files]
source.p/SourceSnapshot
(list-files [_]
diff --git a/enterprise/backend/test/metabase_enterprise/remote_sync/test_helpers.clj b/enterprise/backend/test/metabase_enterprise/remote_sync/test_helpers.clj
index 4bceda44d5d..88ad120e8eb 100644
--- a/enterprise/backend/test/metabase_enterprise/remote_sync/test_helpers.clj
+++ b/enterprise/backend/test/metabase_enterprise/remote_sync/test_helpers.clj
@@ -12,6 +12,8 @@
[metabase.util :as u]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
(defn generate-collection-yaml
"Generate YAML content for a collection with the given `entity-id` and `name`.
Optionally accepts `:parent-id` for nested collections, `:namespace` for namespace collections (e.g.,
diff --git a/enterprise/backend/test/metabase_enterprise/scim/v2/api_test.clj b/enterprise/backend/test/metabase_enterprise/scim/v2/api_test.clj
index 29f8e1bb320..46b280e7a75 100644
--- a/enterprise/backend/test/metabase_enterprise/scim/v2/api_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/scim/v2/api_test.clj
@@ -11,6 +11,8 @@
[ring.util.codec :as codec]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
(use-fixtures :once (fixtures/initialize :test-users))
(def ^:dynamic *scim-api-key* nil)
diff --git a/enterprise/backend/test/metabase_enterprise/search/entity_retrieval/index_table_test.clj b/enterprise/backend/test/metabase_enterprise/search/entity_retrieval/index_table_test.clj
index a14338249ce..88890632f20 100644
--- a/enterprise/backend/test/metabase_enterprise/search/entity_retrieval/index_table_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/search/entity_retrieval/index_table_test.clj
@@ -10,6 +10,8 @@
[next.jdbc :as jdbc]
[next.jdbc.result-set :as jdbc.rs]))
+(set! *warn-on-reflection* true)
+
(deftest legacy-meta-table-without-ownership-test
(testing "a grant-only role neither attempts ALTER nor repeatedly warns"
(log.capture/with-log-messages-for-level [messages [metabase-enterprise.search.entity-retrieval.index-table :warn]]
diff --git a/enterprise/backend/test/metabase_enterprise/search/semantic/db/store_health_test.clj b/enterprise/backend/test/metabase_enterprise/search/semantic/db/store_health_test.clj
index 720baedb97b..493ca79d253 100644
--- a/enterprise/backend/test/metabase_enterprise/search/semantic/db/store_health_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/search/semantic/db/store_health_test.clj
@@ -12,6 +12,8 @@
[metabase.app-db.core :as mdb]
[metabase.test :as mt]))
+(set! *warn-on-reflection* true)
+
(defn- readiness-gauges
"Every readiness gauge for both storage labels, as `{storage {:available _ :connected _ :last-success _}}`."
[system]
diff --git a/enterprise/backend/test/metabase_enterprise/search/semantic/task/index_repair_test.clj b/enterprise/backend/test/metabase_enterprise/search/semantic/task/index_repair_test.clj
index cdb51183209..9ed2aa3c8a0 100644
--- a/enterprise/backend/test/metabase_enterprise/search/semantic/task/index_repair_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/search/semantic/task/index_repair_test.clj
@@ -9,6 +9,8 @@
[metabase.test :as mt]
[next.jdbc :as jdbc]))
+(set! *warn-on-reflection* true)
+
(deftest successful-repair-reports-current-metric-snapshot-test
(let [reported (atom [])
snapshot-at ::snapshot-at]
diff --git a/enterprise/backend/test/metabase_enterprise/search/semantic/task/metric_collector_test.clj b/enterprise/backend/test/metabase_enterprise/search/semantic/task/metric_collector_test.clj
index 0b52a42b247..ac8004b7dd4 100644
--- a/enterprise/backend/test/metabase_enterprise/search/semantic/task/metric_collector_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/search/semantic/task/metric_collector_test.clj
@@ -16,6 +16,8 @@
[metabase.test :as mt]
[next.jdbc :as jdbc]))
+(set! *warn-on-reflection* true)
+
(use-fixtures :once #'semantic.tu/once-fixture)
(defn- create-test-tables!
diff --git a/enterprise/backend/test/metabase_enterprise/security_center/fetch_test.clj b/enterprise/backend/test/metabase_enterprise/security_center/fetch_test.clj
index be2ce70352c..43e195da41a 100644
--- a/enterprise/backend/test/metabase_enterprise/security_center/fetch_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/security_center/fetch_test.clj
@@ -9,6 +9,8 @@
[metabase.util.json :as json]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
(use-fixtures :once (fixtures/initialize :test-users))
(defn- make-advisory
diff --git a/enterprise/backend/test/metabase_enterprise/transform_testing/errors_test.clj b/enterprise/backend/test/metabase_enterprise/transform_testing/errors_test.clj
index 6d4947a3d45..1d74da376a1 100644
--- a/enterprise/backend/test/metabase_enterprise/transform_testing/errors_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/transform_testing/errors_test.clj
@@ -5,6 +5,8 @@
[clojure.test :refer [deftest is testing]]
[metabase-enterprise.transform-testing.errors :as errors]))
+(set! *warn-on-reflection* true)
+
;;; -------------------------------------------- checked --------------------------------------------
(deftest checked-accepts-every-declared-type-test
diff --git a/enterprise/backend/test/metabase_enterprise/transform_testing/revision_test.clj b/enterprise/backend/test/metabase_enterprise/transform_testing/revision_test.clj
index 0a580458edf..54a54e3a542 100644
--- a/enterprise/backend/test/metabase_enterprise/transform_testing/revision_test.clj
+++ b/enterprise/backend/test/metabase_enterprise/transform_testing/revision_test.clj
@@ -10,6 +10,8 @@
[metabase.test :as mt]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
(deftest transform-test-revision-serialization-test
(let [transform-test (t2/instance :model/TransformTest
{:id 1
diff --git a/modules/drivers/bigquery-cloud-sdk/test/metabase/driver/bigquery_cloud_sdk/query_processor_test.clj b/modules/drivers/bigquery-cloud-sdk/test/metabase/driver/bigquery_cloud_sdk/query_processor_test.clj
index 8322012b2da..b4b839afec0 100644
--- a/modules/drivers/bigquery-cloud-sdk/test/metabase/driver/bigquery_cloud_sdk/query_processor_test.clj
+++ b/modules/drivers/bigquery-cloud-sdk/test/metabase/driver/bigquery_cloud_sdk/query_processor_test.clj
@@ -33,6 +33,8 @@
[metabase.util.date-2 :as u.date]
[metabase.util.honey-sql-2 :as h2x]))
+(set! *warn-on-reflection* true)
+
(defn ^:private get-test-data-name
[]
(bigquery.tx/test-dataset-id
diff --git a/modules/drivers/mongo/test/metabase/driver/mongo_test.clj b/modules/drivers/mongo/test/metabase/driver/mongo_test.clj
index 898bb4b5b12..05bf6b546c7 100644
--- a/modules/drivers/mongo/test/metabase/driver/mongo_test.clj
+++ b/modules/drivers/mongo/test/metabase/driver/mongo_test.clj
@@ -34,6 +34,8 @@
(:import
(org.bson.types Binary ObjectId)))
+(set! *warn-on-reflection* true)
+
;; ## Constants + Helper Fns/Macros
;; TODO - move these to metabase.test-data ?
(def ^:private table-names
diff --git a/src/metabase/cache/settings.clj b/src/metabase/cache/settings.clj
index c76a9b61a3c..2799add8aed 100644
--- a/src/metabase/cache/settings.clj
+++ b/src/metabase/cache/settings.clj
@@ -5,6 +5,8 @@
[metabase.util :as u]
[metabase.util.i18n :refer [deferred-tru tru]]))
+(set! *warn-on-reflection* true)
+
(defsetting enable-query-caching
(deferred-tru "Allow caching results of queries that take a long time to run.")
:type :boolean
diff --git a/src/metabase/driver/sql_jdbc/connection/pool_lock.clj b/src/metabase/driver/sql_jdbc/connection/pool_lock.clj
index db8d2beacd9..5cfd5613e16 100644
--- a/src/metabase/driver/sql_jdbc/connection/pool_lock.clj
+++ b/src/metabase/driver/sql_jdbc/connection/pool_lock.clj
@@ -3,5 +3,7 @@
once. Query execution waits on it whenever a warehouse pool does not exist yet, so take it only around pool creation
and never around anything slow.")
+(set! *warn-on-reflection* true)
+
(defonce ^{:doc "The monitor object. Take it with `locking`."} monitor
(Object.))
diff --git a/src/metabase/embedding/jwt.clj b/src/metabase/embedding/jwt.clj
index 8d5cb8f0ced..5ddce96d87f 100644
--- a/src/metabase/embedding/jwt.clj
+++ b/src/metabase/embedding/jwt.clj
@@ -8,6 +8,8 @@
[metabase.util.json :as json]
[ring.util.codec :as codec]))
+(set! *warn-on-reflection* true)
+
(defn- jwt-header
"Parse a JWT `message` and return the header portion."
[^String message]
diff --git a/src/metabase/explorations/view_log.clj b/src/metabase/explorations/view_log.clj
index cc0d83d3e2a..2bac49a27f5 100644
--- a/src/metabase/explorations/view_log.clj
+++ b/src/metabase/explorations/view_log.clj
@@ -11,6 +11,8 @@
[methodical.core :as m]
[steffan-westcott.clj-otel.api.trace.span :as span]))
+(set! *warn-on-reflection* true)
+
(events/derive! ::exploration-read :metabase/event)
(events/derive! :event/exploration-read ::exploration-read)
diff --git a/src/metabase/measures/models/measure.clj b/src/metabase/measures/models/measure.clj
index b9c09786c6e..4d2dee50c1f 100644
--- a/src/metabase/measures/models/measure.clj
+++ b/src/metabase/measures/models/measure.clj
@@ -28,6 +28,8 @@
[toucan2.core :as t2]
[toucan2.tools.hydrate :as t2.hydrate]))
+(set! *warn-on-reflection* true)
+
(methodical/defmethod t2/table-name :model/Measure [_model] :measure)
(methodical/defmethod t2/model-for-automagic-hydration [:default :measure] [_original-model _k] :model/Measure)
diff --git a/src/metabase/model_persistence/models/persisted_info.clj b/src/metabase/model_persistence/models/persisted_info.clj
index 14ed5db3f69..d009becff38 100644
--- a/src/metabase/model_persistence/models/persisted_info.clj
+++ b/src/metabase/model_persistence/models/persisted_info.clj
@@ -13,6 +13,8 @@
[methodical.core :as methodical]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
;;; ----------------------------------------------- Entity & Lifecycle -----------------------------------------------
(methodical/defmethod t2/table-name :model/PersistedInfo [_model] :persisted_info)
diff --git a/src/metabase/native_query_snippets/models/native_query_snippet.clj b/src/metabase/native_query_snippets/models/native_query_snippet.clj
index 3ffc16f90c1..19349c3734c 100644
--- a/src/metabase/native_query_snippets/models/native_query_snippet.clj
+++ b/src/metabase/native_query_snippets/models/native_query_snippet.clj
@@ -18,6 +18,8 @@
[toucan2.core :as t2]
[toucan2.realize :as t2.realize]))
+(set! *warn-on-reflection* true)
+
;;; ----------------------------------------------- Entity & Lifecycle -----------------------------------------------
(methodical/defmethod t2/table-name :model/NativeQuerySnippet [_model] :native_query_snippet)
diff --git a/src/metabase/notification/payload/impl/card.clj b/src/metabase/notification/payload/impl/card.clj
index 1a66cfc9738..ed3bc5b9d72 100644
--- a/src/metabase/notification/payload/impl/card.clj
+++ b/src/metabase/notification/payload/impl/card.clj
@@ -12,6 +12,8 @@
[metabase.util.malli :as mu]
[metabase.util.ui-logic :as ui-logic]))
+(set! *warn-on-reflection* true)
+
(mu/defmethod notification.payload/payload :notification/card
[{:keys [creator_id payload subscriptions] :as _notification-info} :- ::notification.payload/Notification]
(log/with-context {:card_id (:card_id payload)}
diff --git a/src/metabase/permissions/models/application_permissions_revision.clj b/src/metabase/permissions/models/application_permissions_revision.clj
index 819955dafcd..f453828893a 100644
--- a/src/metabase/permissions/models/application_permissions_revision.clj
+++ b/src/metabase/permissions/models/application_permissions_revision.clj
@@ -6,6 +6,8 @@
[methodical.core :as methodical]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
(methodical/defmethod t2/table-name :model/ApplicationPermissionsRevision [_model] :application_permissions_revision)
(doto :model/ApplicationPermissionsRevision
diff --git a/src/metabase/permissions/models/permissions_revision.clj b/src/metabase/permissions/models/permissions_revision.clj
index 509dde7db19..7932634b823 100644
--- a/src/metabase/permissions/models/permissions_revision.clj
+++ b/src/metabase/permissions/models/permissions_revision.clj
@@ -6,6 +6,8 @@
[methodical.core :as methodical]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
(methodical/defmethod t2/table-name :model/PermissionsRevision [_model] :permissions_revision)
(doto :model/PermissionsRevision
diff --git a/src/metabase/premium_features/defenterprise.clj b/src/metabase/premium_features/defenterprise.clj
index ccef851c487..a45c2eff92c 100644
--- a/src/metabase/premium_features/defenterprise.clj
+++ b/src/metabase/premium_features/defenterprise.clj
@@ -9,6 +9,8 @@
[metabase.util.i18n :refer [trs tru]]
[metabase.util.malli :as mu]))
+(set! *warn-on-reflection* true)
+
(defn- in-ee?
"Is the current namespace an Enterprise Edition namespace?"
[]
diff --git a/src/metabase/pulse/models/pulse.clj b/src/metabase/pulse/models/pulse.clj
index 7490e3eaf8c..9feb38a2383 100644
--- a/src/metabase/pulse/models/pulse.clj
+++ b/src/metabase/pulse/models/pulse.clj
@@ -39,6 +39,8 @@
[methodical.core :as methodical]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
;;; ----------------------------------------------- Entity & Lifecycle -----------------------------------------------
(methodical/defmethod t2/table-name :model/Pulse [_model] :pulse)
diff --git a/src/metabase/query_processor/middleware/permissions.clj b/src/metabase/query_processor/middleware/permissions.clj
index fd9cc4cd3cf..bdad34aa1aa 100644
--- a/src/metabase/query_processor/middleware/permissions.clj
+++ b/src/metabase/query_processor/middleware/permissions.clj
@@ -18,6 +18,8 @@
[metabase.util.log :as log]
[metabase.util.malli :as mu]))
+(set! *warn-on-reflection* true)
+
#_{:clj-kondo/ignore [:metabase/discourage-dynamic-vars]}
(def ^:dynamic *card-id*
"ID of the Card currently being executed, if there is one. Bind this in a Card-execution so we will use
diff --git a/src/metabase/revisions/models/revision.clj b/src/metabase/revisions/models/revision.clj
index f064447b2c4..34f77f2fd94 100644
--- a/src/metabase/revisions/models/revision.clj
+++ b/src/metabase/revisions/models/revision.clj
@@ -19,6 +19,8 @@
[toucan2.core :as t2]
[toucan2.model :as t2.model]))
+(set! *warn-on-reflection* true)
+
(defn toucan-model?
"Check if `model` is a toucan model."
[model]
diff --git a/src/metabase/search/appdb/specialization/h2.clj b/src/metabase/search/appdb/specialization/h2.clj
index f560ac18430..cf437a7bc2e 100644
--- a/src/metabase/search/appdb/specialization/h2.clj
+++ b/src/metabase/search/appdb/specialization/h2.clj
@@ -8,6 +8,8 @@
[metabase.util :as u]
[metabase.util.honey-sql-2 :as h2x]))
+(set! *warn-on-reflection* true)
+
(defmethod specialization/table-schema :h2 [base-schema]
(into [[:id :bigint :auto-increment :primary-key]
[:search_terms :text]
diff --git a/src/metabase/segments/models/segment.clj b/src/metabase/segments/models/segment.clj
index 29d2b86338d..57b0eaada03 100644
--- a/src/metabase/segments/models/segment.clj
+++ b/src/metabase/segments/models/segment.clj
@@ -26,6 +26,8 @@
[toucan2.core :as t2]
[toucan2.tools.hydrate :as t2.hydrate]))
+(set! *warn-on-reflection* true)
+
(methodical/defmethod t2/table-name :model/Segment [_model] :segment)
(methodical/defmethod t2/model-for-automagic-hydration [:default :segment] [_original-model _k] :model/Segment)
diff --git a/src/metabase/server/db.clj b/src/metabase/server/db.clj
index 26c67004207..42589ae2efd 100644
--- a/src/metabase/server/db.clj
+++ b/src/metabase/server/db.clj
@@ -11,6 +11,8 @@
[toucan2.core :as t2]
[toucan2.pipeline :as t2.pipeline]))
+(set! *warn-on-reflection* true)
+
;; These session/API-key/OAuth-token lookup queries run on every single authenticated API request, so it's worth it
;; to optimize a bit and only compile each one to SQL once (keyed by its boolean/enum arguments) rather than every
;; time.
diff --git a/src/metabase/sso/oidc/schema.clj b/src/metabase/sso/oidc/schema.clj
index 9895a329d21..ecde7de605c 100644
--- a/src/metabase/sso/oidc/schema.clj
+++ b/src/metabase/sso/oidc/schema.clj
@@ -4,6 +4,8 @@
[metabase.util.malli.registry :as mr]
[metabase.util.malli.schema :as ms]))
+(set! *warn-on-reflection* true)
+
;;; Configuration Schemas
(mr/def ::client-id
diff --git a/src/metabase/sync/analyze/classify.clj b/src/metabase/sync/analyze/classify.clj
index f0f1415f593..8c422f266b5 100644
--- a/src/metabase/sync/analyze/classify.clj
+++ b/src/metabase/sync/analyze/classify.clj
@@ -33,6 +33,8 @@
[metabase.util.log :as log]
[metabase.util.malli :as mu]))
+(set! *warn-on-reflection* true)
+
;;; +----------------------------------------------------------------------------------------------------------------+
;;; | CLASSIFYING INDIVIDUAL FIELDS |
;;; +----------------------------------------------------------------------------------------------------------------+
diff --git a/src/metabase/upload/settings.clj b/src/metabase/upload/settings.clj
index fb6c84e04d1..212e5408e07 100644
--- a/src/metabase/upload/settings.clj
+++ b/src/metabase/upload/settings.clj
@@ -7,6 +7,8 @@
[metabase.util.i18n :refer [deferred-tru]]
[metabase.util.log :as log]))
+(set! *warn-on-reflection* true)
+
(defn- not-handling-api-request?
[]
(nil? @api/*current-user*))
diff --git a/src/metabase/warehouse_schema/settings.clj b/src/metabase/warehouse_schema/settings.clj
index 9fb9670592e..a909fd4f5bc 100644
--- a/src/metabase/warehouse_schema/settings.clj
+++ b/src/metabase/warehouse_schema/settings.clj
@@ -8,6 +8,8 @@
[metabase.util.log :as log]
[metabase.warehouse-schema.humanization :as humanization]))
+(set! *warn-on-reflection* true)
+
(defn- set-humanization-strategy!
"Set `humanization-strategy` to `new-value`, throwing for an unknown strategy, then re-humanize every Table and
Field display name.
diff --git a/test/metabase/app_db/transient_error_test.clj b/test/metabase/app_db/transient_error_test.clj
index 4122d6c5858..d41a7468164 100644
--- a/test/metabase/app_db/transient_error_test.clj
+++ b/test/metabase/app_db/transient_error_test.clj
@@ -5,6 +5,8 @@
(:import
(java.sql SQLException)))
+(set! *warn-on-reflection* true)
+
(deftest transient-error-h2-test
(testing "H2 deadlock (error code 40001)"
(is (transient-error/transient-error? :h2 (SQLException. "Deadlock" "40001" 40001))))
diff --git a/test/metabase/appearance/settings_test.clj b/test/metabase/appearance/settings_test.clj
index d4151b0d1f5..0dcd720efbd 100644
--- a/test/metabase/appearance/settings_test.clj
+++ b/test/metabase/appearance/settings_test.clj
@@ -8,6 +8,8 @@
[metabase.test.util :as tu]
[metabase.util.jvm :as u.jvm]))
+(set! *warn-on-reflection* true)
+
(use-fixtures :once (fixtures/initialize :db))
(defn- image-data-uri [content-type content]
diff --git a/test/metabase/channel/rest/api/slack_test.clj b/test/metabase/channel/rest/api/slack_test.clj
index 7bda263315a..81c65e59c84 100644
--- a/test/metabase/channel/rest/api/slack_test.clj
+++ b/test/metabase/channel/rest/api/slack_test.clj
@@ -14,6 +14,8 @@
[metabase.test :as mt]
[metabase.util.json :as json]))
+(set! *warn-on-reflection* true)
+
(deftest update-slack-settings-test
(testing "PUT /api/slack/settings"
(testing "An admin can set a valid Slack app token to the slack-app-token setting"
diff --git a/test/metabase/driver/sql_jdbc/sync/describe_table_test.clj b/test/metabase/driver/sql_jdbc/sync/describe_table_test.clj
index 698b7fdb4f0..cdd389378ab 100644
--- a/test/metabase/driver/sql_jdbc/sync/describe_table_test.clj
+++ b/test/metabase/driver/sql_jdbc/sync/describe_table_test.clj
@@ -28,6 +28,8 @@
[metabase.util.log :as log]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
(defn- uses-default-describe-table? [driver]
(and (identical? (get-method driver/describe-table :sql-jdbc) (get-method driver/describe-table driver))
(not (driver.u/supports? driver :describe-fields nil))))
diff --git a/test/metabase/health_inspector/core_test.clj b/test/metabase/health_inspector/core_test.clj
index 58ebd10495f..7adb2ec2090 100644
--- a/test/metabase/health_inspector/core_test.clj
+++ b/test/metabase/health_inspector/core_test.clj
@@ -9,6 +9,8 @@
[metabase.util.json :as json]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
(defn- test-check []
{:health 100
:message "test check"})
diff --git a/test/metabase/lib/drill_thru/underlying_records_test.cljc b/test/metabase/lib/drill_thru/underlying_records_test.cljc
index d0fbc97bff4..1e0a85dc2d0 100644
--- a/test/metabase/lib/drill_thru/underlying_records_test.cljc
+++ b/test/metabase/lib/drill_thru/underlying_records_test.cljc
@@ -121,9 +121,9 @@
;; here's a hard-coded value. This can be any month, provided it is in the range of the Sample Database, which is
;; roughly +/- 2 years. I've picked June 2026 in October 2025, so this value should be good for a few years.
#?(:cljs "2026-06-01"
- :clj (let [last-month (-> (t/zoned-date-time (t/year) (t/month))
- (t/minus (t/months 1)))]
- (t/format :iso-offset-date-time last-month))))
+ :clj (let [month-start (-> (t/zoned-date-time (t/year) (t/month))
+ (t/minus (t/months 1)))]
+ (t/format :iso-offset-date-time month-start))))
;; See the note above under [[last-month]] about the hard-coded values in CLJS.
(let [[start end] #?(:cljs ["2026-06-01" "2026-06-30"]
diff --git a/test/metabase/lib_be/metadata/jvm_test.clj b/test/metabase/lib_be/metadata/jvm_test.clj
index 467770c3c5f..a6818ee0ef6 100644
--- a/test/metabase/lib_be/metadata/jvm_test.clj
+++ b/test/metabase/lib_be/metadata/jvm_test.clj
@@ -18,6 +18,8 @@
[metabase.warehouse-schema.models.table :as table]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
(deftest ^:parallel fetch-field-test
(let [field (t2/select-one :metadata/column :id (mt/id :categories :id))]
(is (not (me/humanize (mr/explain ::lib.schema.metadata/column field))))))
diff --git a/test/metabase/lib_be/models/transforms_test.clj b/test/metabase/lib_be/models/transforms_test.clj
index 4df2842ce1e..970e7d8cc23 100644
--- a/test/metabase/lib_be/models/transforms_test.clj
+++ b/test/metabase/lib_be/models/transforms_test.clj
@@ -9,6 +9,8 @@
[metabase.util.malli :as mu]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
(deftest ^:parallel handle-bad-template-tags-test
(testing (str "an malformed template tags map like the one below is invalid. Rather than potentially destroy an entire API "
"response because of one malformed Card, dump the error to the logs and return nil.")
diff --git a/test/metabase/llm/api/provider_test.clj b/test/metabase/llm/api/provider_test.clj
index 606c0e29d9e..1725ae66ada 100644
--- a/test/metabase/llm/api/provider_test.clj
+++ b/test/metabase/llm/api/provider_test.clj
@@ -17,6 +17,8 @@
[metabase.util.json :as json]
[metabase.util.log.capture :as log.capture]))
+(set! *warn-on-reflection* true)
+
(use-fixtures :once (fixtures/initialize :db))
(defn- connection
diff --git a/test/metabase/metabot/context_test.clj b/test/metabase/metabot/context_test.clj
index 3ed4b417ebc..15fdc52197f 100644
--- a/test/metabase/metabot/context_test.clj
+++ b/test/metabase/metabot/context_test.clj
@@ -14,6 +14,8 @@
[metabase.test :as mt]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
(def ^:private users-native-query (lib/native-query meta/metadata-provider "SELECT * FROM users"))
(def ^:private users-mbql-query (lib/query meta/metadata-provider (meta/table-metadata :users)))
diff --git a/test/metabase/metabot/tools/document_test.clj b/test/metabase/metabot/tools/document_test.clj
index 2f39490f3ee..15495d82228 100644
--- a/test/metabase/metabot/tools/document_test.clj
+++ b/test/metabase/metabot/tools/document_test.clj
@@ -25,6 +25,8 @@
[metabase.test :as mt]
[metabase.warehouses.core :as warehouses]))
+(set! *warn-on-reflection* true)
+
(defn- invoke-document-tool
"Call `tool-name` from the Documents profile through the runtime, with `memory` as the agent's memory."
([tool-name args]
diff --git a/test/metabase/metabot/tools/metadata_test.clj b/test/metabase/metabot/tools/metadata_test.clj
index c5b4cec6c9c..3ea4ef031ff 100644
--- a/test/metabase/metabot/tools/metadata_test.clj
+++ b/test/metabase/metabot/tools/metadata_test.clj
@@ -17,6 +17,8 @@
[metabase.test :as mt]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
(defn- invoke-metadata
([profile tool-name args]
(invoke-metadata profile tool-name args nil))
diff --git a/test/metabase/metabot/tools/slackbot_query_test.clj b/test/metabase/metabot/tools/slackbot_query_test.clj
index 12f5a3d251b..33ba3e8b544 100644
--- a/test/metabase/metabot/tools/slackbot_query_test.clj
+++ b/test/metabase/metabot/tools/slackbot_query_test.clj
@@ -25,6 +25,8 @@
[metabase.test.data.users :as test.users]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
;;; ---------------------------------------- prompt content tests ---------------------------------------------------
(deftest slackbot-prompt-display-guidance-test
diff --git a/test/metabase/oauth_server/core_test.clj b/test/metabase/oauth_server/core_test.clj
index eb1ed51cec2..9dbf956a556 100644
--- a/test/metabase/oauth_server/core_test.clj
+++ b/test/metabase/oauth_server/core_test.clj
@@ -10,6 +10,8 @@
[oidc-provider.store :as oidc.store]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
(use-fixtures :each (fn [thunk]
(oauth-server/reset-provider!)
(thunk)
diff --git a/test/metabase/oauth_server/events/revoke_on_deactivation_test.clj b/test/metabase/oauth_server/events/revoke_on_deactivation_test.clj
index 80c45695598..75016fab4f9 100644
--- a/test/metabase/oauth_server/events/revoke_on_deactivation_test.clj
+++ b/test/metabase/oauth_server/events/revoke_on_deactivation_test.clj
@@ -6,6 +6,8 @@
[metabase.test :as mt]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
(defn- in-one-hour [] (+ (inst-ms (java.util.Date.)) 3600000))
(defn- insert-access-token! [user-id]
diff --git a/test/metabase/oauth_server/store_test.clj b/test/metabase/oauth_server/store_test.clj
index 1fa63ec3ab3..d66f2271570 100644
--- a/test/metabase/oauth_server/store_test.clj
+++ b/test/metabase/oauth_server/store_test.clj
@@ -7,6 +7,8 @@
[oidc-provider.util :as oidc-util]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
;;; ------------------------------------------------ ClientStore -------------------------------------------------------
(deftest client-store-register-and-get-test
diff --git a/test/metabase/query_processor/middleware/catch_exceptions_test.clj b/test/metabase/query_processor/middleware/catch_exceptions_test.clj
index da26990e71a..af52f602459 100644
--- a/test/metabase/query_processor/middleware/catch_exceptions_test.clj
+++ b/test/metabase/query_processor/middleware/catch_exceptions_test.clj
@@ -23,6 +23,8 @@
(:import
(java.sql SQLException)))
+(set! *warn-on-reflection* true)
+
(deftest ^:parallel exception-chain-test
(testing "Should be able to get a sequence of exceptions by following causes, with the top-level Exception first"
(let [e1 (ex-info "1" {:level 1})
diff --git a/test/metabase/query_processor/middleware/metrics_test.clj b/test/metabase/query_processor/middleware/metrics_test.clj
index ae6acf27f9a..9eb769323cc 100644
--- a/test/metabase/query_processor/middleware/metrics_test.clj
+++ b/test/metabase/query_processor/middleware/metrics_test.clj
@@ -27,6 +27,8 @@
[metabase.util :as u]
[metabase.util.date-2 :as u.date]))
+(set! *warn-on-reflection* true)
+
;;; TODO (Cam 7/18/25) -- update the tests in this namespace to use mock metadata providers instead of with-temp
(use-fixtures :once (fixtures/initialize :db))
diff --git a/test/metabase/request/util_test.clj b/test/metabase/request/util_test.clj
index fdf819e1c9f..43bd76bb07c 100644
--- a/test/metabase/request/util_test.clj
+++ b/test/metabase/request/util_test.clj
@@ -12,6 +12,8 @@
[metabase.util.json :as json]
[ring.mock.request :as ring.mock]))
+(set! *warn-on-reflection* true)
+
(defn- cacheable? [uri]
(req.util/cacheable? {:request-method :get :uri uri}))
diff --git a/test/metabase/sync/analyze/fingerprint_test.clj b/test/metabase/sync/analyze/fingerprint_test.clj
index 809c1a236dd..e22f79fde2d 100644
--- a/test/metabase/sync/analyze/fingerprint_test.clj
+++ b/test/metabase/sync/analyze/fingerprint_test.clj
@@ -18,6 +18,8 @@
[java.net ConnectException]
[java.sql SQLException SQLTimeoutException]))
+(set! *warn-on-reflection* true)
+
;;; +----------------------------------------------------------------------------------------------------------------+
;;; | TESTS FOR WHICH FIELDS NEED FINGERPRINTING |
;;; +----------------------------------------------------------------------------------------------------------------+
diff --git a/test/metabase/sync/fetch_metadata_test.clj b/test/metabase/sync/fetch_metadata_test.clj
index 64fa88c88fb..4f0243f9a06 100644
--- a/test/metabase/sync/fetch_metadata_test.clj
+++ b/test/metabase/sync/fetch_metadata_test.clj
@@ -8,6 +8,8 @@
(com.mchange.v2.resourcepool CannotAcquireResourceException)
(java.sql SQLException)))
+(set! *warn-on-reflection* true)
+
(defn- tables-attempted
"Run the describe-table fallback over the test DB with every table failing with `e`. Returns the number of tables
attempted and whether the run threw."
diff --git a/test/metabase/test/data/dataset_definitions.clj b/test/metabase/test/data/dataset_definitions.clj
index debaa2b08de..a4ea5c37866 100644
--- a/test/metabase/test/data/dataset_definitions.clj
+++ b/test/metabase/test/data/dataset_definitions.clj
@@ -8,6 +8,8 @@
(:import
(java.time LocalDate LocalDateTime LocalTime OffsetDateTime OffsetTime ZonedDateTime)))
+(set! *warn-on-reflection* true)
+
;;; +----------------------------------------------------------------------------------------------------------------+
;;; | Various Datasets |
;;; +----------------------------------------------------------------------------------------------------------------+
diff --git a/test/metabase/test/data/sql.clj b/test/metabase/test/data/sql.clj
index e9562c18f28..3e4a79f6c92 100644
--- a/test/metabase/test/data/sql.clj
+++ b/test/metabase/test/data/sql.clj
@@ -19,6 +19,8 @@
[metabase.util.log :as log]
[metabase.util.random :as u.random]))
+(set! *warn-on-reflection* true)
+
(comment metabase.driver.sql/keep-me)
(driver/register! :sql/test-extensions, :abstract? true)
diff --git a/test/metabase/test/data/users.clj b/test/metabase/test/data/users.clj
index 4894b1751b0..fd5fc8a8aa0 100644
--- a/test/metabase/test/data/users.clj
+++ b/test/metabase/test/data/users.clj
@@ -18,6 +18,8 @@
(:import
(clojure.lang ExceptionInfo)))
+(set! *warn-on-reflection* true)
+
;;; ------------------------------------------------ User Definitions ------------------------------------------------
;; ## Test Users
diff --git a/test/metabase/test/sync.clj b/test/metabase/test/sync.clj
index 05520169715..d954c37ff9b 100644
--- a/test/metabase/test/sync.clj
+++ b/test/metabase/test/sync.clj
@@ -5,6 +5,8 @@
[metabase.test.data :as data]
[toucan2.core :as t2]))
+(set! *warn-on-reflection* true)
+
;; deliberately has no root value: the reader below checks `bound?` to tell a live cache from no cache at all
#_{:clj-kondo/ignore [:uninitialized-var :metabase/discourage-dynamic-vars]}
(def ^:private ^:dynamic *sync-steps-run-to-completion-cache*)
diff --git a/test/metabase/version/settings_test.clj b/test/metabase/version/settings_test.clj
index 120d83c90da..6f5f4866f88 100644
--- a/test/metabase/version/settings_test.clj
+++ b/test/metabase/version/settings_test.clj
@@ -6,6 +6,8 @@
[metabase.test.fixtures :as fixtures]
[metabase.version.settings :as version.settings]))
+(set! *warn-on-reflection* true)
+
(use-fixtures :once (fixtures/initialize :db))
(def prevent? #'version.settings/prevent-upgrade?)