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

Reduced Sync Search test data sample. #22493

Merged
merged 2 commits into from
Jan 25, 2022
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
@@ -0,0 +1,4 @@
Significance: minor
Type: enhancement

Reduced the data set for the Search Sync tests to speed up the process.
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ public function set_up() {
*
* @return string[][]
*/
public function get_allowed_postmeta_keys() {
public function get_random_allowed_postmeta_keys() {
$params = array();
$keys = Modules\Search::get_all_postmeta_keys();
foreach ( $keys as $k ) {
$params[] = array( $k );
foreach ( array_rand( $keys, 10 ) as $k ) {
$params[] = array( $keys[ $k ] );
}

return $params;
Expand All @@ -85,11 +85,11 @@ public function get_allowed_postmeta_keys() {
*
* @return string[][]
*/
public function get_allowed_taxonomies() {
public function get_random_allowed_taxonomies() {
$params = array();
$keys = Modules\Search::get_all_taxonomies();
foreach ( $keys as $k ) {
$params[] = array( $k );
foreach ( array_rand( $keys, 10 ) as $k ) {
$params[] = array( $keys[ $k ] );
}

return $params;
Expand Down Expand Up @@ -167,7 +167,7 @@ public function test_meta_no_overlap() {
* Important that we double check the specification format since
* this will often get added to.
*
* @dataProvider get_allowed_postmeta_keys
* @dataProvider get_random_allowed_postmeta_keys
* @param string $key Meta Key.
*/
public function test_check_postmeta_spec( $key ) {
Expand Down Expand Up @@ -201,7 +201,7 @@ public function test_check_postmeta_spec( $key ) {
/**
* Verify that allowed taxonomies are synced.
*
* @dataProvider get_allowed_taxonomies
* @dataProvider get_random_allowed_taxonomies
* @param string $taxonomy Taxonomy Name.
*/
public function test_add_taxonomy( $taxonomy ) {
Expand Down