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
09b32a11
Commit
09b32a11
authored
9 years ago
by
Cam Saül
Browse files
Options
Downloads
Patches
Plain Diff
mongo fix
parent
1b0b7868
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/metabase/driver/mongo/util.clj
+8
-5
8 additions, 5 deletions
src/metabase/driver/mongo/util.clj
test/metabase/test_setup.clj
+4
-4
4 additions, 4 deletions
test/metabase/test_setup.clj
with
12 additions
and
9 deletions
src/metabase/driver/mongo/util.clj
+
8
−
5
View file @
09b32a11
...
...
@@ -46,11 +46,14 @@
(
:dbname
(
:details
database
))
(
:details
database
)
; entire Database obj
(
:dbname
database
)
database
; connection details map only
:else
(
throw
(
Exception.
(
str
"with-mongo-connection failed: bad connection details:"
(
:details
database
)))))
server-address
(
mg/server-address
host
port
)
credentials
(
when
user
(
mcred/create
user
dbname
pass
))
conn
(
mg/connect
server-address
mongo-connection-options
credentials
)
mongo-connection
(
mg/get-db
conn
dbname
)]
server-address
(
mg/server-address
host
port
)
credentials
(
when
user
(
mcred/create
user
dbname
pass
))
connect
(
partial
mg/connect
server-address
mongo-connection-options
)
conn
(
if
credentials
(
connect
credentials
)
(
connect
))
mongo-connection
(
mg/get-db
conn
dbname
)]
(
log/debug
(
color/cyan
"<< OPENED NEW MONGODB CONNECTION >>"
))
(
try
(
binding
[
*mongo-connection*
mongo-connection
]
...
...
This diff is collapsed.
Click to expand it.
test/metabase/test_setup.clj
+
4
−
4
View file @
09b32a11
...
...
@@ -79,10 +79,10 @@
{
:expectations-options
:before-run
}
[]
;; We can shave about a second from unit test launch time by doing the various setup stages in on different threads
(
let
[
setup-db
(
future
(
time
(
do
(
log/info
"Setting up test DB and running migrations..."
)
(
db/setup-db
:auto-migrate
true
)
(
load-test-datasets
)
(
metabase.models.setting/set
:site-name
"Metabase Test"
))))]
(
let
[
setup-db
(
future
(
time
(
do
(
log/info
"Setting up test DB and running migrations..."
)
(
db/setup-db
:auto-migrate
true
)
(
load-test-datasets
)
(
metabase.models.setting/set
:site-name
"Metabase Test"
))))]
(
core/start-jetty
)
@
setup-db
))
...
...
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