From 0addb5458b986d3a3fcfc57dc42426843f345d5f Mon Sep 17 00:00:00 2001 From: Rocco Tripaldi Date: Thu, 16 Jan 2020 09:02:35 -0500 Subject: [PATCH] Sync Package: use Full_Sync_Immediately by default (#14357) * Sync Package: use Full_Sync_Immediately by default The new full sync pattern introduced in #13963 should now be the default way to perform a full sync. We will still support the original full sync by allow sites to use a filter. * [not verified] Sync Unit Tests Use the legacy full sync module for default tests. --- packages/sync/src/class-modules.php | 2 +- tests/php/bootstrap.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/sync/src/class-modules.php b/packages/sync/src/class-modules.php index 6ca22e65e207a..09e95e5d47d20 100644 --- a/packages/sync/src/class-modules.php +++ b/packages/sync/src/class-modules.php @@ -40,7 +40,7 @@ class Modules { 'Automattic\\Jetpack\\Sync\\Modules\\Meta', 'Automattic\\Jetpack\\Sync\\Modules\\Plugins', 'Automattic\\Jetpack\\Sync\\Modules\\Stats', - 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync', + 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync_Immediately', 'Automattic\\Jetpack\\Sync\\Modules\\Term_Relationships', ); diff --git a/tests/php/bootstrap.php b/tests/php/bootstrap.php index 5490aa01390bb..cd00e9b5cc133 100644 --- a/tests/php/bootstrap.php +++ b/tests/php/bootstrap.php @@ -109,17 +109,17 @@ function _manually_install_woocommerce() { * * @return array */ -function jetpack_full_sync_immediately_on( $modules ) { +function jetpack_full_sync_immediately_off( $modules ) { foreach ( $modules as $key => $module ) { - if ( in_array( $module, array( 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync', 'Jetpack_Sync_Modules_Full_Sync' ), true ) ) { - $modules[ $key ] = 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync_Immediately'; + if ( in_array( $module, array( 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync_Immediately' ), true ) ) { + $modules[ $key ] = 'Automattic\\Jetpack\\Sync\\Modules\\Full_Sync'; } } return $modules; } -if ( false !== getenv( 'SYNC_BETA' ) ) { - tests_add_filter( 'jetpack_sync_modules', 'jetpack_full_sync_immediately_on' ); +if ( false === getenv( 'SYNC_BETA' ) ) { + tests_add_filter( 'jetpack_sync_modules', 'jetpack_full_sync_immediately_off' ); } require $test_root . '/includes/bootstrap.php';