Skip to content

fix(tests): keep the test suite out of the user's Keychain - #309

Merged
adefreitas merged 1 commit into
StackOneHQ:mainfrom
adefreitas:fix/tests-stay-out-of-keychain
Dec 3, 2026
Merged

adefreitas merged 1 commit into
StackOneHQ:mainfrom
adefreitas:fix/tests-stay-out-of-keychain

Conversation

@adefreitas

Copy link
Copy Markdown
Collaborator

This PR stops the test suite from asking for your login password.

PanelNav's GitHub login check called GitHubAuth.token(), which reads StackNudge's item in the Keychain. Every local test run builds a new test binary that macOS doesn't recognise, so three IntegrationPageTests made macOS ask for the user's password before handing the item over.

  • PanelNav now reads the GitHub and Slack tokens through injectable readers, githubToken and slackBotToken, which default to the Keychain. The gh-login tests stub githubToken.
  • GitHubAuth.token and SlackCredentials.botToken stop the run with a precondition when STACKNUDGE_TESTS_NO_KEYCHAIN is set. make test, make test-without-xcode and the CI swift test step set it, so a test that reaches the Keychain again fails instead of prompting.

Checks

  • make test-without-xcode passes with the guard on: 2147 tests, 0 failures.
  • Before the stub, the guard stopped the run in IntegrationPageTests, which is how I found the three tests. After it, no test reaches the Keychain.

🤖 Generated with Claude Code

The GitHub login check in PanelNav read the real Keychain item, so every
local test run, with a freshly built test binary macOS doesn't know,
asked the user for their password. PanelNav now reads the GitHub and
Slack tokens through injectable readers, and the gh-login tests stub
them. GitHubAuth.token and SlackCredentials.botToken stop the run when
STACKNUDGE_TESTS_NO_KEYCHAIN is set, which make test, make
test-without-xcode and CI now set, so a test that reaches the Keychain
again fails instead of prompting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adefreitas
adefreitas force-pushed the fix/tests-stay-out-of-keychain branch from 0d1cef6 to 7b89501 Compare December 3, 2026 10:59
@adefreitas
adefreitas merged commit 6e7e09e into StackOneHQ:main Dec 3, 2026
6 checks passed
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