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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
473addf1
Commit
473addf1
authored
Dec 08, 2016
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bunch of blocked tests now passing - moving on
parent
20f74fe7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
76 deletions
+29
-76
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
+15
-55
spec/features/projects/pipelines/pipelines_spec.rb
spec/features/projects/pipelines/pipelines_spec.rb
+14
-21
No files found.
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
View file @
473addf1
...
...
@@ -38,31 +38,17 @@
apiScope: 'all',
pageInfo: {},
pagenum: 1,
count: {
all: 0,
running_or_pending: 0,
},
count: { all: 0, running_or_pending: 0 },
pageRequest: false,
};
},
props: [
'scope',
'store',
],
props: ['scope', 'store'],
created() {
const pagenum = getParameterByName('p');
const scope = getParameterByName('scope');
if (pagenum) this.pagenum = pagenum;
if (scope) this.apiScope = scope;
this.store.fetchDataLoop.call(
this,
Vue,
this.pagenum,
this.scope,
this.apiScope,
);
this.store.fetchDataLoop.call(this, Vue, this.pagenum, this.scope, this.apiScope);
},
methods: {
changepage(e) {
...
...
@@ -82,51 +68,28 @@
this.store.fetchDataLoop.call(this, Vue, this.pagenum, this.scope, this.apiScope);
},
author(pipeline) {
const { commit } = pipeline;
if (!commit) {
return ({
avatar_url: '',
web_url: '',
username: '',
});
}
const author = commit.author;
if (author) return author;
const nonUser = {
avatar_url: commit.author_gravatar_url,
web_url: `mailto:${commit.author_email}`,
username: commit.author_name,
};
return nonUser;
if (!pipeline.commit) return ({ avatar_url: '', web_url: '', username: '' });
if (pipeline.commit.author) return pipeline.commit.author;
return ({
avatar_url: pipeline.commit.author_gravatar_url,
web_url: `mailto:${pipeline.commit.author_email}`,
username: pipeline.commit.author_name,
});
},
ref(pipeline) {
const { ref } = pipeline;
const commitRef = {
name: ref.name,
tag: ref['tag?'],
ref_url: ref.url,
};
return commitRef;
},
addTimeInterval(id, start) {
this.allTimeIntervals.push({ id, start });
return ({ name: ref.name, tag: ref['tag?'], ref_url: ref.url });
},
commitTitle(pipeline) {
const { commit } = pipeline;
if (commit) return commit.title;
if (pipeline.commit) return pipeline.commit.title;
return '';
},
commitSha(pipeline) {
const { commit } = pipeline;
if (commit) return commit.short_id;
if (pipeline.commit) return pipeline.commit.short_id;
return '';
},
commitUrl(pipeline) {
const { commit } = pipeline;
if (commit) return commit.commit_url;
if (pipeline.commit) return pipeline.commit.commit_url;
return '';
},
},
...
...
@@ -154,10 +117,7 @@
</commit>
</td>
<stages :pipeline='pipeline'></stages>
<time-ago
:pipeline='pipeline'
>
</time-ago>
<time-ago :pipeline='pipeline'></time-ago>
<pipeline-actions :pipeline='pipeline'></pipeline-actions>
</tr>
</tbody>
...
...
spec/features/projects/pipelines/pipelines_spec.rb
View file @
473addf1
...
...
@@ -16,28 +16,28 @@ describe "Pipelines", feature: true, js: true do
describe
'GET /:project/pipelines'
,
feature:
true
,
js:
true
do
include
WaitForVueResource
let
(
:project
)
{
create
(
:project
)
}
let!
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
ref:
'master'
,
status:
'running'
status:
'running'
,
sha:
project
.
commit
.
id
,
)
end
[
:all
,
:running
,
:branches
].
each
do
|
scope
|
context
"displaying
#{
scope
}
"
do
let
(
:project
)
{
create
(
:project
)
}
before
do
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
,
scope:
scope
)
wait_for_vue_resource
end
it
do
wait_for_vue_resource
expect
(
page
).
to
have_content
(
pipeline
.
short_sha
)
end
end
...
...
@@ -46,6 +46,7 @@ describe "Pipelines", feature: true, js: true do
context
'anonymous access'
do
before
do
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
wait_for_vue_resource
end
it
{
expect
(
page
).
to
have_http_status
(
:success
)
}
...
...
@@ -59,17 +60,12 @@ describe "Pipelines", feature: true, js: true do
before
do
build
.
run
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
end
it
do
wait_for_vue_resource
expect
(
page
).
to
have_link
(
'Cancel'
)
end
it
do
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.ci-running'
)
end
it
{
expect
(
page
).
to
have_link
(
'Cancel'
)
}
it
{
expect
(
page
).
to
have_selector
(
'.ci-running'
)
}
context
'when canceling'
do
before
do
...
...
@@ -77,15 +73,9 @@ describe "Pipelines", feature: true, js: true do
click_link
(
'Cancel'
)
end
it
do
wait_for_vue_resource
expect
(
page
).
not_to
have_link
(
'Cancel'
)
end
it
{
expect
(
page
).
not_to
have_link
(
'Cancel'
)
}
it
do
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.ci-canceled'
)
end
it
{
expect
(
page
).
to
have_selector
(
'.ci-canceled'
)
}
end
end
...
...
@@ -103,7 +93,10 @@ describe "Pipelines", feature: true, js: true do
it
{
expect
(
page
).
to
have_selector
(
'.ci-failed'
)
}
context
'when retrying'
do
before
{
click_link
(
'Retry'
)
}
before
do
wait_for_vue_resource
click_link
(
'Retry'
)
end
it
{
expect
(
page
).
not_to
have_link
(
'Retry'
)
}
it
{
expect
(
page
).
to
have_selector
(
'.ci-running'
)
}
...
...
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