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
5ca09b8f
Unverified
Commit
5ca09b8f
authored
2 years ago
by
Braden Shepherdson
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Deflake the Serdes v2 e2e test by ensuring generated inputs are unique (#24320)
parent
18f05904
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/metabase/test/generate.clj
+17
-0
17 additions, 0 deletions
test/metabase/test/generate.clj
with
17 additions
and
0 deletions
test/metabase/test/generate.clj
+
17
−
0
View file @
5ca09b8f
...
...
@@ -281,6 +281,11 @@
(
def
^
:private
unique-name
(
mbql.u/unique-name-generator
))
(
defn-
unique-email
[
email
]
(
let
[
at
(
.indexOf
email
"@"
)]
(
str
(
unique-name
(
subs
email
0
at
))
(
subs
email
at
))))
(
def
^
:private
field-positions
(
atom
{
:table-fields
{}}))
(
defn-
adjust
"Some fields have to be semantically correct, or db correct. fields have position, and they do have to be unique.
...
...
@@ -295,6 +300,14 @@
(
->
(
swap!
field-positions
update-in
[
:table-fields
(
:table_id
visit-val
)]
(
fnil
inc
0
))
(
get-in
[
:table-fields
(
:table_id
visit-val
)])))
;; Users' emails need to be unique. This enforces it, and appends junk to before the @ if needed.
(
=
ent-type
:core_user
)
(
update
:email
unique-email
)
;; Database names need to be unique. This enforces it, and appends junk to names if needed.
(
=
ent-type
:database
)
(
update
:name
unique-name
)
;; Table names need to be unique within their database. This enforces it, and appends junk to names if needed.
(
=
ent-type
:table
)
(
update
:name
unique-name
)
...
...
@@ -303,6 +316,10 @@
(
=
ent-type
:field
)
(
update
:name
unique-name
)
;; Native Query Snippet names need to be unique. This enforces it, and appends junk to names if needed.
(
=
ent-type
:native-query-snippet
)
(
update
:name
unique-name
)
;; [Field ID, Dimension name] pairs need to be unique. This enforces it, and appends junk to names if needed.
(
=
ent-type
:dimension
)
(
update
:name
unique-name
)
...
...
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