Commit 35d73747 authored by Abdul Wadood's avatar Abdul Wadood

Add clean_gitlab_redis_shared_state to indexer_spec.rb

To clear shared redis state
parent c1b5d0d7
...@@ -21,7 +21,7 @@ RSpec.describe Gitlab::Elastic::Indexer do ...@@ -21,7 +21,7 @@ RSpec.describe Gitlab::Elastic::Indexer do
subject(:indexer) { described_class.new(project) } subject(:indexer) { described_class.new(project) }
context 'empty project', :elastic do context 'empty project', :elastic, :clean_gitlab_redis_shared_state do
let(:project) { create(:project) } let(:project) { create(:project) }
it 'updates the index status without running the indexing command' do it 'updates the index status without running the indexing command' do
...@@ -32,7 +32,7 @@ RSpec.describe Gitlab::Elastic::Indexer do ...@@ -32,7 +32,7 @@ RSpec.describe Gitlab::Elastic::Indexer do
expect_index_status(Gitlab::Git::BLANK_SHA) expect_index_status(Gitlab::Git::BLANK_SHA)
end end
context 'when indexing an unborn head', :elastic do context 'when indexing an unborn head', :elastic, :clean_gitlab_redis_shared_state do
it 'updates the index status without running the indexing command' do it 'updates the index status without running the indexing command' do
allow(project.repository).to receive(:exists?).and_return(false) allow(project.repository).to receive(:exists?).and_return(false)
expect_popen.never expect_popen.never
...@@ -55,7 +55,7 @@ RSpec.describe Gitlab::Elastic::Indexer do ...@@ -55,7 +55,7 @@ RSpec.describe Gitlab::Elastic::Indexer do
end end
end end
context 'with an indexed project', :elastic do context 'with an indexed project', :elastic, :clean_gitlab_redis_shared_state do
let(:to_sha) { project.repository.commit.sha } let(:to_sha) { project.repository.commit.sha }
before do before do
...@@ -80,7 +80,7 @@ RSpec.describe Gitlab::Elastic::Indexer do ...@@ -80,7 +80,7 @@ RSpec.describe Gitlab::Elastic::Indexer do
end end
end end
context 'when indexing a HEAD commit', :elastic do context 'when indexing a HEAD commit', :elastic, :clean_gitlab_redis_shared_state do
it_behaves_like 'index up to the specified commit' it_behaves_like 'index up to the specified commit'
it 'runs the indexing command' do it 'runs the indexing command' do
...@@ -130,7 +130,7 @@ RSpec.describe Gitlab::Elastic::Indexer do ...@@ -130,7 +130,7 @@ RSpec.describe Gitlab::Elastic::Indexer do
end end
end end
context 'when indexing a non-HEAD commit', :elastic do context 'when indexing a non-HEAD commit', :elastic, :clean_gitlab_redis_shared_state do
let(:to_sha) { project.repository.commit('HEAD~1').sha } let(:to_sha) { project.repository.commit('HEAD~1').sha }
it_behaves_like 'index up to the specified commit' it_behaves_like 'index up to the specified commit'
...@@ -201,7 +201,7 @@ RSpec.describe Gitlab::Elastic::Indexer do ...@@ -201,7 +201,7 @@ RSpec.describe Gitlab::Elastic::Indexer do
end end
end end
context "when indexing a project's wiki", :elastic do context "when indexing a project's wiki", :elastic, :clean_gitlab_redis_shared_state do
let(:project) { create(:project, :wiki_repo) } let(:project) { create(:project, :wiki_repo) }
let(:indexer) { described_class.new(project, wiki: true) } let(:indexer) { described_class.new(project, wiki: true) }
let(:to_sha) { project.wiki.repository.commit('master').sha } let(:to_sha) { project.wiki.repository.commit('master').sha }
...@@ -358,7 +358,7 @@ RSpec.describe Gitlab::Elastic::Indexer do ...@@ -358,7 +358,7 @@ RSpec.describe Gitlab::Elastic::Indexer do
end end
end end
context 'when a file is larger than elasticsearch_indexed_file_size_limit_kb', :elastic do context 'when a file is larger than elasticsearch_indexed_file_size_limit_kb', :elastic, :clean_gitlab_redis_shared_state do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
before do before do
...@@ -377,7 +377,7 @@ RSpec.describe Gitlab::Elastic::Indexer do ...@@ -377,7 +377,7 @@ RSpec.describe Gitlab::Elastic::Indexer do
end end
end end
context 'when a file path is larger than elasticsearch max size of 512 bytes', :elastic do context 'when a file path is larger than elasticsearch max size of 512 bytes', :elastic, :clean_gitlab_redis_shared_state do
let(:long_path) { "#{'a' * 1000}_file.txt" } let(:long_path) { "#{'a' * 1000}_file.txt" }
before do before do
......
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