Skip to content

fix(integration-test): run the search and reference tests without the GitHub login - #241

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

oleksandr-nc merged 1 commit into
mainfrom
fix/integration-tests-workflow-token

Conversation

@oleksandr-nc

Copy link
Copy Markdown
Contributor

Every integration test depended on testOAuthLogin, which signs in to github.com with the CI account's password and a TOTP code. When GitHub answers that login with a two-factor prompt or a checkup page, the login test fails or is skipped, and PHPUnit then skips all 24 tests that depend on it. On pull requests opened by Dependabot the account secrets are not available at all, so every test is skipped and the job still reports success.

The search and reference tests use the workflow token

The 21 tests for repository and issue search, issue and pull request references, and code permalinks only read public nextcloud/server data, so they no longer depend on the OAuth login. Each test stores the token GitHub Actions issues to the workflow run as the test user's personal access token, and restores the user's previous token afterwards, so the OAuth, notification and token revocation tests keep the token the OAuth flow stored, whatever order the tests run in. The tests are skipped when GITHUB_TOKEN is not set.

The integration workflow passes a read-only token

The workflow requests contents: read for its token and passes GITHUB_TOKEN to the PHPUnit step.

🤖 AI (if applicable)

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

… GitHub login

All integration tests depended on testOAuthLogin, which signs in to
github.com with the CI account's password and a TOTP code. GitHub often
answers that login with a two-factor prompt or a checkup page, and the
24 dependent tests were then skipped.

The 21 search, issue/PR reference and code reference tests only read
public data, so they now store the workflow's GITHUB_TOKEN as the test
user's personal token, restoring the previous token afterwards so the
OAuth-dependent tests are unaffected. The integration workflow requests
a read-only token and passes it to PHPUnit.

Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
@oleksandr-nc
oleksandr-nc merged commit a8af620 into main Sep 15, 2026
34 of 36 checks passed
@oleksandr-nc
oleksandr-nc deleted the fix/integration-tests-workflow-token branch September 15, 2026 11:50
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