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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
3be9e982
Commit
3be9e982
authored
Mar 23, 2021
by
pburdette
Committed by
Payton Burdette
Mar 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show skipped duration
Show the skipped duration state for any pipelines that are skipped.
parent
97d7e378
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
63 deletions
+19
-63
app/assets/javascripts/pipelines/components/pipelines_list/time_ago.vue
...ascripts/pipelines/components/pipelines_list/time_ago.vue
+5
-7
changelogs/unreleased/pb-fix-duration-for-skipped-pipeline.yml
...elogs/unreleased/pb-fix-duration-for-skipped-pipeline.yml
+5
-0
spec/frontend/pipelines/time_ago_spec.js
spec/frontend/pipelines/time_ago_spec.js
+9
-56
No files found.
app/assets/javascripts/pipelines/components/pipelines_list/time_ago.vue
View file @
3be9e982
...
...
@@ -22,6 +22,9 @@ export default {
finishedTime
()
{
return
this
.
pipeline
?.
details
?.
finished_at
;
},
skipped
()
{
return
this
.
pipeline
?.
details
?.
status
?.
label
===
'
skipped
'
;
},
durationFormatted
()
{
const
date
=
new
Date
(
this
.
duration
*
1000
);
...
...
@@ -48,16 +51,11 @@ export default {
legacyTableMobileClass
()
{
return
!
this
.
glFeatures
.
newPipelinesTable
?
'
table-mobile-content
'
:
''
;
},
singleStagePipelineManual
()
{
return
(
this
.
pipeline
.
details
.
manual_actions
.
length
>
0
&&
this
.
pipeline
.
details
.
stages
.
length
===
1
);
},
showInProgress
()
{
return
!
this
.
duration
&&
!
this
.
finishedTime
&&
!
this
.
s
ingleStagePipelineManual
;
return
!
this
.
duration
&&
!
this
.
finishedTime
&&
!
this
.
s
kipped
;
},
showSkipped
()
{
return
!
this
.
duration
&&
!
this
.
finishedTime
&&
this
.
s
ingleStagePipelineManual
;
return
!
this
.
duration
&&
!
this
.
finishedTime
&&
this
.
s
kipped
;
},
},
};
...
...
changelogs/unreleased/pb-fix-duration-for-skipped-pipeline.yml
0 → 100644
View file @
3be9e982
---
title
:
Show skipped duration state for all skipped pipelines
merge_request
:
57242
author
:
type
:
changed
spec/frontend/pipelines/time_ago_spec.js
View file @
3be9e982
...
...
@@ -5,41 +5,6 @@ import TimeAgo from '~/pipelines/components/pipelines_list/time_ago.vue';
describe
(
'
Timeago component
'
,
()
=>
{
let
wrapper
;
const
mutlipleStages
=
{
manual_actions
:
[
{
name
:
'
deploy_job
'
,
path
:
'
/root/one-stage-manual/-/jobs/1930/play
'
,
playable
:
true
,
scheduled
:
false
,
},
],
stages
:
[
{
name
:
'
deploy
'
,
},
{
name
:
'
qa
'
,
},
],
};
const
singleStageManual
=
{
manual_actions
:
[
{
name
:
'
deploy_job
'
,
path
:
'
/root/one-stage-manual/-/jobs/1930/play
'
,
playable
:
true
,
scheduled
:
false
,
},
],
stages
:
[
{
name
:
'
deploy
'
,
},
],
};
const
createComponent
=
(
props
=
{})
=>
{
wrapper
=
shallowMount
(
TimeAgo
,
{
propsData
:
{
...
...
@@ -82,7 +47,7 @@ describe('Timeago component', () => {
describe
(
'
without duration
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
...
singleStageManual
,
duration
:
0
,
finished_at
:
''
});
createComponent
({
duration
:
0
,
finished_at
:
''
});
});
it
(
'
should not render duration and timer svg
'
,
()
=>
{
...
...
@@ -107,7 +72,7 @@ describe('Timeago component', () => {
describe
(
'
without finishedTime
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
...
singleStageManual
,
duration
:
0
,
finished_at
:
''
});
createComponent
({
duration
:
0
,
finished_at
:
''
});
});
it
(
'
should not render time and calendar icon
'
,
()
=>
{
...
...
@@ -126,7 +91,6 @@ describe('Timeago component', () => {
'
progress state shown: $shouldShow when pipeline duration is $durationTime and finished_at is $finishedAtTime
'
,
({
durationTime
,
finishedAtTime
,
shouldShow
})
=>
{
createComponent
({
...
mutlipleStages
,
duration
:
durationTime
,
finished_at
:
finishedAtTime
,
});
...
...
@@ -138,24 +102,13 @@ describe('Timeago component', () => {
});
describe
(
'
skipped
'
,
()
=>
{
it
.
each
`
durationTime | finishedAtTime | shouldShow
${
10
}
|
${
'
2017-04-26T12:40:23.277Z
'
}
|
${
false
}
${
10
}
|
${
''
}
|
${
false
}
${
0
}
|
${
'
2017-04-26T12:40:23.277Z
'
}
|
${
false
}
${
0
}
|
${
''
}
|
${
true
}
`
(
'
progress state shown: $shouldShow when pipeline duration is $durationTime and finished_at is $finishedAtTime
'
,
({
durationTime
,
finishedAtTime
,
shouldShow
})
=>
{
createComponent
({
...
singleStageManual
,
duration
:
durationTime
,
finished_at
:
finishedAtTime
,
});
it
(
'
should show skipped if pipeline was skipped
'
,
()
=>
{
createComponent
({
status
:
{
label
:
'
skipped
'
},
});
expect
(
findSkipped
().
exists
()).
toBe
(
shouldShow
);
expect
(
findInProgress
().
exists
()).
toBe
(
false
);
},
);
expect
(
findSkipped
().
exists
()).
toBe
(
true
);
expect
(
findInProgress
().
exists
()).
toBe
(
false
);
});
});
});
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