Skip to content

Commit

Permalink
Merge pull request magento#3875 from magento-engcom/1-es6-integration…
Browse files Browse the repository at this point in the history
…-tests

[EngCom] Elasticsearch 6 Support
  • Loading branch information
joanhe authored Mar 14, 2019
2 parents 03428ba + e5661e1 commit bb7d459
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 41 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ cache:
- $HOME/node_modules
- $HOME/yarn.lock
before_install:
- curl -O https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.0/elasticsearch-2.3.0.deb && sudo dpkg -i --force-confnew elasticsearch-2.3.0.deb && sudo service elasticsearch restart
- ./dev/travis/before_install.sh
install: composer install --no-interaction
before_script: ./dev/travis/before_script.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function setUp()
$contentManager = $this->getMockBuilder(\Magento\Elasticsearch\SearchAdapter\ConnectionManager::class)
->disableOriginalConstructor()
->getMock();
$this->clientMock = $this->getMockBuilder(\Magento\Elasticsearch\Model\Client\Elasticsearch::class)
$this->clientMock = $this->getMockBuilder(\Magento\Elasticsearch6\Model\Client\Elasticsearch::class)
->disableOriginalConstructor()
->getMock();
$contentManager
Expand Down Expand Up @@ -78,7 +78,7 @@ protected function setUp()

/**
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
* @return void
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Magento\TestFramework\Helper\Bootstrap;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Elasticsearch\SearchAdapter\ConnectionManager;
use Magento\Elasticsearch\Model\Client\Elasticsearch as ElasticsearchClient;
use Magento\Elasticsearch6\Model\Client\Elasticsearch as ElasticsearchClient;
use Magento\Elasticsearch\Model\Config;
use Magento\Elasticsearch\SearchAdapter\SearchIndexNameResolver;

Expand Down Expand Up @@ -95,7 +95,7 @@ private function search($text)
}

/**
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix composite_product_search
*/
public function testSearchConfigurableProductBySimpleProductName()
Expand All @@ -104,7 +104,7 @@ public function testSearchConfigurableProductBySimpleProductName()
}

/**
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix composite_product_search
*/
public function testSearchConfigurableProductBySimpleProductAttributeMultiselect()
Expand All @@ -113,7 +113,7 @@ public function testSearchConfigurableProductBySimpleProductAttributeMultiselect
}

/**
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix composite_product_search
*/
public function testSearchConfigurableProductBySimpleProductAttributeSelect()
Expand All @@ -122,7 +122,7 @@ public function testSearchConfigurableProductBySimpleProductAttributeSelect()
}

/**
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix composite_product_search
*/
public function testSearchConfigurableProductBySimpleProductAttributeShortDescription()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Magento\TestFramework\Helper\Bootstrap;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Elasticsearch\SearchAdapter\ConnectionManager;
use Magento\Elasticsearch\Model\Client\Elasticsearch as ElasticsearchClient;
use Magento\Elasticsearch6\Model\Client\Elasticsearch as ElasticsearchClient;
use Magento\Elasticsearch\Model\Config;
use Magento\Elasticsearch\SearchAdapter\SearchIndexNameResolver;
use Magento\Indexer\Model\Indexer;
Expand Down Expand Up @@ -87,7 +87,7 @@ protected function setUp()
}

/**
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix indexerhandlertest
* @return void
*/
Expand All @@ -106,7 +106,7 @@ public function testReindexAll(): void

/**
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix indexerhandlertest
* @return void
*/
Expand All @@ -131,7 +131,7 @@ public function testReindexRowAfterEdit(): void
}

/**
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix indexerhandlertest
* @return void
*/
Expand Down Expand Up @@ -170,7 +170,7 @@ public function testReindexRowAfterMassAction(): void
}

/**
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix indexerhandlertest
* @magentoAppArea adminhtml
* @return void
Expand All @@ -192,7 +192,7 @@ public function testReindexRowAfterDelete(): void
/**
* @magentoDbIsolation enabled
* @magentoAppArea adminhtml
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix indexerhandlertest
* @magentoDataFixture Magento/Elasticsearch/_files/configurable_products.php
* @return void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected function setUp()
/**
* Test search of all products after full reindex
*
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix indexerhandlertest_configurable
* @magentoDataFixture Magento/ConfigurableProduct/_files/configurable_products.php
*/
Expand All @@ -82,7 +82,7 @@ public function testSearchAll()
/**
* Test search of specific product after full reindex
*
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix indexerhandlertest_configurable
* @magentoDataFixture Magento/ConfigurableProduct/_files/configurable_products.php
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
*/
namespace Magento\Elasticsearch\SearchAdapter;

use Magento\Elasticsearch\Model\Config;

