diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-11 12:10:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-11 12:10:46 +0300 |
commit | c2dcc63e6db8e9ee3365c45356451d8144eb0c23 (patch) | |
tree | ebca0b4d04f037de3c8a2722990fbcf7e123eb30 /spec/tasks | |
parent | 990b7413bc68bab8aea2aac06c45e31264e26b22 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tasks')
-rw-r--r-- | spec/tasks/gitlab/git_rake_spec.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/tasks/gitlab/git_rake_spec.rb b/spec/tasks/gitlab/git_rake_spec.rb index 4bc1b460d9b..4d89b126c9e 100644 --- a/spec/tasks/gitlab/git_rake_spec.rb +++ b/spec/tasks/gitlab/git_rake_spec.rb @@ -19,4 +19,38 @@ RSpec.describe 'gitlab:git rake tasks' do expect { run_rake_task('gitlab:git:fsck') }.to output(/Performed integrity check for/).to_stdout end end + + describe 'checksum_projects' do + it 'outputs the checksum for a repo' do + expected = /#{project.id},#{project.repository.checksum}/ + + expect { run_rake_task('gitlab:git:checksum_projects') }.to output(expected).to_stdout + end + + it 'outputs blank checksum for no repo' do + no_repo = create(:project) + + expected = /#{no_repo.id},$/ + + expect { run_rake_task('gitlab:git:checksum_projects') }.to output(expected).to_stdout + end + + it 'outputs zeroes for empty repo' do + empty_repo = create(:project, :empty_repo) + + expected = /#{empty_repo.id},0000000000000000000000000000000000000000/ + + expect { run_rake_task('gitlab:git:checksum_projects') }.to output(expected).to_stdout + end + + it 'outputs errors' do + allow_next_found_instance_of(Project) do |project| + allow(project).to receive(:repo_exists?).and_raise('foo') + end + + expected = /#{project.id},Ignored error: foo/ + + expect { run_rake_task('gitlab:git:checksum_projects') }.to output(expected).to_stdout + end + end end |