Skip to content

Add unit tests for health module#1641

Merged
gaius-qi merged 4 commits intomainfrom
copilot/add-health-module-tests
Jan 29, 2026
Merged

Add unit tests for health module#1641
gaius-qi merged 4 commits intomainfrom
copilot/add-health-module-tests

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

Adds test coverage for dragonfly-client/health/mod.rs which previously had none.

Changes

  • test_health_new: Validates Health struct initialization with proper address binding
  • test_health_handler: Verifies health endpoint returns Ok response

Tests follow repository conventions - no inline comments, self-documenting through clear variable names:

#[test]
fn test_health_new() {
    let addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
    let shutdown = shutdown::Shutdown::new();
    let (shutdown_complete_tx, _shutdown_complete_rx) = mpsc::unbounded_channel();

    let health = Health::new(addr, shutdown, shutdown_complete_tx);

    assert_eq!(health.addr, addr);
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: gaius-qi <15955374+gaius-qi@users.noreply.github.com>
Copilot AI changed the title [WIP] Add unit tests for health module in dragonfly-client Add unit tests for health module Jan 29, 2026
Copilot AI requested a review from gaius-qi January 29, 2026 07:15
Co-authored-by: gaius-qi <15955374+gaius-qi@users.noreply.github.com>
@gaius-qi gaius-qi added the enhancement New feature or request label Jan 29, 2026
@gaius-qi gaius-qi marked this pull request as ready for review January 29, 2026 07:32
@gaius-qi gaius-qi enabled auto-merge (squash) January 29, 2026 07:32
Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link

@BraveY BraveY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gaius-qi gaius-qi merged commit abbb175 into main Jan 29, 2026
8 of 9 checks passed
@gaius-qi gaius-qi deleted the copilot/add-health-module-tests branch January 29, 2026 07:35
@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.83%. Comparing base (eaaee3b) to head (04c04eb).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1641      +/-   ##
==========================================
+ Coverage   43.71%   43.83%   +0.11%     
==========================================
  Files          75       75              
  Lines       20955    20967      +12     
==========================================
+ Hits         9161     9191      +30     
+ Misses      11794    11776      -18     
Files with missing lines Coverage Δ
dragonfly-client/src/health/mod.rs 56.09% <100.00%> (+56.09%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants