Skip Solana keypair test when solders is absent; add CI#39
Open
Pattermesh wants to merge 1 commit into
Open
Conversation
Contributor
|
Welcome to kcolbchain, @Pattermesh — glad you're here. 🌱 Here's what happens from this PR:
While you wait:
What happens after your first merge
Thanks for writing the code. We're building this to last. |
test_generate_new_wallet hard-failed when the optional `solders`
dependency was not installed: SolanaWallet falls back to a stub
pubkey ("STUB_PUBKEY", 11 chars) and the test asserts a base58
pubkey longer than 30 chars. Guard it with pytest.importorskip
so it skips gracefully instead of failing.
Also add .github/workflows/ci.yml running `pytest -q` on push and
PRs to main across Python 3.10-3.12. solders is intentionally not
installed in CI, exercising the skip path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
338b82a to
1418609
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two changes:
Fix a brittle test.
tests/test_solana_connector.py::TestSolanaWallet::test_generate_new_wallethard-failed whenever the optionalsoldersdependency was not installed. Withoutsolders,SolanaWallet()falls back to a stub wallet withpubkey = "STUB_PUBKEY"(11 chars), but the test assertslen(wallet.pubkey) > 30(a real base58 pubkey). The test now guards withpytest.importorskip("solders"), so it skips gracefully instead of failing when the dep is absent.Add CI. New
.github/workflows/ci.ymlrunspython -m pytest -qon every push and PR tomain, across Python 3.10 / 3.11 / 3.12.soldersis intentionally not installed in CI, which exercises the new skip path.Why
soldersis an optional dependency (the Solana connector degrades to a stub without it). A missing optional dep should not turn the whole suite red. There was also no CI, so regressions could land silently.Verification
With
soldersabsent (the default environment),python3 -m pytest -q:The previously-failing test now skips; the other 99 tests pass.
🤖 Generated with Claude Code