Skip to content

Commit

Permalink
Sync Package: use Full_Sync_Immediately by default (#14357)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
roccotripaldi authored Jan 16, 2020
1 parent 40e356c commit 0addb54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/sync/src/class-modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);

Expand Down
10 changes: 5 additions & 5 deletions tests/php/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 0addb54

Please sign in to comment.