From 0a99cc28720757d28628595e10fedb135e9bbb53 Mon Sep 17 00:00:00 2001 From: Joseph Bielawski Date: Mon, 16 Oct 2023 16:10:54 +0200 Subject: [PATCH] Reduce the amount of test data in ElasticSearch tests --- .../ElasticsearchExtractorTest.php | 16 ++++++++-------- .../ElasticsearchPHP/IntegrationTest.php | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/adapter/etl-adapter-elasticsearch/tests/Flow/ETL/Adapter/Elasticsearch/Tests/Integration/ElasticsearchPHP/ElasticsearchExtractorTest.php b/src/adapter/etl-adapter-elasticsearch/tests/Flow/ETL/Adapter/Elasticsearch/Tests/Integration/ElasticsearchPHP/ElasticsearchExtractorTest.php index d3219b4f6..131954065 100644 --- a/src/adapter/etl-adapter-elasticsearch/tests/Flow/ETL/Adapter/Elasticsearch/Tests/Integration/ElasticsearchPHP/ElasticsearchExtractorTest.php +++ b/src/adapter/etl-adapter-elasticsearch/tests/Flow/ETL/Adapter/Elasticsearch/Tests/Integration/ElasticsearchPHP/ElasticsearchExtractorTest.php @@ -85,7 +85,7 @@ public function test_extraction_index_with_from_and_size() : void new Row\Entry\StringEntry('name', 'id_' . $i), new Row\Entry\BooleanEntry('active', (bool) \random_int(0, 1)) ), - \range(1, 10_005) + \range(1, 2000) ), ), new FlowContext(Config::default())); @@ -109,7 +109,7 @@ public function test_extraction_index_with_from_and_size() : void ->transform(Elasticsearch::hits_to_rows(DocumentDataSource::fields)) ->fetch(); - $this->assertCount(10_000, $results); + $this->assertCount(2000, $results); $this->assertArrayHasKey('id', $results->first()->toArray()); $this->assertArrayHasKey('position', $results->first()->toArray()); $this->assertArrayNotHasKey('active', $results->first()->toArray()); @@ -128,7 +128,7 @@ public function test_extraction_index_with_search_after() : void new Row\Entry\StringEntry('name', 'id_' . $i), new Row\Entry\BooleanEntry('active', (bool) \random_int(0, 1)) ), - \range(1, 10_005) + \range(1, 2005) ), ), new FlowContext(Config::default())); @@ -149,7 +149,7 @@ public function test_extraction_index_with_search_after() : void ->extract(Elasticsearch::search($this->elasticsearchContext->clientConfig(), $params)) ->fetch(); - $this->assertCount(10, $results); + $this->assertCount(3, $results); } public function test_extraction_index_with_search_after_with_point_in_time() : void @@ -164,7 +164,7 @@ public function test_extraction_index_with_search_after_with_point_in_time() : v new Row\Entry\StringEntry('name', 'id_' . $i), new Row\Entry\BooleanEntry('active', (bool) \random_int(0, 1)) ), - \range(1, 10_005) + \range(1, 2005) ), ), new FlowContext(Config::default())); @@ -190,7 +190,7 @@ public function test_extraction_index_with_search_after_with_point_in_time() : v ->extract(Elasticsearch::search($this->elasticsearchContext->clientConfig(), $params, $pitParams)) ->fetch(); - $this->assertCount(10, $results); + $this->assertCount(3, $results); } public function test_extraction_whole_index_with_point_in_time() : void @@ -205,7 +205,7 @@ public function test_extraction_whole_index_with_point_in_time() : void new Row\Entry\StringEntry('name', 'id_' . $i), new Row\Entry\BooleanEntry('active', (bool) \random_int(0, 1)) ), - \range(1, 10_005) + \range(1, 2005) ), ), new FlowContext(Config::default())); @@ -231,6 +231,6 @@ public function test_extraction_whole_index_with_point_in_time() : void ->extract(Elasticsearch::search($this->elasticsearchContext->clientConfig(), $params, $pitParams)) ->fetch(); - $this->assertCount(10, $results); + $this->assertCount(3, $results); } } diff --git a/src/adapter/etl-adapter-elasticsearch/tests/Flow/ETL/Adapter/Elasticsearch/Tests/Integration/ElasticsearchPHP/IntegrationTest.php b/src/adapter/etl-adapter-elasticsearch/tests/Flow/ETL/Adapter/Elasticsearch/Tests/Integration/ElasticsearchPHP/IntegrationTest.php index b364312cc..f47405d87 100644 --- a/src/adapter/etl-adapter-elasticsearch/tests/Flow/ETL/Adapter/Elasticsearch/Tests/Integration/ElasticsearchPHP/IntegrationTest.php +++ b/src/adapter/etl-adapter-elasticsearch/tests/Flow/ETL/Adapter/Elasticsearch/Tests/Integration/ElasticsearchPHP/IntegrationTest.php @@ -46,7 +46,7 @@ public function test_loading_and_extraction_with_limit_and_transformation() : vo new Row\Entry\StringEntry('name', 'id_' . $i), new Row\Entry\BooleanEntry('active', false) ), - \range(1, 10_005) + \range(1, 2005) ), ), self::SOURCE_INDEX,