Skip to content

Commit 2fab768

Browse files
authored
Merge pull request #117 from Kit/tests-fix-502-error
Tests: Fix 502 Bad Gateway on WPForms Plugin Deactivation
2 parents 90e2088 + 14ef4c4 commit 2fab768

2 files changed

Lines changed: 19 additions & 17 deletions

File tree

.github/workflows/tests.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ jobs:
166166
location ~ \.php$ {
167167
include snippets/fastcgi-php.conf;
168168
fastcgi_pass unix:/run/php/php${{ matrix.php-versions }}-fpm.sock;
169+
170+
# Prevent 502 Bad Gateway error "upstream sent too big header while reading response header from upstream"
171+
fastcgi_buffers 16 16k;
172+
fastcgi_buffer_size 32k;
173+
fastcgi_busy_buffers_size 64k;
169174
}
170175
171176
location ~ /\.ht {
@@ -269,6 +274,13 @@ jobs:
269274
# Artifacts are data generated by this workflow that we want to access, such as log files, screenshots, HTML output.
270275
# The if: failure() directive means that this will run when the workflow fails e.g. if a test fails, which is needed
271276
# because we want to see why a test failed.
277+
- name: Upload nginx Error Log to Artifact
278+
if: failure()
279+
uses: actions/upload-artifact@v4
280+
with:
281+
name: nginx-error-log-${{ steps.test-group.outputs.value }}-${{ matrix.php-versions }}.log
282+
path: /var/log/nginx/error.log
283+
272284
- name: Upload Test Results to Artifact
273285
if: failure()
274286
uses: actions/upload-artifact@v4

tests/Support/Helper/ThirdPartyPlugin.php

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,13 @@ public function deactivateThirdPartyPlugin($I, $name)
6565
// Wait for the Plugins page to load.
6666
$I->waitForElementVisible('body.plugins-php');
6767

68-
// Depending on the Plugin name, perform deactivation.
69-
switch ($name) {
70-
case 'wpforms-lite':
71-
// Using the check option results in a 502 Bad Gateway error.
72-
$I->click('a#deactivate-' . $name);
73-
break;
74-
75-
default:
76-
// Deactivate the Plugin.
77-
$I->checkOption('//*[@data-slug="' . $name . '"]/th/input');
78-
$I->selectOption('action', 'deactivate-selected');
79-
$I->click('#doaction');
80-
81-
// Wait for the Plugins page to load with the Plugin deactivated, to confirm it deactivated.
82-
$I->waitForElementVisible('table.plugins tr[data-slug=' . $name . '].inactive');
83-
break;
84-
}
68+
// Deactivate the Plugin.
69+
$I->checkOption('//*[@data-slug="' . $name . '"]/th/input');
70+
$I->selectOption('action', 'deactivate-selected');
71+
$I->click('#doaction');
72+
73+
// Wait for the Plugins page to load with the Plugin deactivated, to confirm it deactivated.
74+
$I->waitForElementVisible('table.plugins tr[data-slug=' . $name . '].inactive');
8575
}
8676

8777
/**

0 commit comments

Comments
 (0)