Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
c1bc5c58
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,发现更多精彩内容 >>
提交
c1bc5c58
编写于
5月 13, 2016
作者:
K
Kamil Trzcinski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added pipelines spec
上级
886bfb0a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
124 addition
and
6 deletion
+124
-6
app/views/projects/ci/commits/_commit.html.haml
app/views/projects/ci/commits/_commit.html.haml
+1
-1
spec/features/pipelines_spec.rb
spec/features/pipelines_spec.rb
+123
-5
未找到文件。
app/views/projects/ci/commits/_commit.html.haml
浏览文件 @
c1bc5c58
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
.controls.hidden-xs.pull-right
.controls.hidden-xs.pull-right
-
artifacts
=
commit
.
builds
.
latest
.
select
{
|
b
|
b
.
artifacts?
}
-
artifacts
=
commit
.
builds
.
latest
.
select
{
|
b
|
b
.
artifacts?
}
-
if
artifacts
.
present?
-
if
artifacts
.
present?
.dropdown.inline
.dropdown.inline
.build-artifacts
%button
.dropdown-toggle.btn
{
type:
'button'
,
'data-toggle'
=>
'dropdown'
}
%button
.dropdown-toggle.btn
{
type:
'button'
,
'data-toggle'
=>
'dropdown'
}
=
icon
(
'download'
)
=
icon
(
'download'
)
%b
.caret
%b
.caret
...
...
spec/features/pipelines_spec.rb
浏览文件 @
c1bc5c58
...
@@ -5,21 +5,139 @@ describe "Pipelines" do
...
@@ -5,21 +5,139 @@ describe "Pipelines" do
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
before
{
login_as
(
user
)
}
describe
"GET /:project/pipelines"
do
before
do
login_as
(
user
)
project
.
team
<<
[
user
,
:developer
]
end
describe
'GET /:project/pipelines'
do
let!
(
:pipeline
)
{
create
(
:ci_commit
,
project:
project
,
ref:
'master'
,
status:
'running'
)
}
[
:all
,
:running
,
:branches
].
each
do
|
scope
|
context
"displaying
#{
scope
}
"
do
let
(
:project
)
{
create
(
:project
)
}
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
,
scope:
scope
)
}
it
{
expect
(
page
).
to
have_content
(
pipeline
.
short_sha
)
}
end
end
context
'cancelable pipeline'
do
let!
(
:running
)
{
create
(
:ci_build
,
:running
,
commit:
pipeline
,
stage:
'test'
,
commands:
'test'
)
}
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
}
it
{
expect
(
page
).
to
have_link
(
'Cancel'
)
}
it
{
expect
(
page
).
to
have_selector
(
'.ci-running'
)
}
context
'when canceling'
do
before
{
click_link
(
'Cancel'
)
}
it
{
expect
(
page
).
to_not
have_link
(
'Cancel'
)
}
it
{
expect
(
page
).
to
have_selector
(
'.ci-canceled'
)
}
end
end
context
'retryable pipelines'
do
let!
(
:failed
)
{
create
(
:ci_build
,
:failed
,
commit:
pipeline
,
stage:
'test'
,
commands:
'test'
)
}
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
}
it
{
expect
(
page
).
to
have_link
(
'Retry'
)
}
it
{
expect
(
page
).
to
have_selector
(
'.ci-failed'
)
}
context
'when retrying'
do
before
{
click_link
(
'Retry'
)
}
it
{
expect
(
page
).
to_not
have_link
(
'Retry'
)
}
it
{
expect
(
page
).
to
have_selector
(
'.ci-running'
)
}
end
end
context
'downloadable pipelines'
do
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
}
context
'with artifacts'
do
let!
(
:with_artifacts
)
{
create
(
:ci_build
,
:success
,
:artifacts
,
commit:
pipeline
,
name:
'rspec tests'
,
stage:
'test'
)
}
it
{
expect
(
page
).
to
have_selector
(
'.build-artifacts'
)
}
it
{
expect
(
page
).
to
have_link
(
with_artifacts
.
name
)
}
end
context
'without artifacts'
do
let!
(
:without_artifacts
)
{
create
(
:ci_build
,
:success
,
commit:
pipeline
,
name:
'rspec'
,
stage:
'test'
)
}
it
{
expect
(
page
).
to_not
have_selector
(
'.build-artifacts'
)
}
end
end
end
end
describe
"GET /:project/pipelines/:id"
do
describe
'GET /:project/pipelines/:id'
do
let
(
:pipeline
)
{
create
(
:ci_commit
,
project:
project
,
ref:
'master'
)
}
let
(
:pipeline
)
{
create
(
:ci_commit
,
project:
project
,
ref:
'master'
)
}
before
do
before
do
create
(
:ci_build
,
:success
,
commit:
pipeline
)
@success
=
create
(
:ci_build
,
:success
,
commit:
pipeline
,
stage:
'build'
)
@failed
=
create
(
:ci_build
,
:failed
,
commit:
pipeline
,
stage:
'test'
,
commands:
'test'
)
@running
=
create
(
:ci_build
,
:running
,
commit:
pipeline
,
stage:
'deploy'
)
@external
=
create
(
:generic_commit_status
,
:success
,
commit:
pipeline
,
stage:
'external'
)
end
end
before
{
visit
namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
)
}
before
{
visit
namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
)
}
it
{
expect
(
page
).
to
()}
it
'showing a list of builds'
do
expect
(
page
).
to
have_content
(
'Tests'
)
expect
(
page
).
to
have_content
(
@success
.
id
)
expect
(
page
).
to
have_content
(
'Deploy'
)
expect
(
page
).
to
have_content
(
@failed
.
id
)
expect
(
page
).
to
have_content
(
@running
.
id
)
expect
(
page
).
to
have_content
(
@external
.
id
)
expect
(
page
).
to
have_content
(
'Retry failed'
)
expect
(
page
).
to
have_content
(
'Cancel running'
)
end
context
'retrying builds'
do
it
{
expect
(
page
).
to_not
have_content
(
'retried'
)
}
context
'when retrying'
do
before
{
click_on
'Retry failed'
}
it
{
expect
(
page
).
to_not
have_content
(
'Retry failed'
)
}
it
{
expect
(
page
).
to
have_content
(
'retried'
)
}
end
end
context
'canceling builds'
do
it
{
expect
(
page
).
to_not
have_selector
(
'.ci-canceled'
)
}
context
'when canceling'
do
before
{
click_on
'Cancel running'
}
it
{
expect
(
page
).
to_not
have_content
(
'Cancel running'
)
}
it
{
expect
(
page
).
to
have_selector
(
'.ci-canceled'
)
}
end
end
end
describe
'POST /:project/pipelines'
do
let
(
:project
)
{
create
(
:project
)
}
before
{
visit
new_namespace_project_pipeline_path
(
project
.
namespace
,
project
)
}
context
'for valid commit'
do
before
{
fill_in
(
'Create for'
,
with:
'master'
)
}
it
{
expect
{
click_on
'Create pipeline'
}.
to
change
{
Ci
::
Commit
.
count
}.
by
(
1
)
}
end
context
'for invalid commit'
do
before
do
fill_in
(
'Create for'
,
with:
'invalid reference'
)
click_on
'Create pipeline'
end
it
{
expect
(
page
).
to
have_content
(
'Reference not found'
)
}
end
end
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录