Skip to content

Commit

Permalink
backfill expectations for currently broken stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
crisptrutski committed Oct 2, 2024
1 parent 6ed5530 commit a038511
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 4 deletions.
2 changes: 2 additions & 0 deletions test/macaw/acceptance_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
base-opts {:non-reserved-words [:final]}
opts-mode (fn [mode] (assoc base-opts :mode mode))]

(assert sql "Fixture exists")

(if-let [expected-msg (broken-queries fixture)]
(testing (str prefix " analysis cannot be parsed")
(is (thrown-with-msg? Exception expected-msg (ct/components sql base-opts)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
;; do not allow wildcard selects
{:tables :macaw.error/illegal-expression}

;; Just plain old whacky
;; Just plain old wacky
:source-columns [{:table "`project_id.dataset_id.table_*`", :column "_TABLE_SUFFIX"}]
;; Kinda makes sense, but very raw, and Metabase won't handle it.
:tables [{:table "`project_id.dataset_id.table_*`"}]}}
5 changes: 5 additions & 0 deletions test/resources/acceptance/broken__between.analysis.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{:source-columns [{:table "usage-stats" :column "instance_started"}
{:table "usage-stats" :column "month_started"}
{:table "usage-stats" :column "instance_finished"}]
:tables [{:table "usage_stats"}]
:override :macaw.error/unable-to-parse}
5 changes: 5 additions & 0 deletions test/resources/acceptance/broken__filter_where.analysis.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{:source-columns [{:table "execution" :column "error"}
{:table "execution" :column "instance_id"}
{:table "execution" :column "running_time"}]
:tables [{:table "execution"}]
:override :macaw.error/unable-to-parse}
4 changes: 4 additions & 0 deletions test/resources/acceptance/reserved__final.analysis.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{:source-columns [{:table "invoice" :column "amount_paid_cents"}
{:table "invoice" :column "id"}
{:table "invoice" :column "is_deleted"}]
:tables [{:table "invoice"}]}
3 changes: 2 additions & 1 deletion test/resources/acceptance/simple__select_star.edn
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{:source-columns []
{:has-wildcard? true
:source-columns []
:tables [{:table "t"}]}
3 changes: 2 additions & 1 deletion test/resources/acceptance/sqlserver__execute.analysis.edn
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
{:tables ::should-not-succeed}
{:tables :macaw.error/illegal-expression
:override :macaw.error/unable-to-parse}
3 changes: 2 additions & 1 deletion test/resources/acceptance/sqlserver__executesql.analysis.edn
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
{:tables ::should-not-succeed}
{:tables :macaw.error/illegal-expression
:override :macaw.error/unable-to-parse}

0 comments on commit a038511

Please sign in to comment.