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
06b72021
Commit
06b72021
authored
Feb 28, 2020
by
lauraMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds feature spec
parent
107c601f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
130 additions
and
2 deletions
+130
-2
spec/features/error_tracking/user_searches_sentry_errors_spec.rb
...atures/error_tracking/user_searches_sentry_errors_spec.rb
+42
-0
spec/fixtures/sentry/error_list_search_response.json
spec/fixtures/sentry/error_list_search_response.json
+42
-0
spec/fixtures/sentry/issues_sample_response.json
spec/fixtures/sentry/issues_sample_response.json
+46
-2
No files found.
spec/features/error_tracking/user_searches_sentry_errors_spec.rb
0 → 100644
View file @
06b72021
# frozen_string_literal: true
require
'spec_helper'
describe
'When a user searches for Sentry errors'
,
:js
,
:use_clean_rails_memory_store_caching
,
:sidekiq_inline
do
include_context
'sentry error tracking context feature'
let_it_be
(
:issues_response_body
)
{
fixture_file
(
'sentry/issues_sample_response.json'
)
}
let_it_be
(
:error_search_response_body
)
{
fixture_file
(
'sentry/error_list_search_response.json'
)
}
let
(
:issues_api_url
)
{
"
#{
sentry_api_urls
.
issues_url
}
?limit=20&query=is:unresolved"
}
let
(
:issues_api_url_search
)
{
"
#{
sentry_api_urls
.
issues_url
}
?limit=20&query=is:unresolved%20NotFound"
}
before
do
stub_request
(
:get
,
issues_api_url
).
with
(
headers:
{
'Authorization'
=>
'Bearer access_token_123'
}
).
to_return
(
status:
200
,
body:
issues_response_body
,
headers:
{
'Content-Type'
=>
'application/json'
})
stub_request
(
:get
,
issues_api_url_search
).
with
(
headers:
{
'Authorization'
=>
'Bearer access_token_123'
,
'Content-Type'
=>
'application/json'
}
).
to_return
(
status:
200
,
body:
error_search_response_body
,
headers:
{
'Content-Type'
=>
'application/json'
})
end
it
'displays the results'
do
sign_in
(
project
.
owner
)
visit
project_error_tracking_index_path
(
project
)
page
.
within
(
find
(
'.gl-table'
))
do
results
=
page
.
all
(
'.table-row'
)
expect
(
results
.
count
).
to
be
(
2
)
end
find
(
'.gl-form-input'
).
set
(
'NotFound'
).
native
.
send_keys
(
:return
)
wait_for_requests
page
.
within
(
find
(
'.gl-table'
))
do
results
=
page
.
all
(
'.table-row'
)
expect
(
results
.
count
).
to
be
(
1
)
expect
(
results
.
first
).
to
have_content
(
'NotFound'
)
end
end
end
spec/fixtures/sentry/error_list_search_response.json
0 → 100644
View file @
06b72021
[{
"lastSeen"
:
"2018-12-31T12:00:11Z"
,
"numComments"
:
0
,
"userCount"
:
0
,
"stats"
:
{
"24h"
:
[
[
1546437600
,
0
]
]
},
"culprit"
:
"sentry.tasks.reports.deliver_organization_user_report"
,
"title"
:
"NotFound desc = GetRepoPath: not a git repository"
,
"id"
:
"13"
,
"assignedTo"
:
null
,
"logger"
:
null
,
"type"
:
"error"
,
"annotations"
:
[],
"metadata"
:
{
"type"
:
"gaierror"
,
"value"
:
"[Errno -2] Name or service not known"
},
"status"
:
"unresolved"
,
"subscriptionDetails"
:
null
,
"isPublic"
:
false
,
"hasSeen"
:
false
,
"shortId"
:
"INTERNAL-4"
,
"shareId"
:
null
,
"firstSeen"
:
"2018-12-17T12:00:14Z"
,
"count"
:
"17283712"
,
"permalink"
:
"35.228.54.90/sentry/internal/issues/13/"
,
"level"
:
"error"
,
"isSubscribed"
:
true
,
"isBookmarked"
:
false
,
"project"
:
{
"slug"
:
"internal"
,
"id"
:
"1"
,
"name"
:
"Internal"
},
"statusDetails"
:
{}
}]
spec/fixtures/sentry/issues_sample_response.json
View file @
06b72021
[{
[
{
"lastSeen"
:
"2018-12-31T12:00:11Z"
,
"numComments"
:
0
,
"userCount"
:
0
,
...
...
@@ -39,4 +40,47 @@
"name"
:
"Internal"
},
"statusDetails"
:
{}
}]
},
{
"lastSeen"
:
"2018-12-31T12:00:11Z"
,
"numComments"
:
0
,
"userCount"
:
0
,
"stats"
:
{
"24h"
:
[
[
1546437600
,
0
]
]
},
"culprit"
:
"sentry.tasks.reports.deliver_organization_user_report"
,
"title"
:
"NotFound desc = GetRepoPath: not a git repository"
,
"id"
:
"13"
,
"assignedTo"
:
null
,
"logger"
:
null
,
"type"
:
"error"
,
"annotations"
:
[],
"metadata"
:
{
"type"
:
"gaierror"
,
"value"
:
"GetRepoPath: not a git repository"
},
"status"
:
"unresolved"
,
"subscriptionDetails"
:
null
,
"isPublic"
:
false
,
"hasSeen"
:
false
,
"shortId"
:
"INTERNAL-4"
,
"shareId"
:
null
,
"firstSeen"
:
"2018-12-17T12:00:14Z"
,
"count"
:
"17283712"
,
"permalink"
:
"35.228.54.90/sentry/internal/issues/13/"
,
"level"
:
"error"
,
"isSubscribed"
:
true
,
"isBookmarked"
:
false
,
"project"
:
{
"slug"
:
"internal"
,
"id"
:
"1"
,
"name"
:
"Internal"
},
"statusDetails"
:
{}
}
]
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