Skip to content

test(axum-http-server): cover private listed HTTP contracts - #2148

Merged
josecelano merged 1 commit into
torrust:developfrom
josecelano:2140-review-axum-http-server-integration-tests
Sep 6, 2026
Merged

josecelano merged 1 commit into
torrust:developfrom
josecelano:2140-review-axum-http-server-integration-tests

Conversation

@josecelano

Copy link
Copy Markdown
Member

Summary

Adds real-listener integration coverage for the private-and-listed HTTP tracker configuration and corrects the IPv6 external-IP scenario so it uses an IPv6 listener and loopback client.

  • Add six announce and scrape contracts for authentication, whitelist authorization, and scrape-stat visibility.
  • Use one file-local PrivateListedTracker scenario fixture so each test exposes only its causal state.
  • Record the integration-suite inventory, coverage evidence, mutation-testing assessment, test-design review, and verification results.

Verification

  • cargo test -p torrust-tracker-axum-http-server
  • cargo llvm-cov -p torrust-tracker-axum-http-server --all-features --json
  • cargo +nightly fmt --all -- --check
  • linter all
  • TORRUST_GIT_HOOKS_LOG_DIR=.tmp ./contrib/dev-tools/git/hooks/pre-commit.sh

Closes #2140

@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.08%. Comparing base (6f813ae) to head (54aea3e).
⚠️ Report is 68 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2148      +/-   ##
===========================================
+ Coverage    84.37%   85.08%   +0.70%     
===========================================
  Files          351      351              
  Lines        28336    29268     +932     
  Branches     28336    29268     +932     
===========================================
+ Hits         23908    24902     +994     
+ Misses        4027     3962      -65     
- Partials       401      404       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are limited to tests and supporting documentation, add clear contract coverage for an identified gap, and align an existing IPv6 scenario with its stated intent.

Pull request overview

This PR strengthens the packages/axum-http-server integration test suite by adding real-listener contract coverage for the combined private + listed (whitelisted) HTTP tracker configuration, and by correcting an existing “IPv6 external IP” scenario to actually use an IPv6 listener and client.

Changes:

  • Add six real-listener integration contracts covering announce/scrape behavior interactions for private+listed mode (auth precedence, whitelist enforcement, and scrape stat visibility rules).
  • Fix the “loopback IPv6 client uses external IP” scenario to bind an IPv6 listener and use an IPv6 loopback client, with an environment guard for IPv6 loopback support.
  • Add issue-tracking documentation capturing the test inventory/design review and coverage/mutation-testing evidence for #2140.
File summaries
File Description
packages/axum-http-server/tests/server/v1/contract/for_all_config_modes/receiving_an_announce_request.rs Corrects the IPv6 external-IP integration scenario to use an IPv6 listener and ::1 client with an IPv6-availability guard.
packages/axum-http-server/tests/server/v1/contract/configured_as_private_and_whitelisted.rs Replaces TODO placeholders with six real-listener contracts for combined private+listed announce/scrape behaviors using a focused scenario fixture.
docs/issues/open/2140-1347-review-axum-http-server-integration-tests/test-design-review.md Adds the integration-test design review writeup and file-by-file inventory backing the selected increments.
docs/issues/open/2140-1347-review-axum-http-server-integration-tests/ISSUE.md Updates the issue spec with links, completed task statuses, and acceptance/verification evidence.
docs/issues/open/2140-1347-review-axum-http-server-integration-tests/coverage-evidence.md Adds reproducible coverage evidence plus a bounded mutation-testing assessment writeup.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@josecelano
josecelano marked this pull request as ready for review September 6, 2026 08:09
@josecelano

Copy link
Copy Markdown
Member Author

ACK 54aea3e

@josecelano
josecelano merged commit 2054d49 into torrust:develop Sep 6, 2026
18 checks passed

This branch was previously deployed

1 inactive deployment
coverage — 54aea3e3 Deployed Sep 6, 2026 by josecelano via Generate Coverage Report #1928
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.

Overhaul Packages Testing: Review and improve axum-http-server integration tests

2 participants