test: verify each HostError maps to the correct severity level (#227)#238
Open
Faithy5 wants to merge 3 commits into
Open
test: verify each HostError maps to the correct severity level (#227)#238Faithy5 wants to merge 3 commits into
Faithy5 wants to merge 3 commits into
Conversation
…-Lab#227) - Add severity_tests.rs with 14 unit tests covering Fatal, Error, and Warning levels - Test ErrorSeverity→Severity conversion for all four variants - Test build_report severity via taxonomy for Budget, Auth, Context categories - Exhaustive sweep tests for all budget and value mapping table entries - Wire module in mappings/mod.rs
test: verify host error severity mappings (Toolbox-Lab#227)
…lbox-Lab#227) - Add NearExpiry (code 4, Warning) entry to storage mapping table and storage.toml taxonomy - Add tests covering all three severity levels: Fatal, Error, Warning - Add build_report round-trip tests for each severity level - Add exhaustive all_storage_entries_have_valid_severity guard test
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.
Summary
Closes #227
Adds unit tests that assert the correct
Severityfor a representative set of host error codes across all categories, with at least one test per severity level (Fatal, Error, Warning).Changes
New mapping entry
storage.rs: AddedNearExpiry(code 4,Severity::Warning) — a ledger entry approaching TTL expiry is a real Soroban concept and the canonical Warning-level casestorage.toml: Matching taxonomy entry withseverity = "Warning"New tests in
severity_tests.rsstorage_near_expiry_maps_to_warningbuild_report_storage_near_expiry_is_warningbuild_report)taxonomy_warning_severity_is_correctly_parsedall_storage_entries_have_valid_severityExisting tests already covered Fatal and Error. All three severity levels are now covered by real mapping entries and
build_reportround-trips — any regression in severity mapping will cause a clear test failure.