Fix dashboard warning about Elasticsearch index mismatch not showing up (#34567)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
		@@ -16,7 +16,7 @@ class Admin::SystemCheck::ElasticsearchCheck < Admin::SystemCheck::BaseCheck
 | 
				
			|||||||
  def pass?
 | 
					  def pass?
 | 
				
			||||||
    return true unless Chewy.enabled?
 | 
					    return true unless Chewy.enabled?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    running_version.present? && compatible_version? && cluster_health['status'] == 'green' && indexes_match? && preset_matches?
 | 
					    running_version.present? && compatible_version? && cluster_health['status'] == 'green' && indexes_match? && specifications_match? && preset_matches?
 | 
				
			||||||
  rescue Faraday::ConnectionFailed, Elasticsearch::Transport::Transport::Error
 | 
					  rescue Faraday::ConnectionFailed, Elasticsearch::Transport::Transport::Error
 | 
				
			||||||
    false
 | 
					    false
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
@@ -40,7 +40,7 @@ class Admin::SystemCheck::ElasticsearchCheck < Admin::SystemCheck::BaseCheck
 | 
				
			|||||||
      )
 | 
					      )
 | 
				
			||||||
    elsif !specifications_match?
 | 
					    elsif !specifications_match?
 | 
				
			||||||
      Admin::SystemCheck::Message.new(
 | 
					      Admin::SystemCheck::Message.new(
 | 
				
			||||||
        :elasticsearch_analysis_mismatch,
 | 
					        :elasticsearch_analysis_index_mismatch,
 | 
				
			||||||
        mismatched_specifications_indexes.join(' ')
 | 
					        mismatched_specifications_indexes.join(' ')
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
    elsif cluster_health['status'] == 'red'
 | 
					    elsif cluster_health['status'] == 'red'
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -29,6 +29,9 @@ RSpec.describe Admin::SystemCheck::ElasticsearchCheck do
 | 
				
			|||||||
            },
 | 
					            },
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
 | 
					        [AccountsIndex, StatusesIndex, PublicStatusesIndex, InstancesIndex, TagsIndex].each do |index|
 | 
				
			||||||
 | 
					          allow(index).to receive(:specification).and_return(instance_double(Chewy::Index::Specification, changed?: false))
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      context 'when running version is present and high enough' do
 | 
					      context 'when running version is present and high enough' do
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user