diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-03-07 01:18:32 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-03-07 01:40:47 +0900 |
commit | b8ce910ff491d890670c1e00bb0a752d00659227 (patch) | |
tree | b50081ea8a824754efcc64e1caedecca9c87596e | |
parent | 2a97550d2feb128f9b0810eb36328b958608ed6c (diff) | |
download | gitlab-ce-b8ce910ff491d890670c1e00bb0a752d00659227.tar.gz |
Set sha256 checksum when archiving traces
-rw-r--r-- | lib/gitlab/ci/trace.rb | 3 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/trace_spec.rb | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/ci/trace.rb b/lib/gitlab/ci/trace.rb index c5356af2f02..cedf4171ab1 100644 --- a/lib/gitlab/ci/trace.rb +++ b/lib/gitlab/ci/trace.rb @@ -137,7 +137,8 @@ module Gitlab job.create_job_artifacts_trace!( project: job.project, file_type: :trace, - file: stream) + file: stream, + file_sha256: Digest::SHA256.file(path).hexdigest) end end diff --git a/spec/lib/gitlab/ci/trace_spec.rb b/spec/lib/gitlab/ci/trace_spec.rb index 1c73043cfbd..a514747b940 100644 --- a/spec/lib/gitlab/ci/trace_spec.rb +++ b/spec/lib/gitlab/ci/trace_spec.rb @@ -414,6 +414,7 @@ describe Gitlab::Ci::Trace do expect(File.exist?(src_path)).to be_falsy expect(src_checksum) .to eq(Digest::SHA256.file(build.job_artifacts_trace.file.path).digest) + expect(build.job_artifacts_trace.file_sha256).to eq(src_checksum) end end @@ -439,6 +440,7 @@ describe Gitlab::Ci::Trace do expect(build.old_trace).to be_nil expect(src_checksum) .to eq(Digest::SHA256.file(build.job_artifacts_trace.file.path).digest) + expect(build.job_artifacts_trace.file_sha256).to eq(src_checksum) end end |