summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-04-03 20:42:51 +0900
committerShinya Maeda <shinya@gitlab.com>2018-04-03 20:42:51 +0900
commit61c8093b264422f900ec2aa29e313a617fc663a4 (patch)
tree461502a35170b2ec97f8c1581e7fc3ff9d41d406 /spec/requests
parent4a9d9f15eff0b57c2648679d93dece192c90c904 (diff)
downloadgitlab-ce-43745-store-metadata-checksum-for-artifacts.tar.gz
Store metadata checksum for artifacts43745-store-metadata-checksum-for-artifacts
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/runner_spec.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb
index 5084b36c761..4f3420cc0ad 100644
--- a/spec/requests/api/runner_spec.rb
+++ b/spec/requests/api/runner_spec.rb
@@ -1159,11 +1159,13 @@ describe API::Runner do
let!(:artifacts) { file_upload }
let!(:artifacts_sha256) { Digest::SHA256.file(artifacts.path).hexdigest }
let!(:metadata) { file_upload2 }
+ let!(:metadata_sha256) { Digest::SHA256.file(metadata.path).hexdigest }
let(:stored_artifacts_file) { job.reload.artifacts_file.file }
let(:stored_metadata_file) { job.reload.artifacts_metadata.file }
let(:stored_artifacts_size) { job.reload.artifacts_size }
let(:stored_artifacts_sha256) { job.reload.job_artifacts_archive.file_sha256 }
+ let(:stored_metadata_sha256) { job.reload.job_artifacts_metadata.file_sha256 }
before do
post(api("/jobs/#{job.id}/artifacts"), post_data, headers_with_token)
@@ -1175,7 +1177,8 @@ describe API::Runner do
'file.name' => artifacts.original_filename,
'file.sha256' => artifacts_sha256,
'metadata.path' => metadata.path,
- 'metadata.name' => metadata.original_filename }
+ 'metadata.name' => metadata.original_filename,
+ 'metadata.sha256' => metadata_sha256 }
end
it 'stores artifacts and artifacts metadata' do
@@ -1184,6 +1187,7 @@ describe API::Runner do
expect(stored_metadata_file.original_filename).to eq(metadata.original_filename)
expect(stored_artifacts_size).to eq(72821)
expect(stored_artifacts_sha256).to eq(artifacts_sha256)
+ expect(stored_metadata_sha256).to eq(metadata_sha256)
end
end