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
d63673d6
Commit
d63673d6
authored
Jun 17, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure that artifacts_file is nullified after removing artifacts
parent
faee4763
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
app/models/ci/build.rb
app/models/ci/build.rb
+1
-0
spec/workers/expire_build_artifacts_worker_spec.rb
spec/workers/expire_build_artifacts_worker_spec.rb
+12
-0
No files found.
app/models/ci/build.rb
View file @
d63673d6
...
...
@@ -341,6 +341,7 @@ module Ci
def
erase_artifacts!
remove_artifacts_file!
remove_artifacts_metadata!
save
end
def
erase
(
opts
=
{})
...
...
spec/workers/expire_build_artifacts_worker_spec.rb
View file @
d63673d6
...
...
@@ -20,6 +20,10 @@ describe ExpireBuildArtifactsWorker do
it
'does remove files'
do
expect
(
build
.
reload
.
artifacts_file
.
exists?
).
to
be_falsey
end
it
'does nullify artifacts_file column'
do
expect
(
build
.
reload
.
artifacts_file_identifier
).
to
be_nil
end
end
context
'with not yet expired artifacts'
do
...
...
@@ -32,6 +36,10 @@ describe ExpireBuildArtifactsWorker do
it
'does not remove files'
do
expect
(
build
.
reload
.
artifacts_file
.
exists?
).
to
be_truthy
end
it
'does not nullify artifacts_file column'
do
expect
(
build
.
reload
.
artifacts_file_identifier
).
not_to
be_nil
end
end
context
'without expire date'
do
...
...
@@ -44,6 +52,10 @@ describe ExpireBuildArtifactsWorker do
it
'does not remove files'
do
expect
(
build
.
reload
.
artifacts_file
.
exists?
).
to
be_truthy
end
it
'does not nullify artifacts_file column'
do
expect
(
build
.
reload
.
artifacts_file_identifier
).
not_to
be_nil
end
end
context
'for expired artifacts'
do
...
...
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