BigW Consortium Gitlab

Commit b8ce910f by Shinya Maeda

Set sha256 checksum when archiving traces

parent 2a97550d
...@@ -137,7 +137,8 @@ module Gitlab ...@@ -137,7 +137,8 @@ module Gitlab
job.create_job_artifacts_trace!( job.create_job_artifacts_trace!(
project: job.project, project: job.project,
file_type: :trace, file_type: :trace,
file: stream) file: stream,
file_sha256: Digest::SHA256.file(path).hexdigest)
end end
end end
......
...@@ -414,6 +414,7 @@ describe Gitlab::Ci::Trace do ...@@ -414,6 +414,7 @@ describe Gitlab::Ci::Trace do
expect(File.exist?(src_path)).to be_falsy expect(File.exist?(src_path)).to be_falsy
expect(src_checksum) expect(src_checksum)
.to eq(Digest::SHA256.file(build.job_artifacts_trace.file.path).digest) .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
end end
...@@ -439,6 +440,7 @@ describe Gitlab::Ci::Trace do ...@@ -439,6 +440,7 @@ describe Gitlab::Ci::Trace do
expect(build.old_trace).to be_nil expect(build.old_trace).to be_nil
expect(src_checksum) expect(src_checksum)
.to eq(Digest::SHA256.file(build.job_artifacts_trace.file.path).digest) .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
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