Commit 91a01489 authored by Igor Drozdov's avatar Igor Drozdov

Remove the failing tests for deprecated RPCs

It's an overkill to test the internal logic of the Gitaly
It's enough to test that a particular RPC has been called (it's tested)

The deprecated RPCs are going to be removed soon, so let's just remove
the tests
parent b1caeffa
......@@ -230,76 +230,6 @@ RSpec.shared_examples 'can collect git garbage' do |update_statistics: true|
stub_feature_flags(optimized_housekeeping: false)
end
it 'incremental repack adds a new packfile' do
create_objects(resource)
before_packs = packs(resource)
expect(before_packs.count).to be >= 1
subject.perform(resource.id, 'incremental_repack', lease_key, lease_uuid)
after_packs = packs(resource)
# Exactly one new pack should have been created
expect(after_packs.count).to eq(before_packs.count + 1)
# Previously existing packs are still around
expect(before_packs & after_packs).to eq(before_packs)
end
it 'full repack consolidates into 1 packfile' do
create_objects(resource)
subject.perform(resource.id, 'incremental_repack', lease_key, lease_uuid)
before_packs = packs(resource)
expect(before_packs.count).to be >= 2
subject.perform(resource.id, 'full_repack', lease_key, lease_uuid)
after_packs = packs(resource)
expect(after_packs.count).to eq(1)
# Previously existing packs should be gone now
expect(after_packs - before_packs).to eq(after_packs)
expect(File.exist?(bitmap_path(after_packs.first))).to eq(bitmaps_enabled)
end
it 'gc consolidates into 1 packfile and updates packed-refs' do
create_objects(resource)
before_packs = packs(resource)
before_packed_refs = packed_refs(resource)
expect(before_packs.count).to be >= 1
# It's quite difficult to use `expect_next_instance_of` in this place
# because the RepositoryService is instantiated several times to do
# some repository calls like `exists?`, `create_repository`, ... .
# Therefore, since we're instantiating the object several times,
# RSpec has troubles figuring out which instance is the next and which
# one we want to mock.
# Besides, at this point, we actually want to perform the call to Gitaly,
# otherwise we would just use `instance_double` like in other parts of the
# spec file.
expect_any_instance_of(Gitlab::GitalyClient::RepositoryService) # rubocop:disable RSpec/AnyInstanceOf
.to receive(:garbage_collect)
.with(bitmaps_enabled, prune: false)
.and_call_original
subject.perform(resource.id, 'gc', lease_key, lease_uuid)
after_packed_refs = packed_refs(resource)
after_packs = packs(resource)
expect(after_packs.count).to eq(1)
# Previously existing packs should be gone now
expect(after_packs - before_packs).to eq(after_packs)
# The packed-refs file should have been updated during 'git gc'
expect(before_packed_refs).not_to eq(after_packed_refs)
expect(File.exist?(bitmap_path(after_packs.first))).to eq(bitmaps_enabled)
end
it 'cleans up repository after finishing' do
expect(resource).to receive(:cleanup).and_call_original
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment