Skip to content

Commit 4dcb4f8

Browse files
committed
test: widen OAuth failure diagnostics and upload Nextcloud log
The first debug run showed that the fallback /sessions/two-factor/app returns 404 for the OAuth sudo re-verification flow, and the previous describePage diagnostic was never reached because navigateToTotpPage fails earlier. - navigateToTotpPage now includes the source URL and the source page's form/heading summary in its failure message, so we can see the actual structure of the sudo re-verification page. - On any integration-test failure, upload data/nextcloud.log as a CI artifact so server-side errors are visible for later inspection. Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
1 parent 2daa831 commit 4dcb4f8

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/integration.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,11 @@ jobs:
8080
CI_USER_PASSWORD: ${{ secrets.CI_USER_PASSWORD }}
8181
CI_TOTP_SECRET: ${{ secrets.CI_TOTP_SECRET }}
8282
run: composer run test:integration
83+
84+
- name: Upload Nextcloud log on failure
85+
if: failure()
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: nextcloud-log-${{ matrix.server-versions }}
89+
path: data/nextcloud.log
90+
if-no-files-found: ignore

tests/integration/GithubOauthIntegrationTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,12 @@ private function navigateToTotpPage(string $currentUrl, string $currentBody): ar
331331
$body = $response->getBody()->getContents();
332332
$statusCode = $response->getStatusCode();
333333

334-
$this->assertOkStatus($statusCode, 'Failed to navigate to TOTP page from WebAuthn page. URL: ' . $totpUrl . '.');
334+
$this->assertOkStatus(
335+
$statusCode,
336+
'Failed to navigate to TOTP page from page without a recognized 2FA form. '
337+
. 'Source URL: ' . $currentUrl . '. Attempted TOTP URL: ' . $totpUrl . '. '
338+
. 'Source page: ' . GitHubHtml::describePage($selector) . '.'
339+
);
335340

336341
return [
337342
'url' => $totpUrl,

0 commit comments

Comments
 (0)