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
4809e8d9
Unverified
Commit
4809e8d9
authored
2 years ago
by
Cam Saul
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused `refresh-integration-test-data-metadata` command (#24075)
parent
53983922
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/metabase/cmd.clj
+0
-6
0 additions, 6 deletions
src/metabase/cmd.clj
src/metabase/cmd/refresh_integration_test_db_metadata.clj
+0
-40
0 additions, 40 deletions
src/metabase/cmd/refresh_integration_test_db_metadata.clj
with
0 additions
and
46 deletions
src/metabase/cmd.clj
+
0
−
6
View file @
4809e8d9
...
...
@@ -73,12 +73,6 @@
(
classloader/require
'metabase.cmd.reset-password
)
((
resolve
'metabase.cmd.reset-password/reset-password!
)
email-address
))
(
defn
^
:command
refresh-integration-test-db-metadata
"Re-sync the frontend integration test DB's metadata for the Sample Database."
[]
(
classloader/require
'metabase.cmd.refresh-integration-test-db-metadata
)
((
resolve
'metabase.cmd.refresh-integration-test-db-metadata/refresh-integration-test-db-metadata
)))
(
defn
^
:command
help
"Show this help message listing valid Metabase commands."
[]
...
...
This diff is collapsed.
Click to expand it.
src/metabase/cmd/refresh_integration_test_db_metadata.clj
deleted
100644 → 0
+
0
−
40
View file @
53983922
(
ns
metabase.cmd.refresh-integration-test-db-metadata
(
:require
[
clojure.java.io
:as
io
]
[
environ.core
:as
env
]
[
metabase.db
:as
mdb
]
[
metabase.models.database
:refer
[
Database
]]
[
metabase.models.field
:refer
[
Field
]]
[
metabase.sample-data
:as
sample-data
]
[
metabase.sync
:as
sync
]
[
toucan.db
:as
db
]))
(
defn-
test-fixture-db-path
"Get the path to the test fixture DB that we'll use for `MB_DB_FILE`. Throw an Exception if the file doesn't exist."
[]
(
let
[
path
(
str
(
System/getProperty
"user.dir"
)
"/frontend/test/__runner__/test_db_fixture.db"
)]
(
when-not
(
or
(
.exists
(
io/file
(
str
path
".h2.db"
)))
(
.exists
(
io/file
(
str
path
".mv.db"
))))
(
throw
(
Exception.
(
str
"Could not find frontend integration test DB at path: "
path
".h2.db (or .mv.db)"
))))
path
))
(
defn
^
:command
refresh-integration-test-db-metadata
"Re-sync the frontend integration test DB's metadata for the Sample Database"
[]
(
let
[
db-path
(
test-fixture-db-path
)]
;; now set the path at MB_DB_FILE
(
alter-var-root
#
'env/env
assoc
:mb-db-type
"h2"
,
:mb-db-file
db-path
)
;; set up the DB, make sure sample database is added
(
mdb/setup-db!
)
(
sample-data/add-sample-database!
)
(
sample-data/update-sample-database-if-needed!
)
;; clear out all Fingerprints so we force analysis to run again. Clear out semantic type and has_field_values as
;; well so we can be sure those will be set to the correct values
(
db/debug-print-queries
(
db/update!
Field
{
:set
{
:fingerprint_version
0
:semantic_type
nil
:has_field_values
nil
:fk_target_field_id
nil
}}))
;; now re-run sync
(
sync/sync-database!
(
Database
:is_sample
true
))
;; done!
(
println
"Finished."
)))
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