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:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-07-01 11:04:57 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-07-01 11:04:57 +0300
commitf63dc06cb4572db92bb91c936e9862c55f1f365e (patch)
tree6efbba0d2d30173605f5551eb277822df24a64d7 /spec/tasks
parentbc3ffe835436a32ed46c39e385856cc6fc15db25 (diff)
parentdabd91b2c8a42ac0d0c357190002a5a4b96a57a6 (diff)
Merge branch 'tc-rake-orphan-artifacts' into 'master'
Add rake task to clean orphan artifact files See merge request gitlab-org/gitlab-ce!29681
Diffstat (limited to 'spec/tasks')
-rw-r--r--spec/tasks/gitlab/cleanup_rake_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/tasks/gitlab/cleanup_rake_spec.rb b/spec/tasks/gitlab/cleanup_rake_spec.rb
index 19794227d9f..92c094f08a4 100644
--- a/spec/tasks/gitlab/cleanup_rake_spec.rb
+++ b/spec/tasks/gitlab/cleanup_rake_spec.rb
@@ -156,4 +156,33 @@ describe 'gitlab:cleanup rake tasks' do
end
end
end
+
+ describe 'gitlab:cleanup:orphan_job_artifact_files' do
+ subject(:rake_task) { run_rake_task('gitlab:cleanup:orphan_job_artifact_files') }
+
+ it 'runs the task without errors' do
+ expect(Gitlab::Cleanup::OrphanJobArtifactFiles)
+ .to receive(:new).and_call_original
+
+ expect { rake_task }.not_to raise_error
+ end
+
+ context 'with DRY_RUN set to false' do
+ before do
+ stub_env('DRY_RUN', 'false')
+ end
+
+ it 'passes dry_run correctly' do
+ expect(Gitlab::Cleanup::OrphanJobArtifactFiles)
+ .to receive(:new)
+ .with(limit: anything,
+ dry_run: false,
+ niceness: anything,
+ logger: anything)
+ .and_call_original
+
+ rake_task
+ end
+ end
+ end
end