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
Jérome Perrin
gitlab-ce
Commits
1e138767
Commit
1e138767
authored
Mar 05, 2018
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests failures
parent
62f053e4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
4 deletions
+23
-4
app/models/concerns/chronic_duration_attribute.rb
app/models/concerns/chronic_duration_attribute.rb
+2
-2
spec/javascripts/jobs/sidebar_detail_row_spec.js
spec/javascripts/jobs/sidebar_detail_row_spec.js
+1
-0
spec/models/concerns/chronic_duration_attribute_spec.rb
spec/models/concerns/chronic_duration_attribute_spec.rb
+19
-1
spec/services/ci/retry_build_service_spec.rb
spec/services/ci/retry_build_service_spec.rb
+1
-1
No files found.
app/models/concerns/chronic_duration_attribute.rb
View file @
1e138767
...
...
@@ -19,8 +19,8 @@ module ChronicDurationAttribute
def
chronic_duration_attr_writer
(
virtual_attribute
,
source_attribute
)
define_method
(
"
#{
virtual_attribute
}
="
)
do
|
value
|
new_value
=
ChronicDuration
.
parse
(
value
).
to_i
new_value
=
nil
if
new_value
<=
0
new_value
=
ChronicDuration
.
parse
(
value
).
to_i
unless
value
.
nil?
new_value
=
nil
if
!
new_value
.
nil?
&&
new_value
<=
0
self
.
send
(
"
#{
source_attribute
}
="
,
new_value
)
# rubocop:disable GitlabSecurity/PublicSend
...
...
spec/javascripts/jobs/sidebar_detail_row_spec.js
View file @
1e138767
...
...
@@ -46,6 +46,7 @@ describe('Sidebar detail row', () => {
vm
=
new
SidebarDetailRow
({
propsData
:
{
helpUrl
:
'
help url
'
,
value
:
'
foo
'
,
},
}).
$mount
();
});
...
...
spec/models/concerns/chronic_duration_attribute_spec.rb
View file @
1e138767
...
...
@@ -29,11 +29,29 @@ shared_examples 'ChronicDurationAttribute writer' do
expect
(
subject
.
send
(
source_field
)).
to
eq
(
600
)
end
it
'writes n
ul
l when empty input is used'
do
it
'writes n
i
l when empty input is used'
do
subject
.
send
(
"
#{
virtual_field
}
="
,
''
)
expect
(
subject
.
send
(
source_field
)).
to
be_nil
end
it
'writes nil when negative input is used'
do
allow
(
ChronicDuration
).
to
receive
(
:parse
).
and_return
(
-
10
)
subject
.
send
(
"
#{
virtual_field
}
="
,
'-10m'
)
expect
(
subject
.
send
(
source_field
)).
to
be_nil
end
it
'writes nil when nil input is used'
do
subject
.
send
(
"
#{
virtual_field
}
="
,
nil
)
expect
(
subject
.
send
(
source_field
)).
to
be_nil
end
it
"doesn't raise exception when nil input is used"
do
expect
{
subject
.
send
(
"
#{
virtual_field
}
="
,
nil
)
}.
not_to
raise_error
(
NoMethodError
)
end
end
describe
'ChronicDurationAttribute'
do
...
...
spec/services/ci/retry_build_service_spec.rb
View file @
1e138767
...
...
@@ -30,7 +30,7 @@ describe Ci::RetryBuildService do
runner_id tag_taggings taggings tags trigger_request_id
user_id auto_canceled_by_id retried failure_reason
artifacts_file_store artifacts_metadata_store
metadata]
.
freeze
build_
metadata]
.
freeze
shared_examples
'build duplication'
do
let
(
:another_pipeline
)
{
create
(
:ci_empty_pipeline
,
project:
project
)
}
...
...
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