Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
b607a80e
Commit
b607a80e
authored
9 years ago
by
Cam Saül
Browse files
Options
Downloads
Patches
Plain Diff
(partial) test fix
parent
7537c452
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/metabase/driver/generic_sql/query_processor_test.clj
+0
-28
0 additions, 28 deletions
test/metabase/driver/generic_sql/query_processor_test.clj
test/metabase/driver/query_processor_test.clj
+3
-5
3 additions, 5 deletions
test/metabase/driver/query_processor_test.clj
with
3 additions
and
33 deletions
test/metabase/driver/generic_sql/query_processor_test.clj
deleted
100644 → 0
+
0
−
28
View file @
7537c452
(
ns
metabase.driver.generic-sql.query-processor-test
(
:require
[
clojure.tools.logging
:as
log
]
[
colorize.core
:as
color
]
[
expectations
:refer
:all
]
[
metabase.driver
:as
driver
]
[
metabase.driver.query-processor
:refer
[
max-result-bare-rows
]]
[
metabase.test.data
:as
d
]
[
metabase.test.data.datasets
:as
datasets
]))
;; # ERROR RESPONSES
;; Check that we get an error response formatted the way we'd expect
(
expect
{
:status
:failed
:error
(
str
;; column should look like "null.NAME" because the Field will have no associated Table name from expansion and will get
;; pased to korma as :null.NAME
"Column \"null.NAME\" not found; SQL statement:\nSELECT \"CHECKINS\".\"ID\", CAST(\"CHECKINS\".\"DATE\" AS DATE), "
"\"CHECKINS\".\"VENUE_ID\", \"CHECKINS\".\"USER_ID\" FROM \"CHECKINS\" WHERE (\"null\".\"NAME\" = ?) LIMIT "
max-result-bare-rows
)}
;; This will print a stacktrace. Better to reassure people that that's on purpose than to make people question whether the tests are working
(
do
(
log/info
(
color/green
"NOTE: The following stacktrace is expected <3"
))
(
datasets/with-dataset
:generic-sql
(
driver/process-query
{
:database
(
d/db-id
)
:type
:query
:query
{
:source_table
(
d/id
:checkins
)
:filter
[
"="
(
d/id
:venues
:name
)
1
]
; wrong Field
:aggregation
[
"rows"
]}}))))
This diff is collapsed.
Click to expand it.
test/metabase/driver/query_processor_test.clj
+
3
−
5
View file @
b607a80e
...
...
@@ -12,8 +12,6 @@
[
metabase.util
:as
u
]))
;; ## Dataset-Independent QP Tests
;; ### Helper Fns + Macros
...
...
@@ -538,9 +536,9 @@
;; ## LIMIT-MAX-RESULT-ROWS
;; Apply limit-max-result-rows to an infinite sequence and make sure it gets capped at `max-result-rows`
(
expect
max-result-rows
(
count
(
->>
{
:rows
(
repeat
[
:ok
])}
((
u/runtime-resolved-fn
'metabase.driver.query-processor
'limit-max-result-
rows
))
:rows
)
))
(
->>
(((
u/runtime-resolved-fn
'metabase.driver.query-processor
'limit
)
identity
)
{
:rows
(
repeat
[
:ok
])}
)
:
rows
count
))
;; ## CUMULATIVE SUM
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment