Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-02-28 23:09:34 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2018-02-28 23:09:34 +0300
commit8af23def1d6450420d06b8de54d23311a978de20 (patch)
tree5da743be888022a197e2555bbcd12076a9ca3633 /spec/uploaders/job_artifact_uploader_spec.rb
parent54a575f1bbba44573ab92dc58a4242f1ee734c5d (diff)
Revert "Merge branch '3867-port-to-ce' into 'master'"
This reverts commit 54a575f1bbba44573ab92dc58a4242f1ee734c5d, reversing changes made to c63af942e5baf7849a94fa99da8494bcba28e3f8.
Diffstat (limited to 'spec/uploaders/job_artifact_uploader_spec.rb')
-rw-r--r--spec/uploaders/job_artifact_uploader_spec.rb32
1 files changed, 26 insertions, 6 deletions
diff --git a/spec/uploaders/job_artifact_uploader_spec.rb b/spec/uploaders/job_artifact_uploader_spec.rb
index d606404e95d..a067c3e75f4 100644
--- a/spec/uploaders/job_artifact_uploader_spec.rb
+++ b/spec/uploaders/job_artifact_uploader_spec.rb
@@ -3,13 +3,33 @@ require 'spec_helper'
describe JobArtifactUploader do
let(:job_artifact) { create(:ci_job_artifact) }
let(:uploader) { described_class.new(job_artifact, :file) }
+ let(:local_path) { Gitlab.config.artifacts.path }
- subject { uploader }
+ describe '#store_dir' do
+ subject { uploader.store_dir }
- it_behaves_like "builds correct paths",
- store_dir: %r[\h{2}/\h{2}/\h{64}/\d{4}_\d{1,2}_\d{1,2}/\d+/\d+\z],
- cache_dir: %r[artifacts/tmp/cache],
- work_dir: %r[artifacts/tmp/work]
+ let(:path) { "#{job_artifact.created_at.utc.strftime('%Y_%m_%d')}/#{job_artifact.job_id}/#{job_artifact.id}" }
+
+ context 'when using local storage' do
+ it { is_expected.to start_with(local_path) }
+ it { is_expected.to match(%r{\h{2}/\h{2}/\h{64}/\d{4}_\d{1,2}_\d{1,2}/\d+/\d+\z}) }
+ it { is_expected.to end_with(path) }
+ end
+ end
+
+ describe '#cache_dir' do
+ subject { uploader.cache_dir }
+
+ it { is_expected.to start_with(local_path) }
+ it { is_expected.to end_with('/tmp/cache') }
+ end
+
+ describe '#work_dir' do
+ subject { uploader.work_dir }
+
+ it { is_expected.to start_with(local_path) }
+ it { is_expected.to end_with('/tmp/work') }
+ end
context 'file is stored in valid local_path' do
let(:file) do
@@ -23,7 +43,7 @@ describe JobArtifactUploader do
subject { uploader.file.path }
- it { is_expected.to start_with("#{uploader.root}/#{uploader.class.base_dir}") }
+ it { is_expected.to start_with(local_path) }
it { is_expected.to include("/#{job_artifact.created_at.utc.strftime('%Y_%m_%d')}/") }
it { is_expected.to include("/#{job_artifact.job_id}/#{job_artifact.id}/") }
it { is_expected.to end_with("ci_build_artifacts.zip") }