fix(tests): replace panic-prone unwrap/expect/todo!/panic! with typed…#685
Open
essiend03-glitch wants to merge 1 commit into
Open
Conversation
… error propagation
Addresses issues in three test files that contained a combined 74 panic-prone
calls (unwrap, expect, panic!, todo!):
- tests/commission_engine_test.rs (23 occurrences)
- make_structure() now returns Result<CommissionStructure, Box<dyn Error>>
using .transpose()? instead of .unwrap() on BigDecimal::from_str
- All unit test fns return Result<(), Box<dyn Error>>, propagating errors
from compute_commission() with ? instead of .unwrap()
- Integration test pool() returns Result<PgPool, sqlx::Error>; all DB
calls propagate with ? instead of .unwrap()
- src/crypto/tests.rs (25 occurrences)
- All test fns return Result<(), Box<dyn Error>>
- Crypto operations (aes_gcm_encrypt, aes_gcm_decrypt, PlatformKeyVersion::generate,
KeyStore::new, ecdh_derive_kek, aes_kw_wrap, kv.unwrap_session_key,
decode_nonce, URL_SAFE_NO_PAD.decode, PublicKey::from_sec1_bytes) now
propagate with ? instead of .unwrap()
- src/security/tests.rs (26 occurrences)
- create_test_pool() replaced todo!() with proper Result-returning DB
connect; tests that cannot connect will fail with a descriptive error
rather than a compile-time unimplemented panic
- All async test fns return Result<(), Box<dyn Error>>, propagating
service call errors with ?
- panic!("Expected SystemHalted error") in match arm replaced with
typed Err(format!(...).into()) for proper error propagation
No logic changes — assertions and test intent are preserved.
|
@essiend03-glitch Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
closes #579
closes #582
closes #584
… error propagation
Addresses issues in three test files that contained a combined 74 panic-prone calls (unwrap, expect, panic!, todo!):
tests/commission_engine_test.rs (23 occurrences)
src/crypto/tests.rs (25 occurrences)
src/security/tests.rs (26 occurrences)
No logic changes — assertions and test intent are preserved.