summaryrefslogtreecommitdiff
path: root/spec/tasks
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-08-02 12:35:35 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-08-02 12:35:35 +0000
commit056025f78e337630148e4c795c282ab668b9fc18 (patch)
tree2476661e4d9bc5d248607eccfd2dced763dc9d97 /spec/tasks
parentd4eeee2ad393ef54faecae17fe09789b887bd08b (diff)
parentd7afed34c4238d637ce71fe8dbea41a64e7a3f1f (diff)
downloadgitlab-ce-056025f78e337630148e4c795c282ab668b9fc18.tar.gz
Merge branch 'zj-backup-migration-done' into 'master'
Remove feature flags from lib/backup Closes gitaly#749, gitaly#1212, and gitaly#1195 See merge request gitlab-org/gitlab-ce!20854
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