From 8783ba937c0749903602953c0be90e25e0b21ff3 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 31 Jan 2025 11:03:01 +0100 Subject: [PATCH 1/5] Debug failing test --- .github/workflows/testing.yml | 2 ++ features/cron.feature | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index bf67592d..20348d9e 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -13,3 +13,5 @@ on: jobs: test: uses: wp-cli/.github/.github/workflows/reusable-testing.yml@main + with: + minimum-php: '8.3' diff --git a/features/cron.feature b/features/cron.feature index 3c9c3293..9ff51eb3 100644 --- a/features/cron.feature +++ b/features/cron.feature @@ -255,6 +255,11 @@ Feature: Manage WP-Cron events and schedules """ Error: """ + When I run `cat {RUN_DIR}/server.log` + Then STDOUT should contain: + """ + foo + """ And the {RUN_DIR}/server.log file should not exist Scenario: Run multiple cron events From 3bbf22c80bb9434af3bbf59adb71982fe282098e Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 31 Jan 2025 12:30:11 +0100 Subject: [PATCH 2/5] Try workaround --- features/cron.feature | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/features/cron.feature b/features/cron.feature index 9ff51eb3..8c8aff97 100644 --- a/features/cron.feature +++ b/features/cron.feature @@ -255,12 +255,13 @@ Feature: Manage WP-Cron events and schedules """ Error: """ - When I run `cat {RUN_DIR}/server.log` - Then STDOUT should contain: - """ - foo - """ - And the {RUN_DIR}/server.log file should not exist + + # Normally we would simply check for the log file to not exist. However, when running with Xdebug for code coverage purposes, + # the following warning might be added to the log file: + # PHP Warning: JIT is incompatible with third party extensions that override zend_execute_ex(). JIT disabled. in Unknown on line 0 + # This workaround checks for any other possible entries in the log file. + When I run `awk '!/JIT/' {RUN_DIR}/server.log 2>/dev/null` + Then STDOUT should be empty Scenario: Run multiple cron events When I try `wp cron event run` From c1742f869c495471a3fa0d581b86797512e188d7 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 31 Jan 2025 12:33:09 +0100 Subject: [PATCH 3/5] exit code --- features/cron.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/cron.feature b/features/cron.feature index 8c8aff97..39f17412 100644 --- a/features/cron.feature +++ b/features/cron.feature @@ -260,7 +260,7 @@ Feature: Manage WP-Cron events and schedules # the following warning might be added to the log file: # PHP Warning: JIT is incompatible with third party extensions that override zend_execute_ex(). JIT disabled. in Unknown on line 0 # This workaround checks for any other possible entries in the log file. - When I run `awk '!/JIT/' {RUN_DIR}/server.log 2>/dev/null` + When I run `awk '!/JIT/' {RUN_DIR}/server.log 2>/dev/null || echo ""` Then STDOUT should be empty Scenario: Run multiple cron events From fa5f833aae878d8a0c7265880e817dcd7ca2e6cf Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 31 Jan 2025 13:13:20 +0100 Subject: [PATCH 4/5] true --- features/cron.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/cron.feature b/features/cron.feature index 39f17412..31f6e1d7 100644 --- a/features/cron.feature +++ b/features/cron.feature @@ -260,7 +260,7 @@ Feature: Manage WP-Cron events and schedules # the following warning might be added to the log file: # PHP Warning: JIT is incompatible with third party extensions that override zend_execute_ex(). JIT disabled. in Unknown on line 0 # This workaround checks for any other possible entries in the log file. - When I run `awk '!/JIT/' {RUN_DIR}/server.log 2>/dev/null || echo ""` + When I run `awk '!/JIT/' {RUN_DIR}/server.log 2>/dev/null || true` Then STDOUT should be empty Scenario: Run multiple cron events From 96824c031593ec790583831e617c3f7a96f14974 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 31 Jan 2025 13:54:24 +0100 Subject: [PATCH 5/5] Undo temp change --- .github/workflows/testing.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 20348d9e..bf67592d 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -13,5 +13,3 @@ on: jobs: test: uses: wp-cli/.github/.github/workflows/reusable-testing.yml@main - with: - minimum-php: '8.3'