Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
bef1bd93
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bef1bd93
编写于
2月 08, 2020
作者:
G
GitLab Bot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add latest changes from gitlab-org/gitlab@master
上级
0c6bc544
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
24 addition
and
20 deletion
+24
-20
spec/support/shared_contexts/features/error_tracking_shared_context.rb
...shared_contexts/features/error_tracking_shared_context.rb
+10
-2
spec/support/shared_examples/features/error_tracking_shared_example.rb
...shared_examples/features/error_tracking_shared_example.rb
+14
-18
未找到文件。
spec/support/shared_contexts/features/error_tracking_shared_context.rb
浏览文件 @
bef1bd93
...
...
@@ -11,17 +11,25 @@ shared_context 'sentry error tracking context feature' do
let_it_be
(
:event_response
)
{
JSON
.
parse
(
event_response_body
)
}
let
(
:sentry_api_urls
)
{
Sentry
::
ApiUrls
.
new
(
project_error_tracking_settings
.
api_url
)
}
let
(
:issue_id
)
{
issue_response
[
'id'
]
}
let
(
:issue_seen
)
{
1
.
year
.
ago
.
utc
}
let
(
:formatted_issue_seen
)
{
issue_seen
.
strftime
(
"%Y-%m-%d %I:%M:%S%p %Z"
)
}
let
(
:date_received
)
{
1
.
month
.
ago
.
utc
}
before
do
request_headers
=
{
'Authorization'
=>
'Bearer access_token_123'
,
'Content-Type'
=>
'application/json'
}
response_headers
=
{
'Content-Type'
=>
'application/json'
}
issue_response
[
'firstSeen'
]
=
issue_seen
.
iso8601
(
6
)
issue_response
[
'lastSeen'
]
=
issue_seen
.
iso8601
(
6
)
event_response
[
'dateReceived'
]
=
date_received
.
iso8601
(
6
)
issue_url
=
sentry_api_urls
.
issue_url
(
issue_id
).
to_s
stub_request
(
:get
,
issue_url
)
.
with
(
headers:
request_headers
)
.
to_return
(
status:
200
,
body:
issue_response
_body
,
headers:
response_headers
)
.
to_return
(
status:
200
,
body:
issue_response
.
to_json
,
headers:
response_headers
)
event_url
=
sentry_api_urls
.
issue_latest_event_url
(
issue_id
).
to_s
stub_request
(
:get
,
event_url
)
.
with
(
headers:
request_headers
)
.
to_return
(
status:
200
,
body:
event_response
_body
,
headers:
response_headers
)
.
to_return
(
status:
200
,
body:
event_response
.
to_json
,
headers:
response_headers
)
end
end
spec/support/shared_examples/features/error_tracking_shared_example.rb
浏览文件 @
bef1bd93
...
...
@@ -24,7 +24,6 @@ shared_examples 'error tracking index page' do
end
it
'renders the error index data'
do
Timecop
.
freeze
(
2020
,
01
,
01
,
12
,
0
,
0
)
do
within
(
'div.error-list'
)
do
expect
(
page
).
to
have_content
(
issues_response
[
0
][
'title'
])
expect
(
page
).
to
have_content
(
issues_response
[
0
][
'count'
].
to_s
)
...
...
@@ -32,7 +31,6 @@ shared_examples 'error tracking index page' do
expect
(
page
).
to
have_content
(
'1 year ago'
)
end
end
end
end
shared_examples
'expanded stack trace context'
do
|
selected_line:
nil
,
expected_line:
1
|
...
...
@@ -54,18 +52,16 @@ shared_examples 'error tracking show page' do
it
'renders the error details'
do
release_short_version
=
issue_response
[
'firstRelease'
][
'shortVersion'
]
Timecop
.
freeze
(
2020
,
01
,
01
,
12
,
0
,
0
)
do
expect
(
page
).
to
have_content
(
'1 month ago by raven.scripts.runner in main'
)
expect
(
page
).
to
have_content
(
issue_response
[
'metadata'
][
'title'
])
expect
(
page
).
to
have_content
(
'level: error'
)
expect
(
page
).
to
have_content
(
'Error Details'
)
expect
(
page
).
to
have_content
(
'GitLab Issue: https://gitlab.com/gitlab-org/gitlab/issues/1'
)
expect
(
page
).
to
have_content
(
"Sentry event: https://sentrytest.gitlab.com/sentry-org/sentry-project/issues/
#{
issue_id
}
"
)
expect
(
page
).
to
have_content
(
"First seen: 1 year ago (2018-11-06 9:19:55PM UTC
) Release:
#{
release_short_version
}
"
)
expect
(
page
).
to
have_content
(
"First seen: 1 year ago (
#{
formatted_issue_seen
}
) Release:
#{
release_short_version
}
"
)
expect
(
page
).
to
have_content
(
'Events: 1'
)
expect
(
page
).
to
have_content
(
'Users: 0'
)
end
end
it
'renders the stack trace heading'
do
expect
(
page
).
to
have_content
(
'Stack trace'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录