Skip to content

Enhance GitHub Actions CI test coverage workflow and expand load_guard unit tests - #7

Merged
aghassemlouei merged 2 commits into
mainfrom
feature/github-actions-test-coverage
Aug 4, 2026
Merged

aghassemlouei merged 2 commits into
mainfrom
feature/github-actions-test-coverage

Conversation

@aghassemlouei

Copy link
Copy Markdown
Member

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 core load_guard modules.

1. GitHub Actions CI Enhancements (.github/workflows/test.yml)

  • Expanded Branch Triggers: Updated push and pull_request triggers so CI automatically runs on main as well as feature, fix, and doc branches ('feature/**', 'feat/**', 'fix/**', 'docs/**'), ensuring automated test coverage validation on all changes going into main.
  • Documentation Tests: Added cargo test --workspace --doc --verbose to the test job so doc tests are executed in CI alongside unit and integration tests.
  • Workspace-Wide Coverage: Added the --workspace flag to cargo llvm-cov to 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 for is_tunnel_interface covering tunnel interface prefixes (utun0, tun1, ppp0, ipsec0) versus physical/local interfaces (en0, en1, eth0, wlan0, lo0), as well as edge cases for parse_default_route (missing interface line, empty output).
  • src/load_guard/budget.rs: Added unit tests verifying DurationExceedsCap and ConcurrencyExceedsCap validation errors, plus tests for BudgetError::Display formatting across all error variants.
  • src/load_guard/counters.rs: Added unit tests verifying InterfaceCounters::zero() initialization, usable_delta_from across equal/increasing deltas and backwards tx/rx byte/packet deltas, and parse_netstat_ib handling of empty strings and malformed headers.
  • src/load_guard/tcp_vs_udp.rs: Added unit tests verifying achieved_mbps_delta() calculations when both protocols are usable, and validated unusable helper field assignments.
  • src/load_guard/ap_identity.rs: Added unit tests for compare with None bands and differing/identical labels, verified JSON serialization/deserialization roundtrip for ApIdentity and ApComparison, and added edge case tests for empty inputs to label_for_bssid.

@aghassemlouei
aghassemlouei merged commit f13168a into main Aug 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant