Repository navigation
Enhance GitHub Actions CI test coverage workflow and expand load_guard unit tests - #7
Merged
Merged
Conversation
…e load_guard unit tests
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 of Changes
This PR improves GitHub Actions CI test coverage enforcement for changes going into
main, and adds comprehensive unit test coverage across multiple coreload_guardmodules.1. GitHub Actions CI Enhancements (
.github/workflows/test.yml)pushandpull_requesttriggers so CI automatically runs onmainas well as feature, fix, and doc branches ('feature/**','feat/**','fix/**','docs/**'), ensuring automated test coverage validation on all changes going intomain.cargo test --workspace --doc --verboseto the test job so doc tests are executed in CI alongside unit and integration tests.--workspaceflag tocargo llvm-covto ensure coverage metrics are gathered across all workspace targets and members.2. Expanded Unit Tests in
src/load_guard/src/load_guard/route.rs: Added unit tests foris_tunnel_interfacecovering tunnel interface prefixes (utun0,tun1,ppp0,ipsec0) versus physical/local interfaces (en0,en1,eth0,wlan0,lo0), as well as edge cases forparse_default_route(missing interface line, empty output).src/load_guard/budget.rs: Added unit tests verifyingDurationExceedsCapandConcurrencyExceedsCapvalidation errors, plus tests forBudgetError::Displayformatting across all error variants.src/load_guard/counters.rs: Added unit tests verifyingInterfaceCounters::zero()initialization,usable_delta_fromacross equal/increasing deltas and backwards tx/rx byte/packet deltas, andparse_netstat_ibhandling of empty strings and malformed headers.src/load_guard/tcp_vs_udp.rs: Added unit tests verifyingachieved_mbps_delta()calculations when both protocols are usable, and validatedunusablehelper field assignments.src/load_guard/ap_identity.rs: Added unit tests forcomparewithNonebands and differing/identical labels, verified JSON serialization/deserialization roundtrip forApIdentityandApComparison, and added edge case tests for empty inputs tolabel_for_bssid.