Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce the amount of test data in ElasticSearch tests #597

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

Expand All @@ -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());
Expand All @@ -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()));

Expand All @@ -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
Expand All @@ -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()));

Expand All @@ -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
Expand All @@ -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()));

Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading