summaryrefslogtreecommitdiff
path: root/spec/tasks
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-07-26 10:05:32 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-07-31 15:24:19 +0200
commitd7afed34c4238d637ce71fe8dbea41a64e7a3f1f (patch)
tree840e797c7f5bbe789fa0a490e124c232b1972ffc /spec/tasks
parent5035250337427baa1f6462ee4b1c004f529d765c (diff)
downloadgitlab-ce-d7afed34c4238d637ce71fe8dbea41a64e7a3f1f.tar.gz
Remove feature flags from lib/backup
Moved to OPT_OUT in 7d14b725a0da41d1ae7c0a8496b5e66832023e3b, Now, by removing the feature gates, this is an mandatory feature. Related issues: - https://gitlab.com/gitlab-org/gitaly/issues/526 - https://gitlab.com/gitlab-org/gitaly/issues/1194 Closes https://gitlab.com/gitlab-org/gitaly/issues/749 Closes https://gitlab.com/gitlab-org/gitaly/issues/1212 Closes https://gitlab.com/gitlab-org/gitaly/issues/1195
Diffstat (limited to 'spec/tasks')
-rw-r--r--spec/tasks/gitlab/backup_rake_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/tasks/gitlab/backup_rake_spec.rb b/spec/tasks/gitlab/backup_rake_spec.rb
index 93a436cb2b5..3ba6caf1337 100644
--- a/spec/tasks/gitlab/backup_rake_spec.rb
+++ b/spec/tasks/gitlab/backup_rake_spec.rb
@@ -87,6 +87,27 @@ describe 'gitlab:app namespace rake task' do
expect { run_rake_task('gitlab:backup:restore') }.to output.to_stdout
end
end
+
+ context 'when the restore directory is not empty' do
+ before do
+ # We only need a backup of the repositories for this test
+ stub_env('SKIP', 'db,uploads,builds,artifacts,lfs,registry')
+ end
+
+ it 'removes stale data' do
+ expect { run_rake_task('gitlab:backup:create') }.to output.to_stdout
+
+ excluded_project = create(:project, :repository, name: 'mepmep')
+
+ expect { run_rake_task('gitlab:backup:restore') }.to output.to_stdout
+
+ raw_repo = excluded_project.repository.raw
+
+ # The restore will not find the repository in the backup, but will create
+ # an empty one in its place
+ expect(raw_repo.empty?).to be(true)
+ end
+ end
end # backup_restore task
describe 'backup' do