Skip to content

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

Fix nested & misused `is` in tests found by new kondo version (#67939)

bryanb07c00001dc5
diff --git a/.claude/skills/_shared/clojure-style-guide.md b/.claude/skills/_shared/clojure-style-guide.md
index b3bdf0d5d20..b3dcc7896c8 100644
--- a/.claude/skills/_shared/clojure-style-guide.md
+++ b/.claude/skills/_shared/clojure-style-guide.md
@@ -42,7 +42,7 @@ This guide covers Clojure and ClojureScript coding conventions for Metabase. See
- Break up functions > 20 lines
- Lines ≤ 120 characters
-- No blank lines within definition forms (except pairwise `let`/`cond`)
+- No blank non-comment lines within definition forms (except pairwise `let`/`cond`)
## Style Conventions
diff --git a/.claude/skills/clojure-review/SKILL.md b/.claude/skills/clojure-review/SKILL.md
index dd123af97f9..13b23087420 100644
--- a/.claude/skills/clojure-review/SKILL.md
+++ b/.claude/skills/clojure-review/SKILL.md
@@ -61,7 +61,7 @@ Use this to scan through changes efficiently:
- [ ] Everything `^:private` unless used elsewhere
- [ ] No `declare` when avoidable (public functions near end)
- [ ] Functions under 20 lines when possible
-- [ ] No blank lines within definition forms (except pairwise constructs in `let`/`cond`)
+- [ ] No blank, non-comment lines within definition forms (except pairwise constructs in `let`/`cond`)
- [ ] Lines ≤ 120 characters
### Tests
diff --git a/test/metabase/analytics/stats_test.clj b/test/metabase/analytics/stats_test.clj
index 68f112b6ccd..ed8c52377a4 100644
--- a/test/metabase/analytics/stats_test.clj
+++ b/test/metabase/analytics/stats_test.clj
@@ -455,25 +455,25 @@
(mt/with-temp [:model/Database _ {:engine :postgres}]
(with-redefs [config/current-major-version (constantly 46)
config/current-minor-version (constantly 0)]
- (is false? (@#'stats/csv-upload-available?)))
+ (is (false? (@#'stats/csv-upload-available?))))
(with-redefs [config/current-major-version (constantly 47)
config/current-minor-version (constantly 1)]
- (is true? (@#'stats/csv-upload-available?))))
+ (is (true? (@#'stats/csv-upload-available?))))))
- (mt/with-temp [:model/Database _ {:engine :redshift}]
- (with-redefs [config/current-major-version (constantly 49)
- config/current-minor-version (constantly 5)]
- (is false? (@#'stats/csv-upload-available?)))
+ (mt/with-temp [:model/Database _ {:engine :redshift}]
+ (with-redefs [config/current-major-version (constantly 49)
+ config/current-minor-version (constantly 5)]
+ (is (false? (@#'stats/csv-upload-available?))))
- (with-redefs [config/current-major-version (constantly 49)
- config/current-minor-version (constantly 6)]
- (is true? (@#'stats/csv-upload-available?))))
+ (with-redefs [config/current-major-version (constantly 49)
+ config/current-minor-version (constantly 6)]
+ (is (true? (@#'stats/csv-upload-available?))))))
- ;; If we can't detect the MB version, return nil
- (with-redefs [config/current-major-version (constantly nil)
- config/current-minor-version (constantly nil)]
- (is false? (@#'stats/csv-upload-available?))))))
+ ;; If we can't detect the MB version, return nil
+ (with-redefs [config/current-major-version (constantly nil)
+ config/current-minor-version (constantly nil)]
+ (is (false? (@#'stats/csv-upload-available?)))))
(deftest starburst-legacy-test
(testing "starburst with impersonation"
diff --git a/test/metabase/lib/aggregation_test.cljc b/test/metabase/lib/aggregation_test.cljc
index b1357d8dc6d..f9b3385a75f 100644
--- a/test/metabase/lib/aggregation_test.cljc
+++ b/test/metabase/lib/aggregation_test.cljc
@@ -830,12 +830,12 @@
(let [query (lib/query meta/metadata-provider (meta/table-metadata :categories))]
(is (not (set/subset?
#{:avg :sum}
- (set (mapv :short (lib/available-aggregation-operators query)))))
- (is (set/subset?
- #{:avg :sum}
- (set (mapv :short (-> query
- (lib/join (meta/table-metadata :venues))
- lib/available-aggregation-operators)))))))))
+ (set (mapv :short (lib/available-aggregation-operators query))))))
+ (is (set/subset?
+ #{:avg :sum}
+ (set (mapv :short (-> query
+ (lib/join (meta/table-metadata :venues))
+ lib/available-aggregation-operators))))))))
(deftest ^:synchronized selected-aggregation-operators-skip-marking-columns-for-non-refs-test
(testing "when the aggregation's argument is not a column ref, don't try to mark selected columns"
diff --git a/test/metabase/upload/impl_test.clj b/test/metabase/upload/impl_test.clj
index 0cefe60af7d..8026f46de1e 100644
--- a/test/metabase/upload/impl_test.clj
+++ b/test/metabase/upload/impl_test.clj
@@ -489,12 +489,12 @@
(testing "both tables have the same display name"
(is (= "Some File Prefix"
(:display_name table-1)
- (:display_name table-2))
- (testing "tables are different between the two uploads"
- (is (some? (:id table-1)))
- (is (some? (:id table-2)))
- (is (not= (:id table-1)
- (:id table-2)))))))))))))))))
+ (:display_name table-2))))
+ (testing "tables are different between the two uploads"
+ (is (some? (:id table-1)))
+ (is (some? (:id table-2)))
+ (is (not= (:id table-1)
+ (:id table-2)))))))))))))))
(defn- query [db-id source-table]
(qp/process-query {:database db-id
diff --git a/test/metabase/util/string_test.clj b/test/metabase/util/string_test.clj
index 1dfc0cb49a4..34837716384 100644
--- a/test/metabase/util/string_test.clj
+++ b/test/metabase/util/string_test.clj
@@ -38,8 +38,8 @@
(is (= "longe" (u.str/limit-chars "longer string" 5))))
(deftest ^:parallel random-string
- (is 10 (count (u.str/random-string 10)))
- (is 20 (count (u.str/random-string 20)))
+ (is (= 10 (count (u.str/random-string 10))))
+ (is (= 20 (count (u.str/random-string 20))))
(is (not= (u.str/random-string 10) (u.str/random-string 10))))
(deftest ^:parallel limit-bytes
diff --git a/test/metabase/warehouse_schema/models/field_values_test.clj b/test/metabase/warehouse_schema/models/field_values_test.clj
index 0bf8ac081c3..aa68e3f89c3 100644
--- a/test/metabase/warehouse_schema/models/field_values_test.clj
+++ b/test/metabase/warehouse_schema/models/field_values_test.clj
@@ -241,8 +241,8 @@
(t2/delete! :model/FieldValues :field_id (mt/id :categories :name) :type :full)
(is (= :full (-> (t2/select-one :model/Field :id (mt/id :categories :name))
field-values/get-or-create-full-field-values!
- :type))
- (is (= 1 (t2/count :model/FieldValues :field_id (mt/id :categories :name) :type :full))))
+ :type)))
+ (is (= 1 (t2/count :model/FieldValues :field_id (mt/id :categories :name) :type :full)))
(testing "if an Advanced FieldValues Exists, make sure we still returns the full FieldValues"
(mt/with-temp [:model/FieldValues _ {:field_id (mt/id :categories :name)