BigW Consortium Gitlab

Commit 7b06acea by Lin Jen-Shin

Use nil for non-existing files rather than 0

parent 9d8dca08
......@@ -382,7 +382,9 @@ module Ci
private
def update_artifacts_size
self.artifacts_size = artifacts_file.size
self.artifacts_size = if artifacts_file.exists?
artifacts_file.size
end
end
def erase_trace!
......
......@@ -486,7 +486,7 @@ describe Ci::API::API do
expect(response).to have_http_status(200)
expect(build.artifacts_file.exists?).to be_falsy
expect(build.artifacts_metadata.exists?).to be_falsy
expect(build.artifacts_size).to eq(0)
expect(build.artifacts_size).to be_nil
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment