From c049baa3d010cf010497dc615df6ee4ed976bad9 Mon Sep 17 00:00:00 2001 From: Evan Mattson Date: Fri, 6 Oct 2023 14:16:40 -0400 Subject: [PATCH 1/4] Update E2E error ignore to match startsWith. --- tests/e2e/config/wordpress-debug-log/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/e2e/config/wordpress-debug-log/index.js b/tests/e2e/config/wordpress-debug-log/index.js index 70a3d8f581f..f99e7d29ff9 100644 --- a/tests/e2e/config/wordpress-debug-log/index.js +++ b/tests/e2e/config/wordpress-debug-log/index.js @@ -129,9 +129,13 @@ async function assertEmptyDebugLog() { // before the entries are recorded and result in a false success. await page.waitForTimeout( 1000 ); + // Filter out lines that are ignored. const filteredDebugLog = debugLogData.filter( ( line ) => { const lineWithoutTimestamp = line.replace( /^\[[^\]]+\]\s+/, '' ); - return ! ignoreList.includes( lineWithoutTimestamp ); + + return ignoreList.some( ( ignoreLine ) => + lineWithoutTimestamp.startsWith( ignoreLine ) + ); } ); if ( filteredDebugLog.length ) { From 38d94d76ccbfacc3af19f285f5a5119d405e4568 Mon Sep 17 00:00:00 2001 From: Evan Mattson Date: Fri, 6 Oct 2023 14:17:20 -0400 Subject: [PATCH 2/4] Remove line numbers from ignores & consolidate. --- .../wordpress-debug-log/log-ignore-list.js | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/tests/e2e/config/wordpress-debug-log/log-ignore-list.js b/tests/e2e/config/wordpress-debug-log/log-ignore-list.js index 7f177276d92..47de35faa3a 100644 --- a/tests/e2e/config/wordpress-debug-log/log-ignore-list.js +++ b/tests/e2e/config/wordpress-debug-log/log-ignore-list.js @@ -6,24 +6,19 @@ export const logIgnoreList = { '5.2.16': [ // Deprecated syntax or function calls which are fixed in later WP versions. - 'PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/wp-includes/load.php on line 926', - 'PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/wp-includes/formatting.php on line 2697', - 'PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/wp-includes/formatting.php on line 4803', - 'PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/wp-includes/class-wp-editor.php on line 749', - 'PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/wp-includes/class-wp-editor.php on line 750', - 'PHP Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in /var/www/html/wp-includes/SimplePie/Parse/Date.php on line 545', - 'PHP Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in /var/www/html/wp-includes/SimplePie/Parse/Date.php on line 546', + 'PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/wp-includes/load.php on line', + 'PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/wp-includes/formatting.php on line', + 'PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/wp-includes/class-wp-editor.php on line', + 'PHP Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in /var/www/html/wp-includes/SimplePie/Parse/Date.php on line', // These are guarded against in later WP versions. - 'PHP Notice: Trying to access array offset on value of type bool in /var/www/html/wp-admin/includes/update.php on line 673', - 'PHP Notice: Trying to access array offset on value of type null in /var/www/html/wp-includes/rest-api/class-wp-rest-request.php on line 337', - 'PHP Notice: Trying to access array offset on value of type bool in /var/www/html/wp-includes/theme.php on line 2360', + 'PHP Notice: Trying to access array offset on value of type bool in /var/www/html/wp-admin/includes/update.php on line', + 'PHP Notice: Trying to access array offset on value of type null in /var/www/html/wp-includes/rest-api/class-wp-rest-request.php on line', + 'PHP Notice: Trying to access array offset on value of type bool in /var/www/html/wp-includes/theme.php on line', ], nightly: [ - // Can be removed once WordPress AMP Plugin removes the deprecated function - // call. - // + // Can be removed once WordPress AMP Plugin removes the deprecated function call. // See: https://github.com/ampproject/amp-wp/issues/7619 - 'PHP Deprecated: Function _admin_bar_bump_cb is deprecated since version 6.4.0! Use wp_enqueue_admin_bar_bump_styles instead. in /var/www/html/wp-includes/functions.php on line 6032', + 'PHP Deprecated: Function _admin_bar_bump_cb is deprecated since version 6.4.0! Use wp_enqueue_admin_bar_bump_styles instead. in /var/www/html/wp-includes/functions.php', ], }; From 6995d728a9a85f396dd8471626a477529931eccd Mon Sep 17 00:00:00 2001 From: Evan Mattson Date: Fri, 6 Oct 2023 14:20:10 -0400 Subject: [PATCH 3/4] Update ignores for consistency. --- .../config/wordpress-debug-log/log-ignore-list.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/e2e/config/wordpress-debug-log/log-ignore-list.js b/tests/e2e/config/wordpress-debug-log/log-ignore-list.js index 47de35faa3a..c8daed8e6f6 100644 --- a/tests/e2e/config/wordpress-debug-log/log-ignore-list.js +++ b/tests/e2e/config/wordpress-debug-log/log-ignore-list.js @@ -6,15 +6,15 @@ export const logIgnoreList = { '5.2.16': [ // Deprecated syntax or function calls which are fixed in later WP versions. - 'PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/wp-includes/load.php on line', - 'PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/wp-includes/formatting.php on line', - 'PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/wp-includes/class-wp-editor.php on line', - 'PHP Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in /var/www/html/wp-includes/SimplePie/Parse/Date.php on line', + 'PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/wp-includes/load.php', + 'PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/wp-includes/formatting.php', + 'PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/wp-includes/class-wp-editor.php', + 'PHP Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in /var/www/html/wp-includes/SimplePie/Parse/Date.php', // These are guarded against in later WP versions. - 'PHP Notice: Trying to access array offset on value of type bool in /var/www/html/wp-admin/includes/update.php on line', - 'PHP Notice: Trying to access array offset on value of type null in /var/www/html/wp-includes/rest-api/class-wp-rest-request.php on line', - 'PHP Notice: Trying to access array offset on value of type bool in /var/www/html/wp-includes/theme.php on line', + 'PHP Notice: Trying to access array offset on value of type bool in /var/www/html/wp-admin/includes/update.php', + 'PHP Notice: Trying to access array offset on value of type null in /var/www/html/wp-includes/rest-api/class-wp-rest-request.php', + 'PHP Notice: Trying to access array offset on value of type bool in /var/www/html/wp-includes/theme.php', ], nightly: [ // Can be removed once WordPress AMP Plugin removes the deprecated function call. From a0e5e132d58983daca592fb76e0d61d7f1035f15 Mon Sep 17 00:00:00 2001 From: Evan Mattson Date: Fri, 6 Oct 2023 14:45:55 -0400 Subject: [PATCH 4/4] Filter out lines that start with an ignore. --- tests/e2e/config/wordpress-debug-log/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/config/wordpress-debug-log/index.js b/tests/e2e/config/wordpress-debug-log/index.js index f99e7d29ff9..2324e7a2a43 100644 --- a/tests/e2e/config/wordpress-debug-log/index.js +++ b/tests/e2e/config/wordpress-debug-log/index.js @@ -133,7 +133,7 @@ async function assertEmptyDebugLog() { const filteredDebugLog = debugLogData.filter( ( line ) => { const lineWithoutTimestamp = line.replace( /^\[[^\]]+\]\s+/, '' ); - return ignoreList.some( ( ignoreLine ) => + return ! ignoreList.some( ( ignoreLine ) => lineWithoutTimestamp.startsWith( ignoreLine ) ); } );