Skip to content

feat(testing): make the provision key path configurable via SNOWCAP_TEST_KEY_PATH - #53

Open
GClunies wants to merge 2 commits into
datacoves:mainfrom
GClunies:configurable-test-key-path
Open

feat(testing): make the provision key path configurable via SNOWCAP_TEST_KEY_PATH#53
GClunies wants to merge 2 commits into
datacoves:mainfrom
GClunies:configurable-test-key-path

Conversation

@GClunies

@GClunies GClunies commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

provision wrote the test account admin's private key to tests/.snowcap_test_account_rsa_key.p8 by default. That path lives inside the checkout, so deleting the checkout (for example, removing a git worktree) destroys the only credential for the account's SERVICE admin user. The account is then unrecoverable by self-service. This happened to us today.

Changes

  • --key-path now defaults to ~/.snowcap/snowcap_test_account_rsa_key.p8, a durable per-user location outside any checkout
  • $SNOWCAP_TEST_KEY_PATH overrides the default for users who keep keys elsewhere
  • generate_rsa_keypair creates the parent directory if needed
  • TESTING.md documents the risk and the override
  • Unit tests pin the override and the home-directory fallback

Testing

  • pytest tests/test_manage_test_account.py: 72 passed
  • ruff check and ruff format --check clean

…EST_KEY_PATH

The default key location sits inside the checkout, so deleting the
checkout (e.g. a git worktree) destroys the only credential for the
test account's SERVICE admin. SNOWCAP_TEST_KEY_PATH lets contributors
point provisioning at a durable directory once.
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