diff --git a/test/macaw/acceptance_test.clj b/test/macaw/acceptance_test.clj index 3035a89..8e86588 100644 --- a/test/macaw/acceptance_test.clj +++ b/test/macaw/acceptance_test.clj @@ -50,8 +50,15 @@ (doseq [[ck cv] (dissoc expected-cs :overrides)] (testing (str prefix " analysis is correct: " (name ck)) (let [actual-cv (get-component cs ck) - expected (get-in expected-cs [:overrides ck] cv)] - (if (vector? cv) + override (get-in expected-cs [:overrides ck]) + expected (or override cv)] + + (when override + (if (vector? cv) + (is (not= cv (ct/sorted actual-cv)) "Override is still needed") + (is (not= cv actual-cv) "Override is still needed"))) + + (if (vector? expected) (is (= expected (ct/sorted actual-cv))) (is (= expected actual-cv)))))))) (when renames diff --git a/test/resources/acceptance/compound__cte_simple.analysis.edn b/test/resources/acceptance/compound__cte_simple.analysis.edn new file mode 100644 index 0000000..7a37445 --- /dev/null +++ b/test/resources/acceptance/compound__cte_simple.analysis.edn @@ -0,0 +1,8 @@ +{:tables [{:table "t1"} {:table "t2"}] + :source-columns [{:table "t1", :column "x"} + {:table "t2", :column "y"}] + + :overrides + ;; Missing x completely! + ;; See https://github.com/metabase/metabase/issues/42586 + {:source-columns [{:column "y"}]}} diff --git a/test/resources/acceptance/compound__cte_simple.sql b/test/resources/acceptance/compound__cte_simple.sql new file mode 100644 index 0000000..195dc71 --- /dev/null +++ b/test/resources/acceptance/compound__cte_simple.sql @@ -0,0 +1 @@ +WITH cte AS (SELECT x FROM t1) SELECT cte.x, y FROM t2 JOIN cte;