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
09a03bae
Commit
09a03bae
authored
Feb 09, 2021
by
Quang-Minh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor ErrorTracking test
parent
35dd5bb3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
spec/lib/gitlab/error_tracking_spec.rb
spec/lib/gitlab/error_tracking_spec.rb
+12
-4
No files found.
spec/lib/gitlab/error_tracking_spec.rb
View file @
09a03bae
...
...
@@ -8,16 +8,18 @@ RSpec.describe Gitlab::ErrorTracking do
let
(
:exception
)
{
RuntimeError
.
new
(
'boom'
)
}
let
(
:issue_url
)
{
'http://gitlab.com/gitlab-org/gitlab-foss/issues/1'
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:sentry_payload
)
do
{
tags:
{
program:
'test'
,
locale:
'en'
,
feature_category:
nil
,
feature_category:
'feature_a'
,
correlation_id:
'cid'
},
user:
{
username:
nil
username:
user
.
username
},
extra:
{
some_other_info:
'info'
,
...
...
@@ -32,9 +34,9 @@ RSpec.describe Gitlab::ErrorTracking do
'exception.message'
=>
'boom'
,
'tags.program'
=>
'test'
,
'tags.locale'
=>
'en'
,
'tags.feature_category'
=>
nil
,
'tags.feature_category'
=>
'feature_a'
,
'tags.correlation_id'
=>
'cid'
,
'user.username'
=>
nil
,
'user.username'
=>
user
.
username
,
'extra.some_other_info'
=>
'info'
,
'extra.issue_url'
=>
'http://gitlab.com/gitlab-org/gitlab-foss/issues/1'
}
...
...
@@ -52,6 +54,12 @@ RSpec.describe Gitlab::ErrorTracking do
end
end
around
do
|
example
|
Gitlab
::
ApplicationContext
.
with_context
(
user:
user
,
feature_category:
'feature_a'
)
do
example
.
run
end
end
describe
'.track_and_raise_for_dev_exception'
do
context
'when exceptions for dev should be raised'
do
before
do
...
...
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