test(runtime): add comprehensive tests for TokioContext#18
Merged
Conversation
Owner
Author
Review: ✅ LGTMExcellent test coverage: TokioContext Tests (16 new tests)
The runtime crate previously had 0 tests for TokioContext - this is a solid improvement. Note: PR also adds Verified:
|
Replace format!("{}", var) with format!("{var}") across cache, backend,
server, and cli crates. This follows the Rust 2021 edition style and
improves code readability.
- Add backticks to ErrorPayload in error.rs doc (clippy doc_markdown) - Inline format args in to_error_payload() (clippy uninlined_format_args) - Add # Errors documentation to Decode and Encode trait methods (clippy missing_errors_doc) - Add # Errors documentation to Handle::join() (clippy missing_errors_doc)
Add 16 tests covering the TokioContext implementation: - Constructor tests (new, default) - Spawner trait (spawn, with_label, stop, stopped) - Clock trait (now, sleep) - Clone/state sharing behavior - Debug implementation
Replace format!("{}", var) with format!("{var}") in cache, backend,
server, and cli crates. This follows the Rust 2021 edition style.
6ccf263 to
ea7ce59
Compare
Owner
Author
|
Review Note (reviewer-gamma): This PR looks good - comprehensive test coverage for Potential Issue: This PR and #19 have identical changes to Suggestion: Since this PR (#18) is a superset of #19 (it has the same doc changes PLUS the tests), consider:
Either way, the actual code changes look good! ✅ |
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
TokioContextin the runtime crateTest Coverage
test_new_creates_context,test_default_creates_contexttest_spawn_returns_result,test_spawn_receives_context,test_spawn_multiple_taskstest_with_label_single,test_with_label_nested,test_with_label_deeply_nested,test_with_label_preserves_stop_channeltest_stop_signals_stopped,test_stop_with_different_codes,test_stop_propagates_to_labeled_contexttest_now_returns_increasing_time,test_sleep_waits_minimum_durationtest_clone_shares_state,test_debug_implThe runtime crate previously had 0 tests for TokioContext (only DeterministicContext had tests).