Skip to content

fix(integration-test): run the OAuth, notification and revocation tests without a GitHub account - #242

Merged
oleksandr-nc merged 1 commit into
mainfrom
fix/integration-tests-mock-github
Sep 15, 2026
Merged

oleksandr-nc merged 1 commit into
mainfrom
fix/integration-tests-mock-github

Conversation

@oleksandr-nc

Copy link
Copy Markdown
Contributor

Following #241: the last four integration tests, the OAuth login, the two notification tests and the token revocation test, still signed in to github.com as a CI account with its password and a TOTP code. They failed or were skipped whenever GitHub answered that login with a two-factor prompt or a checkup page.

These tests run against a mocked GitHub

A new MockedGithubApiTrait builds GithubAPIService and ConfigController with a mocked HTTP client, and resets the test user's settings and the OAuth app credentials around each test. The OAuth test checks the code exchange, the /user request and what gets stored, and that a mismatching state is rejected before any request is sent. The notification tests cover every branch of the getNotifications() filter, the default two-week since window and the result limit. The revocation tests check the request sent when an OAuth token is disconnected, and that disconnecting a personal token does not call GitHub. The revocation test no longer has to run last, so it drops the Z from its name.

The login scraping is removed

GitHubHtml.php and Totp.php are deleted, and the integration workflow no longer passes the CI_* secrets.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

…ts without a GitHub account

The OAuth login, notification and token revocation tests signed in to
github.com as a CI account with a password and a TOTP code, and failed
or were skipped whenever GitHub answered with a two-factor prompt or a
checkup page.

They now build GithubAPIService and ConfigController with a mocked HTTP
client and assert the requests the app sends: the OAuth code exchange
and user lookup, a rejected state mismatch, the notification filter,
and the token revocation. The HTML scraping helpers are removed, and
the integration workflow no longer passes the CI_* secrets.

Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
@oleksandr-nc
oleksandr-nc merged commit 065a18c into main Sep 15, 2026
33 checks passed
@oleksandr-nc
oleksandr-nc deleted the fix/integration-tests-mock-github branch September 15, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant