Add unit tests for protocol, generators, runner, and test_case#140
Draft
Add unit tests for protocol, generators, runner, and test_case#140
Conversation
f70c75d to
be36563
Compare
Apply production code refactoring for testability: - Extract panic_message to control.rs (shared by runner.rs and stateful.rs) - Extract filter_backtrace, install_hegel_server, handle_antithesis_reporting in runner.rs - Extract classify_request_error and RequestErrorKind in test_case.rs - Replace LazyLock PROTOCOL_DEBUG with protocol_debug() function - Add ENV_TEST_MUTEX to lib.rs for env var test serialization - Add lcov.info to .gitignore Add unit tests to 9 source files: - cbor_utils.rs: panic paths for map_get/map_insert, wrong-type returns - protocol/packet.rs: invalid magic, invalid terminator, checksum mismatch - protocol/channel.rs: closed channel, server exit, disconnect, no result key - protocol/connection.rs: mark_server_exited, send_packet error paths - generators/value.rs: null/bytes/map/bignum conversions, error display, option - generators/compose.rs: fnv1a_hash determinism, different inputs, empty - antithesis.rs: env var presence/absence, nonexistent dir, emit_assertion - runner.rs: Settings, filter_backtrace, panic_message, install_hegel_server - test_case.rs: classify_request_error, protocol_debug, StopTestError display Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
be36563 to
48ca538
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.
Unit tests for internal modules. Depends on #138 (refactoring).
Covers: cbor_utils error paths, protocol packet/channel/connection errors, value deserialization edge cases, fnv1a_hash, antithesis reporting, runner install/backtrace/settings, request error classification.