Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f12c3329
Commit
f12c3329
authored
Mar 18, 2022
by
Piotr Skorupa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sorting hashes to get clearer diffs
parent
2723dea7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
ee/spec/lib/ee/gitlab/usage/service_ping_report_spec.rb
ee/spec/lib/ee/gitlab/usage/service_ping_report_spec.rb
+10
-2
No files found.
ee/spec/lib/ee/gitlab/usage/service_ping_report_spec.rb
View file @
f12c3329
...
...
@@ -59,7 +59,7 @@ RSpec.describe Gitlab::Usage::ServicePingReport, :use_clean_rails_memory_store_c
end
let
(
:stored_queries_hash
)
do
Gitlab
::
Json
.
parse
(
stored_queries_fixture
).
with_indifferent_access
deep_sort_hash
(
Gitlab
::
Json
.
parse
(
stored_queries_fixture
).
with_indifferent_access
)
end
before
do
...
...
@@ -73,7 +73,7 @@ RSpec.describe Gitlab::Usage::ServicePingReport, :use_clean_rails_memory_store_c
it
'does not change SQL metric queries'
do
report
=
Timecop
.
freeze
(
2021
,
1
,
1
)
do
de
scribed_class
.
for
(
output: :metrics_queries
).
with_indifferent_access
de
ep_sort_hash
(
described_class
.
for
(
output: :metrics_queries
).
with_indifferent_access
)
end
remove_ignored_metrics!
(
report
)
...
...
@@ -94,5 +94,13 @@ RSpec.describe Gitlab::Usage::ServicePingReport, :use_clean_rails_memory_store_c
keys
.
inject
(
hash
,
:fetch
)[
last_key
]
=
nil
end
end
def
deep_sort_hash
(
object
)
if
object
.
is_a?
(
Hash
)
object
.
map
{
|
k
,
v
|
[
k
,
deep_sort_hash
(
v
)]
}.
sort
.
to_h
else
object
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment