Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
46898c40
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,发现更多精彩内容 >>
提交
46898c40
编写于
11月 17, 2016
作者:
R
Regis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
working on tests
上级
bd0e6936
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
151 addition
and
28 deletion
+151
-28
app/assets/javascripts/vue_pipelines_index/pipeline_actions.js.es6
...s/javascripts/vue_pipelines_index/pipeline_actions.js.es6
+1
-1
app/assets/javascripts/vue_pipelines_index/store.js.es6
app/assets/javascripts/vue_pipelines_index/store.js.es6
+3
-3
spec/features/projects/pipelines_spec.rb
spec/features/projects/pipelines_spec.rb
+147
-24
未找到文件。
app/assets/javascripts/vue_pipelines_index/pipeline_actions.js.es6
浏览文件 @
46898c40
...
...
@@ -47,7 +47,7 @@
>
</path>
</svg>
<span>{{action.name}}</span>
<span
title="Manual build"
>{{action.name}}</span>
</a>
</li>
</ul>
...
...
app/assets/javascripts/vue_pipelines_index/store.js.es6
浏览文件 @
46898c40
...
...
@@ -35,7 +35,7 @@
gl.PipelineStore = class {
fetchDataLoop(Vue, pageNum, url) {
Vue.activeResources = 0;
const update
NumberOfPipeline
s = (total, running) => {
const update
PipelineNum
s = (total, running) => {
document.querySelector('.js-totalbuilds-count').innerHTML = total;
document.querySelector('.js-running-count').innerHTML = running;
};
...
...
@@ -55,7 +55,7 @@
Vue.set(this, 'updatedAt', res.updated_at);
Vue.set(this, 'pipelines', res.pipelines);
Vue.set(this, 'count', res.count);
update
NumberOfPipeline
s(this.count.all, this.count.running_or_pending);
update
PipelineNum
s(this.count.all, this.count.running_or_pending);
this.pageRequest = false;
Vue.activeResources -= 1;
}, () => new Flash(
...
...
@@ -70,7 +70,7 @@
Vue.set(this, 'updatedAt', res.updated_at);
Vue.set(this, 'pipelines', p.updatePipelines(res));
Vue.set(this, 'count', res.count);
update
NumberOfPipeline
s(this.count.all, this.count.running_or_pending);
update
PipelineNum
s(this.count.all, this.count.running_or_pending);
Vue.activeResources -= 1;
}, () => new Flash(
'Something went wrong on our end.'
...
...
spec/features/projects/pipelines_spec.rb
浏览文件 @
46898c40
...
...
@@ -16,13 +16,25 @@ describe "Pipelines", feature: true, js: true do
describe
'GET /:project/pipelines'
,
feature:
true
,
js:
true
do
include
WaitForVueResource
let!
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
project:
project
,
ref:
'master'
,
status:
'running'
)
}
let!
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
ref:
'master'
,
status:
'running'
)
end
[
:pipelines
].
each
do
|
scope
|
context
"displaying
#{
scope
}
"
do
let
(
:project
)
{
create
(
:project
)
}
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
,
scope:
scope
)
}
before
do
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
,
scope:
scope
)
end
it
do
wait_for_vue_resource
...
...
@@ -35,20 +47,29 @@ describe "Pipelines", feature: true, js: true do
context
"displaying
#{
scope
}
"
do
let
(
:project
)
{
create
(
:project
)
}
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
,
scope:
scope
)
}
before
do
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
,
scope:
scope
)
end
it
{
expect
(
page
).
to
have_content
(
pipeline
.
short_sha
)
}
end
end
context
'anonymous access'
do
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
}
before
do
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
end
it
{
expect
(
page
).
to
have_http_status
(
:success
)
}
end
context
'cancelable pipeline'
do
let!
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
stage:
'test'
,
commands:
'test'
)
}
let!
(
:build
)
do
create
(
:ci_build
,
pipeline:
pipeline
,
stage:
'test'
,
commands:
'test'
)
end
before
do
build
.
run
...
...
@@ -84,7 +105,9 @@ describe "Pipelines", feature: true, js: true do
end
context
'retryable pipelines'
do
let!
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
stage:
'test'
,
commands:
'test'
)
}
let!
(
:build
)
do
create
(
:ci_build
,
pipeline:
pipeline
,
stage:
'test'
,
commands:
'test'
)
end
before
do
build
.
drop
...
...
@@ -103,9 +126,20 @@ describe "Pipelines", feature: true, js: true do
end
context
'with manual actions'
do
let!
(
:manual
)
{
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'manual build'
,
stage:
'test'
,
commands:
'test'
)
}
let!
(
:manual
)
do
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'manual build'
,
stage:
'test'
,
commands:
'test'
)
end
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
}
before
do
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
end
it
do
wait_for_vue_resource
...
...
@@ -127,7 +161,14 @@ describe "Pipelines", feature: true, js: true do
context
'for generic statuses'
do
context
'when running'
do
let!
(
:running
)
{
create
(
:generic_commit_status
,
status:
'running'
,
pipeline:
pipeline
,
stage:
'test'
)
}
let!
(
:running
)
do
create
(
:generic_commit_status
,
status:
'running'
,
pipeline:
pipeline
,
stage:
'test'
)
end
before
do
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
...
...
@@ -143,7 +184,14 @@ describe "Pipelines", feature: true, js: true do
end
context
'when failed'
do
let!
(
:status
)
{
create
(
:generic_commit_status
,
:pending
,
pipeline:
pipeline
,
stage:
'test'
)
}
let!
(
:status
)
do
create
(
:generic_commit_status
,
:pending
,
pipeline:
pipeline
,
stage:
'test'
)
end
before
do
status
.
drop
...
...
@@ -162,9 +210,20 @@ describe "Pipelines", feature: true, js: true do
context
'downloadable pipelines'
do
context
'with artifacts'
do
let!
(
:with_artifacts
)
{
create
(
:ci_build
,
:artifacts
,
:success
,
pipeline:
pipeline
,
name:
'rspec tests'
,
stage:
'test'
)
}
let!
(
:with_artifacts
)
do
create
(
:ci_build
,
:artifacts
,
:success
,
pipeline:
pipeline
,
name:
'rspec tests'
,
stage:
'test'
)
end
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
}
before
do
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
end
it
do
wait_for_vue_resource
...
...
@@ -178,17 +237,38 @@ describe "Pipelines", feature: true, js: true do
end
context
'with artifacts expired'
do
let!
(
:with_artifacts_expired
)
{
create
(
:ci_build
,
:artifacts_expired
,
:success
,
pipeline:
pipeline
,
name:
'rspec'
,
stage:
'test'
)
}
let!
(
:with_artifacts_expired
)
do
create
(
:ci_build
,
:artifacts_expired
,
:success
,
pipeline:
pipeline
,
name:
'rspec'
,
stage:
'test'
)
end
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
}
before
do
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
end
it
{
expect
(
page
).
not_to
have_selector
(
'.build-artifacts'
)
}
end
context
'without artifacts'
do
let!
(
:without_artifacts
)
{
create
(
:ci_build
,
:success
,
pipeline:
pipeline
,
name:
'rspec'
,
stage:
'test'
)
}
let!
(
:without_artifacts
)
do
create
(
:ci_build
,
:success
,
pipeline:
pipeline
,
name:
'rspec'
,
stage:
'test'
)
end
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
}
before
do
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
end
it
{
expect
(
page
).
not_to
have_selector
(
'.build-artifacts'
)
}
end
...
...
@@ -199,14 +279,49 @@ describe "Pipelines", feature: true, js: true do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
ref:
'master'
)
}
before
do
@success
=
create
(
:ci_build
,
:success
,
pipeline:
pipeline
,
stage:
'build'
,
name:
'build'
)
@failed
=
create
(
:ci_build
,
:failed
,
pipeline:
pipeline
,
stage:
'test'
,
name:
'test'
,
commands:
'test'
)
@running
=
create
(
:ci_build
,
:running
,
pipeline:
pipeline
,
stage:
'deploy'
,
name:
'deploy'
)
@manual
=
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
stage:
'deploy'
,
name:
'manual build'
)
@external
=
create
(
:generic_commit_status
,
status:
'success'
,
pipeline:
pipeline
,
name:
'jenkins'
,
stage:
'external'
)
@success
=
create
(
:ci_build
,
:success
,
pipeline:
pipeline
,
stage:
'build'
,
name:
'build'
)
@failed
=
create
(
:ci_build
,
:failed
,
pipeline:
pipeline
,
stage:
'test'
,
name:
'test'
,
commands:
'test'
)
@running
=
create
(
:ci_build
,
:running
,
pipeline:
pipeline
,
stage:
'deploy'
,
name:
'deploy'
)
@manual
=
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
stage:
'deploy'
,
name:
'manual build'
)
@external
=
create
(
:generic_commit_status
,
status:
'success'
,
pipeline:
pipeline
,
name:
'jenkins'
,
stage:
'external'
)
end
before
{
visit
namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
)
}
before
do
visit
namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
)
end
it
'shows a list of builds'
do
expect
(
page
).
to
have_content
(
'Test'
)
...
...
@@ -256,7 +371,9 @@ describe "Pipelines", feature: true, js: true do
describe
'POST /:project/pipelines'
,
feature:
true
,
js:
true
do
let
(
:project
)
{
create
(
:project
)
}
before
{
visit
new_namespace_project_pipeline_path
(
project
.
namespace
,
project
)
}
before
do
visit
new_namespace_project_pipeline_path
(
project
.
namespace
,
project
)
end
context
'for valid commit'
do
before
{
fill_in
(
'pipeline[ref]'
,
with:
'master'
)
}
...
...
@@ -264,7 +381,13 @@ describe "Pipelines", feature: true, js: true do
context
'with gitlab-ci.yml'
do
before
{
stub_ci_pipeline_to_return_yaml_file
}
it
{
expect
{
click_on
'Create pipeline'
}.
to
change
{
Ci
::
Pipeline
.
count
}.
by
(
1
)
}
it
do
expect
{
click_on
'Create pipeline'
}.
to
change
{
Ci
::
Pipeline
.
count
}.
by
(
1
)
end
end
context
'without gitlab-ci.yml'
do
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录