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
4da21522
Commit
4da21522
authored
4 years ago
by
Cam Saul
Browse files
Options
Downloads
Patches
Plain Diff
Backport some test tooling changes from master -> release-0.35.x [ci all]
parent
a9465873
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/test.clj
+23
-1
23 additions, 1 deletion
test/metabase/test.clj
test_resources/log4j.properties
+1
-1
1 addition, 1 deletion
test_resources/log4j.properties
with
24 additions
and
2 deletions
test/metabase/test.clj
+
23
−
1
View file @
4da21522
...
...
@@ -3,12 +3,15 @@
(Prefer using `metabase.test` to requiring bits and pieces from these various namespaces going forward, since it
reduces the cognitive load required to write tests.)"
(
:require
[
clojure.test
:refer
:all
]
(
:require
[
clojure
[
test
:refer
:all
]
[
walk
:as
walk
]]
[
java-time
:as
t
]
[
medley.core
:as
m
]
[
metabase
[
driver
:as
driver
]
[
email-test
:as
et
]
[
http-client
:as
http
]
[
query-processor
:as
qp
]
[
query-processor-test
:as
qp.test
]]
[
metabase.driver.sql-jdbc.test-util
:as
sql-jdbc.tu
]
...
...
@@ -39,6 +42,7 @@
datasets/keep-me
driver/keep-me
et/keep-me
http/keep-me
initialize/keep-me
qp/keep-me
qp.test-util/keep-me
...
...
@@ -88,6 +92,12 @@
with-expected-messages
with-fake-inbox
]
[
http
authenticate
build-url
client
client-full-response
]
[
initialize
initialize-if-needed!
]
...
...
@@ -182,6 +192,8 @@
set-test-drivers!
with-test-drivers
])
;; TODO -- move this stuff into some other namespace and refer to it here
(
defn
do-with-clock
[
clock
thunk
]
(
testing
(
format
"\nsystem clock = %s"
(
pr-str
clock
))
(
let
[
clock
(
cond
...
...
@@ -248,3 +260,13 @@
:pre
(
->
result
:data
:pre
)
:post
(
->
result
:data
:rows
)
:metadata
(
update
result
:data
#
(
dissoc
%
:pre
:rows
))}))))))
(
defn
derecordize
"Convert all record types in `form` to plain maps, so tests won't fail."
[
form
]
(
walk/postwalk
(
fn
[
form
]
(
if
(
record?
form
)
(
into
{}
form
)
form
))
form
))
This diff is collapsed.
Click to expand it.
test_resources/log4j.properties
+
1
−
1
View file @
4da21522
...
...
@@ -15,7 +15,7 @@ log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern
=
%d [%t] %-5p%c - %m%n
# customizations to logging by package
log4j.logger.metabase
=
ERROR
log4j.logger.metabase
=
FATAL
log4j.logger.metabase.driver
=
INFO
log4j.logger.metabase.plugins
=
INFO
log4j.logger.metabase.test-setup
=
INFO
...
...
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