Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
75b1837d
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,发现更多精彩内容 >>
提交
75b1837d
编写于
1月 15, 2019
作者:
R
Robert Speicher
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'allow-to-quarantine-tests' into 'master'
Allow to quarantine tests See merge request gitlab-org/gitlab-ce!24369
上级
3499da77
d71eb8fc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
37 addition
and
4 deletion
+37
-4
.gitlab-ci.yml
.gitlab-ci.yml
+16
-0
doc/development/testing_guide/flaky_tests.md
doc/development/testing_guide/flaky_tests.md
+12
-0
spec/features/boards/boards_spec.rb
spec/features/boards/boards_spec.rb
+3
-3
spec/spec_helper.rb
spec/spec_helper.rb
+6
-1
未找到文件。
.gitlab-ci.yml
浏览文件 @
75b1837d
...
...
@@ -499,6 +499,22 @@ rspec-mysql:
<<
:
*rspec-metadata-mysql
parallel
:
50
.rspec-quarantine
:
&rspec-quarantine
script
:
-
export CACHE_CLASSES=true
-
scripts/gitaly-test-spawn
-
bin/rspec --color --format documentation --tag quarantine spec/
rspec-pg-quarantine
:
<<
:
*rspec-metadata-pg
<<
:
*rspec-quarantine
allow_failure
:
true
rspec-mysql-quarantine
:
<<
:
*rspec-metadata-mysql
<<
:
*rspec-quarantine
allow_failure
:
true
static-analysis
:
<<
:
*dedicated-no-docs-no-db-pull-cache-job
dependencies
:
...
...
doc/development/testing_guide/flaky_tests.md
浏览文件 @
75b1837d
...
...
@@ -5,6 +5,18 @@
It's a test that sometimes fails, but if you retry it enough times, it passes,
eventually.
## Quarantined tests
Tests can be put in quarantine by assigning
`:quarantine`
metadata. This means
they will be skipped unless run with
`--tag quarantine`
. This can be used for
tests that are expected to fail while a fix is in progress (similar to how
[
`skip` or `pending`
](
https://relishapp.com/rspec/rspec-core/v/3-8/docs/pending-and-skipped-examples
)
can be used).
```
bin/rspec --tag quarantine
```
## Automatic retries and flaky tests detection
On our CI, we use [rspec-retry] to automatically retry a failing example a few
...
...
spec/features/boards/boards_spec.rb
浏览文件 @
75b1837d
...
...
@@ -97,7 +97,7 @@ describe 'Issue Boards', :js do
expect
(
find
(
'.board:nth-child(4)'
)).
to
have_selector
(
'.board-card'
)
end
it
'shows description tooltip on list title'
do
it
'shows description tooltip on list title'
,
:quarantine
do
page
.
within
(
'.board:nth-child(2)'
)
do
expect
(
find
(
'.board-title span.has-tooltip'
)[
:title
]).
to
eq
(
'Test'
)
end
...
...
@@ -411,7 +411,7 @@ describe 'Issue Boards', :js do
wait_for_empty_boards
((
2
..
4
))
end
it
'filters by label with space after reload'
do
it
'filters by label with space after reload'
,
:quarantine
do
set_filter
(
"label"
,
"
\"
#{
accepting
.
title
}
"
)
click_filter_link
(
accepting
.
title
)
submit_filter
...
...
@@ -477,7 +477,7 @@ describe 'Issue Boards', :js do
end
end
it
'filters by multiple labels'
do
it
'filters by multiple labels'
,
:quarantine
do
set_filter
(
"label"
,
testing
.
title
)
click_filter_link
(
testing
.
title
)
...
...
spec/spec_helper.rb
浏览文件 @
75b1837d
...
...
@@ -22,7 +22,7 @@ if rspec_profiling_is_configured && (!ENV.key?('CI') || branch_can_be_profiled)
require
'rspec_profiling/rspec'
end
if
ENV
[
'CI'
]
&&
!
ENV
[
'NO_KNAPSACK'
]
if
ENV
[
'CI'
]
&&
ENV
[
'KNAPSACK_GENERATE_REPORT'
]
&&
!
ENV
[
'NO_KNAPSACK'
]
require
'knapsack'
Knapsack
::
Adapters
::
RSpecAdapter
.
bind
end
...
...
@@ -132,6 +132,11 @@ RSpec.configure do |config|
Gitlab
::
ReleaseBlogPost
.
instance
.
instance_variable_set
(
:@url
,
'https://about.gitlab.com'
)
end
config
.
before
(
:example
,
:quarantine
)
do
# Skip tests in quarantine unless we explicitly focus on them.
skip
(
'In quarantine'
)
unless
config
.
inclusion_filter
[
:quarantine
]
end
config
.
before
(
:example
,
:request_store
)
do
RequestStore
.
begin!
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录