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
9f5d7e00
Unverified
Commit
9f5d7e00
authored
1 year ago
by
Ngoc Khuat
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix `with-temporary-setting-values` incorrectly identify whether it's in a parallel test (#32382)
parent
54109eeb
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/metabase/server/request/util_test.clj
+1
-1
1 addition, 1 deletion
test/metabase/server/request/util_test.clj
test/metabase/test/util.clj
+1
-2
1 addition, 2 deletions
test/metabase/test/util.clj
with
2 additions
and
3 deletions
test/metabase/server/request/util_test.clj
+
1
−
1
View file @
9f5d7e00
...
...
@@ -54,7 +54,7 @@
nil
nil
))
(
deftest
^
:parallel
ip-address-test
(
deftest
ip-address-test
(
let
[
request
(
ring.mock/request
:get
"api/session"
)]
(
testing
"request with no forwarding"
(
is
(
=
"127.0.0.1"
...
...
This diff is collapsed.
Click to expand it.
test/metabase/test/util.clj
+
1
−
2
View file @
9f5d7e00
...
...
@@ -374,6 +374,7 @@
Prefer the macro [[with-temporary-setting-values]] or [[with-temporary-raw-setting-values]] over using this function directly."
[
setting-k
value
thunk
&
{
:keys
[
raw-setting?
]}]
;; plugins have to be initialized because changing `report-timezone` will call driver methods
(
mb.hawk.parallel/assert-test-is-not-parallel
"do-with-temporary-setting-value"
)
(
initialize/initialize-if-needed!
:db
:plugins
)
(
let
[
setting-k
(
name
setting-k
)
setting
(
try
...
...
@@ -421,7 +422,6 @@
To temporarily override the value of *read-only* env vars, use [[with-temp-env-var-value]]."
[[
setting-k
value
&
more
:as
bindings
]
&
body
]
(
assert
(
even?
(
count
bindings
))
"mismatched setting/value pairs: is each setting name followed by a value?"
)
(
mb.hawk.parallel/assert-test-is-not-parallel
"with-temporary-setting-vales"
)
(
if
(
empty?
bindings
)
`
(
do
~@
body
)
`
(
do-with-temporary-setting-value
~
(
keyword
setting-k
)
~
value
...
...
@@ -434,7 +434,6 @@
using [[metabase.models.setting/defsetting]]."
[[
setting-k
value
&
more
:as
bindings
]
&
body
]
(
assert
(
even?
(
count
bindings
))
"mismatched setting/value pairs: is each setting name followed by a value?"
)
(
mb.hawk.parallel/assert-test-is-not-parallel
"with-temporary-raw-setting-values"
)
(
if
(
empty?
bindings
)
`
(
do
~@
body
)
`
(
do-with-temporary-setting-value
~
(
keyword
setting-k
)
~
value
...
...
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