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
74331396
Commit
74331396
authored
Mar 12, 2021
by
Piotr Skorupa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add RedisHllGenerator specs
parent
ffe3e8c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
spec/lib/generators/gitlab/usage_metric_definition/redis_hll_generator_spec.rb
...itlab/usage_metric_definition/redis_hll_generator_spec.rb
+26
-0
No files found.
spec/lib/generators/gitlab/usage_metric_definition/redis_hll_generator_spec.rb
0 → 100644
View file @
74331396
# frozen_string_literal: true
require
'generator_helper'
RSpec
.
describe
Gitlab
::
UsageMetricDefinition
::
RedisHllGenerator
do
let
(
:category
)
{
'test_category'
}
let
(
:event
)
{
'i_test_event'
}
let
(
:args
)
{
[
category
,
event
]
}
let
(
:temp_dir
)
{
Dir
.
mktmpdir
}
# Interpolating to preload the class
# See https://github.com/rspec/rspec-mocks/issues/1079
before
do
stub_const
(
"
#{
Gitlab
::
UsageMetricDefinitionGenerator
}
::TOP_LEVEL_DIR"
,
temp_dir
)
end
it
'creates metric definition files'
do
described_class
.
new
(
args
).
invoke_all
weekly_metric_definition_path
=
Dir
.
glob
(
File
.
join
(
temp_dir
,
'metrics/counts_7d/*i_test_event.yml'
)).
first
monthly_metric_definition_path
=
Dir
.
glob
(
File
.
join
(
temp_dir
,
'metrics/counts_28d/*i_test_event.yml'
)).
first
expect
(
YAML
.
safe_load
(
File
.
read
(
weekly_metric_definition_path
))).
to
include
(
"key_path"
=>
"redis_hll_counters.test_category.i_test_event"
)
expect
(
YAML
.
safe_load
(
File
.
read
(
monthly_metric_definition_path
))).
to
include
(
"key_path"
=>
"redis_hll_counters.test_category.i_test_event"
)
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