/**
* Class AdapterTest
*
Expand All @@ -26,7 +24,7 @@ class AdapterTest extends \Magento\Framework\Search\Adapter\Mysql\AdapterTest
/**
* @var string
*/
protected $searchEngine = Config::ENGINE_NAME;
protected $searchEngine = 'elasticsearch6';

/**
* Get request config path
Expand All @@ -43,12 +41,12 @@ protected function getRequestConfigPath()
*/
protected function createAdapter()
{
return $this->objectManager->create(\Magento\Elasticsearch\SearchAdapter\Adapter::class);
return $this->objectManager->create(\Magento\Elasticsearch\Elasticsearch5\SearchAdapter\Adapter::class);
}

/**
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testMatchQuery()
Expand All @@ -58,7 +56,7 @@ public function testMatchQuery()

/**
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testMatchOrderedQuery()
Expand All @@ -70,7 +68,7 @@ public function testMatchOrderedQuery()

/**
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testAggregationsQuery()
Expand All @@ -80,7 +78,7 @@ public function testAggregationsQuery()

/**
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testMatchQueryFilters()
Expand All @@ -92,7 +90,7 @@ public function testMatchQueryFilters()
* Range filter test with all fields filled
*
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testRangeFilterWithAllFields()
Expand All @@ -104,7 +102,7 @@ public function testRangeFilterWithAllFields()
* Range filter test with all fields filled
*
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testRangeFilterWithoutFromField()
Expand All @@ -116,7 +114,7 @@ public function testRangeFilterWithoutFromField()
* Range filter test with all fields filled
*
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testRangeFilterWithoutToField()
Expand All @@ -128,7 +126,7 @@ public function testRangeFilterWithoutToField()
* Term filter test
*
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testTermFilter()
Expand All @@ -140,7 +138,7 @@ public function testTermFilter()
* Term filter test
*
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testTermFilterArray()
Expand All @@ -152,7 +150,7 @@ public function testTermFilterArray()
* Term filter test
*
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testWildcardFilter()
Expand All @@ -164,7 +162,7 @@ public function testWildcardFilter()
* Request limits test
*
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testSearchLimit()
Expand All @@ -176,7 +174,7 @@ public function testSearchLimit()
* Bool filter test
*
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testBoolFilter()
Expand All @@ -188,7 +186,7 @@ public function testBoolFilter()
* Test bool filter with nested negative bool filter
*
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testBoolFilterWithNestedNegativeBoolFilter()
Expand All @@ -200,7 +198,7 @@ public function testBoolFilterWithNestedNegativeBoolFilter()
* Test range inside nested negative bool filter
*
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testBoolFilterWithNestedRangeInNegativeBoolFilter()
Expand All @@ -213,7 +211,7 @@ public function testBoolFilterWithNestedRangeInNegativeBoolFilter()
*
* @dataProvider elasticSearchAdvancedSearchDataProvider
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
* @param string $nameQuery
* @param string $descriptionQuery
Expand Down Expand Up @@ -259,7 +257,7 @@ public function elasticSearchAdvancedSearchDataProvider()
/**
* @magentoAppIsolation enabled
* @magentoDataFixture Magento/Framework/Search/_files/filterable_attribute.php
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testCustomFilterableAttribute()
Expand All @@ -274,7 +272,7 @@ public function testCustomFilterableAttribute()
*
* @magentoAppIsolation enabled
* @magentoDataFixture Magento/Framework/Search/_files/filterable_attributes.php
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
* @dataProvider filterByAttributeValuesDataProvider
* @param string $requestName
Expand All @@ -294,7 +292,7 @@ public function testFilterByAttributeValues($requestName, $additionalData)
* @param $rangeFilter
* @param $expectedRecordsCount
* @magentoDataFixture Magento/Framework/Search/_files/date_attribute.php
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
* @magentoAppIsolation enabled
* @dataProvider dateDataProvider
Expand All @@ -309,7 +307,7 @@ public function testAdvancedSearchDateField($rangeFilter, $expectedRecordsCount)
/**
* @magentoDataFixture Magento/Framework/Search/_files/product_configurable.php
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testAdvancedSearchCompositeProductWithOutOfStockOption()
Expand All @@ -320,7 +318,7 @@ public function testAdvancedSearchCompositeProductWithOutOfStockOption()
/**
* @magentoDataFixture Magento/Framework/Search/_files/product_configurable_with_disabled_child.php
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testAdvancedSearchCompositeProductWithDisabledChild()
Expand All @@ -333,7 +331,7 @@ public function testAdvancedSearchCompositeProductWithDisabledChild()
/**
* @magentoDataFixture Magento/Framework/Search/_files/search_weight_products.php
* @magentoAppIsolation enabled
* @magentoConfigFixture default/catalog/search/engine elasticsearch
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
* @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix adaptertest
*/
public function testSearchQueryBoost()
Expand Down

0 comments on commit bb7d459

Please sign in to comment.