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
9584a714
Commit
9584a714
authored
Jan 07, 2021
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for additional tag
parent
b1c50a0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
20 deletions
+54
-20
spec/lib/gitlab/database/reindexing/grafana_notifier_spec.rb
spec/lib/gitlab/database/reindexing/grafana_notifier_spec.rb
+54
-20
No files found.
spec/lib/gitlab/database/reindexing/grafana_notifier_spec.rb
View file @
9584a714
...
...
@@ -74,32 +74,66 @@ RSpec.describe Gitlab::Database::Reindexing::GrafanaNotifier do
end
describe
'#notify_start'
do
subject
{
described_class
.
new
(
api_key
,
api_url
,
additional_tag
).
notify_start
(
action
)
}
let
(
:payload
)
do
{
time:
(
action
.
action_start
.
utc
.
to_f
*
1000
).
to_i
,
tags:
[
'reindex'
,
additional_tag
,
action
.
index
.
tablename
,
action
.
index
.
name
],
text:
"Started reindexing of
#{
action
.
index
.
name
}
on
#{
action
.
index
.
tablename
}
"
}
context
'additional tag is nil'
do
subject
{
described_class
.
new
(
api_key
,
api_url
,
nil
).
notify_start
(
action
)
}
let
(
:payload
)
do
{
time:
(
action
.
action_start
.
utc
.
to_f
*
1000
).
to_i
,
tags:
[
'reindex'
,
action
.
index
.
tablename
,
action
.
index
.
name
],
text:
"Started reindexing of
#{
action
.
index
.
name
}
on
#{
action
.
index
.
tablename
}
"
}
end
it_behaves_like
'interacting with Grafana annotations API'
end
it_behaves_like
'interacting with Grafana annotations API'
context
'additional tag is not nil'
do
subject
{
described_class
.
new
(
api_key
,
api_url
,
additional_tag
).
notify_start
(
action
)
}
let
(
:payload
)
do
{
time:
(
action
.
action_start
.
utc
.
to_f
*
1000
).
to_i
,
tags:
[
'reindex'
,
additional_tag
,
action
.
index
.
tablename
,
action
.
index
.
name
],
text:
"Started reindexing of
#{
action
.
index
.
name
}
on
#{
action
.
index
.
tablename
}
"
}
end
it_behaves_like
'interacting with Grafana annotations API'
end
end
describe
'#notify_end'
do
subject
{
described_class
.
new
(
api_key
,
api_url
,
additional_tag
).
notify_end
(
action
)
}
let
(
:payload
)
do
{
time:
(
action
.
action_start
.
utc
.
to_f
*
1000
).
to_i
,
tags:
[
'reindex'
,
additional_tag
,
action
.
index
.
tablename
,
action
.
index
.
name
],
text:
"Finished reindexing of
#{
action
.
index
.
name
}
on
#{
action
.
index
.
tablename
}
(
#{
action
.
state
}
)"
,
timeEnd:
(
action
.
action_end
.
utc
.
to_f
*
1000
).
to_i
,
isRegion:
true
}
context
'additional tag is nil'
do
subject
{
described_class
.
new
(
api_key
,
api_url
,
nil
).
notify_end
(
action
)
}
let
(
:payload
)
do
{
time:
(
action
.
action_start
.
utc
.
to_f
*
1000
).
to_i
,
tags:
[
'reindex'
,
action
.
index
.
tablename
,
action
.
index
.
name
],
text:
"Finished reindexing of
#{
action
.
index
.
name
}
on
#{
action
.
index
.
tablename
}
(
#{
action
.
state
}
)"
,
timeEnd:
(
action
.
action_end
.
utc
.
to_f
*
1000
).
to_i
,
isRegion:
true
}
end
it_behaves_like
'interacting with Grafana annotations API'
end
it_behaves_like
'interacting with Grafana annotations API'
context
'additional tag is not nil'
do
subject
{
described_class
.
new
(
api_key
,
api_url
,
additional_tag
).
notify_end
(
action
)
}
let
(
:payload
)
do
{
time:
(
action
.
action_start
.
utc
.
to_f
*
1000
).
to_i
,
tags:
[
'reindex'
,
additional_tag
,
action
.
index
.
tablename
,
action
.
index
.
name
],
text:
"Finished reindexing of
#{
action
.
index
.
name
}
on
#{
action
.
index
.
tablename
}
(
#{
action
.
state
}
)"
,
timeEnd:
(
action
.
action_end
.
utc
.
to_f
*
1000
).
to_i
,
isRegion:
true
}
end
it_behaves_like
'interacting with Grafana annotations API'
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