diff options
author | Robert Speicher <robert@gitlab.com> | 2018-01-24 16:54:54 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-01-24 16:54:54 +0000 |
commit | f441fe7b548fd9cb87eb2f0eadfa88b2e312b692 (patch) | |
tree | 9d28038275912189ea462e6f26c7a9df1b9d89d4 /spec | |
parent | 59a13575a1188e0557e60e2ed9eb33bf254714b5 (diff) | |
parent | 24625323a826d70991fdf27fbbe1f39bee845c03 (diff) | |
download | gitlab-ce-f441fe7b548fd9cb87eb2f0eadfa88b2e312b692.tar.gz |
Merge branch 'feature/migrate-bundle-to-disk-to-gitaly' into 'master'
Migrate repository bundling to Gitaly
Closes gitaly#929
See merge request gitlab-org/gitlab-ce!16563
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index aec7cde6df8..36ca3980de9 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -1926,6 +1926,34 @@ describe Gitlab::Git::Repository, seed_helper: true do it { expect(subject.repository_relative_path).to eq(repository.relative_path) } end + describe '#bundle_to_disk' do + shared_examples 'bundling to disk' do + let(:save_path) { File.join(Dir.tmpdir, "repo-#{SecureRandom.hex}.bundle") } + + after do + FileUtils.rm_rf(save_path) + end + + it 'saves a bundle to disk' do + repository.bundle_to_disk(save_path) + + success = system( + *%W(#{Gitlab.config.git.bin_path} -C #{repository.path} bundle verify #{save_path}), + [:out, :err] => '/dev/null' + ) + expect(success).to be true + end + end + + context 'when Gitaly bundle_to_disk feature is enabled' do + it_behaves_like 'bundling to disk' + end + + context 'when Gitaly bundle_to_disk feature is disabled', :disable_gitaly do + it_behaves_like 'bundling to disk' + end + end + context 'gitlab_projects commands' do let(:gitlab_projects) { repository.gitlab_projects } let(:timeout) { Gitlab.config.gitlab_shell.git_timeout } |