Skip to content

refactor(tests): [#2238] split native tracker fixture - #2249

Merged
josecelano merged 16 commits into
torrust:developfrom
josecelano:2238-refactor-native-tracker-test-fixture
Sep 17, 2026
Merged

josecelano merged 16 commits into
torrust:developfrom
josecelano:2238-refactor-native-tracker-test-fixture

Conversation

@josecelano

Copy link
Copy Markdown
Member

Summary

  • split the 1,272-line native tracker executable fixture into a lifecycle root plus cohesive command, failed-start, health, and output modules
  • narrow the test-facing API and dead-code allowances to the actual lifecycle and configuration consumers while preserving child-process ownership, deadlines, diagnostics, permission restoration, and cleanup behavior
  • colocate fixture unit tests with their owners, repair live documentation paths, and fix the documented-Clippy-allow checker so deleted Rust files in a branch diff are skipped safely
  • complete the approved refactor plan, manual ownership/task-map verification, implementation retrospective, complexity audit, and independent acceptance review

Validation

  • cargo test --test lifecycle-signals --test cli-configuration (13 lifecycle and 18 configuration tests passed)
  • cargo test --test lifecycle-signals -- --nocapture (13 passed)
  • cargo test --test cli-configuration invalid_sources -- --nocapture (7 passed)
  • deleted-Rust-hunk regression test (1 passed)
  • focused cognitive-complexity Clippy check (passed)
  • TORRUST_GIT_HOOKS_LOG_DIR=.tmp ./contrib/dev-tools/git/hooks/pre-commit.sh (all 8 steps passed)
  • TORRUST_GIT_HOOKS_LOG_DIR=.tmp ./contrib/dev-tools/git/hooks/pre-push.sh (nightly format/check/docs and full stable test suite passed after final rebase)
  • independent Task Reviewer: REVIEW PASSED, no findings

Closes #2238

Copilot AI lite review requested due to automatic review settings September 17, 2026 12:05
@josecelano josecelano self-assigned this Sep 17, 2026
@codecov

codecov Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.49%. Comparing base (37c0bea) to head (01f5e88).

Files with missing lines Patch % Lines
.../dev-tools/checks/clippy-allow-reasons/src/main.rs 91.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2249      +/-   ##
===========================================
+ Coverage    85.48%   85.49%   +0.01%     
===========================================
  Files          353      353              
  Lines        31321    31333      +12     
  Branches     31321    31333      +12     
===========================================
+ Hits         26775    26789      +14     
+ Misses        4166     4165       -1     
+ Partials       380      379       -1     

☔ 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

Only minor documentation nits remain; validation passed and no blocking issues were identified.

Pull request overview

Refactors the native tracker test fixture into focused modules while preserving lifecycle, cleanup, diagnostics, and configuration-test behavior.

Changes:

  • Split fixture responsibilities across lifecycle, command, failed-start, health, and output modules.
  • Updated test consumers, API imports, colocated tests, and documentation paths.
  • Hardened deleted-Rust-file handling in the Clippy allow checker.

Final review comments:

  • docs/issues/closed/2138-document-testing-strategy/ISSUE.md:393 — [Minor][2238-DOC-003] (nit, 1 vote): update remaining current fixture links.
  • docs/issues/open/2238-refactor-native-tracker-test-fixture/ISSUE.md:42 — [Minor][2238-DOC-001] (nit, 3 votes): preserve the historical deleted-file path and wording.
  • docs/issues/open/2238-refactor-native-tracker-test-fixture/manual-verification-evidence.md:145 — [Minor][2238-DOC-002] (nit, 2 votes): correct recorded module line counts.
File summaries
File Summary
tests/lifecycle/signals.rs Updated native tracker fixture usage.
tests/configuration/cli_configuration/per_value_overrides.rs Updated narrowed fixture imports.
tests/configuration/cli_configuration/invalid_sources.rs Updated failed-start imports.
tests/configuration/cli_configuration/base_source_precedence.rs Updated fixture API imports.
tests/configuration/cli_configuration.rs Updated fixture module usage.
tests/common/native_tracker/output.rs Owns concurrent output capture.
tests/common/native_tracker/mod.rs Owns running lifecycle and cleanup.
tests/common/native_tracker/health.rs Owns health probing and parsing.
tests/common/native_tracker/failed_start.rs Owns failed-start lifecycle and diagnostics.
tests/common/native_tracker/command.rs Owns workspace and command construction.
tests/common/native_tracker.rs Replaced the monolithic fixture.
docs/testing.md Updated fixture documentation references.
docs/refactor-plans/open/2238-refactor-native-tracker-test-fixture.md Records the completed refactor plan and paths.
docs/issues/open/2238-refactor-native-tracker-test-fixture/manual-verification-evidence.md Records manual verification evidence.
docs/issues/open/2238-refactor-native-tracker-test-fixture/ISSUE.md Updates implementation status and evidence.
docs/issues/open/2238-refactor-native-tracker-test-fixture/implementation-retrospective.md Records implementation findings.
docs/issues/open/2238-refactor-native-tracker-test-fixture/agent-review-reports.md Records the acceptance review.
docs/issues/closed/2138-document-testing-strategy/ISSUE.md Updates fixture references.
docs/issues/closed/2132-add-sigterm-to-main/native-tracker-refactor-plan.md Updates fixture references.
docs/issues/closed/2132-add-sigterm-to-main/implementation-retrospective.md Updates fixture references.
docs/analysis/20260909-cli-config-path-test-isolation/README.md Updates fixture references.
contrib/dev-tools/checks/clippy-allow-reasons/src/main.rs Safely skips deleted Rust files.
Review details

Suppressed comments (1)

docs/issues/closed/2138-document-testing-strategy/ISSUE.md:393

  • [Minor][2238-DOC-003] This path move leaves other current references in the same document pointing at deleted locations: the semantic-links.related-artifacts entry at line 23 and the executable-boundary link at line 77 still use tests/lifecycle/native_tracker.rs. The reference section is being updated here, so update those navigational links too while retaining only genuinely historical path mentions.
- [Executable-boundary lifecycle test](../../../../tests/common/native_tracker/mod.rs)
  • Files reviewed: 22/22 changed files
  • Comments generated: 2
  • 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 force-pushed the 2238-refactor-native-tracker-test-fixture branch from b15daa7 to edf1a48 Compare September 17, 2026 14:51
@josecelano

Copy link
Copy Markdown
Member Author

Processed Copilot review PRR_kwDOGp2yqc8AAAABOBAAJA review-body finding:

  • 2238-DOC-003 — FIXED (review-finding:pr-2249-2238-doc-003). The closed testing-strategy issue now uses tests/common/native_tracker/mod.rs in both remaining live navigational references. Current-tree verification confirms three current-path occurrences, no tests/lifecycle/native_tracker.rs occurrence, the target file exists, and linter markdown passes. Resolution: fix(docs): [#2238] refresh fixture navigation links.

josecelano added a commit to josecelano/torrust-tracker that referenced this pull request Sep 17, 2026
@josecelano
josecelano force-pushed the 2238-refactor-native-tracker-test-fixture branch from 8d6ba4a to 01f5e88 Compare September 17, 2026 15:17
@josecelano

Copy link
Copy Markdown
Member Author

ACK 01f5e88

@josecelano
josecelano merged commit 26ccdfb into torrust:develop Sep 17, 2026
19 checks passed
josecelano added a commit that referenced this pull request Sep 17, 2026
f6a1390 chore(issues): archive closed issue #2238 specification (Jose Celano)

Pull request description:

  Archives the completed specification for issue #2238 after implementation PR #2249 merged and the GitHub issue closed as completed.

  - Moves the issue specification folder from `docs/issues/open/` to `docs/issues/closed/`
  - Moves the completed refactor plan from `docs/refactor-plans/open/` to `docs/refactor-plans/closed/`
  - Updates closed lifecycle metadata and workflow checkpoints
  - Repairs current issue-local links while preserving immutable historical review paths
  - `linter markdown` passed
  - `linter cspell` passed
  - Mandatory pre-commit gate passed all 8 steps
  - Mandatory pre-push gate passed all 4 steps

  Related to #2238

ACKs for top commit:
  josecelano:
    ACK f6a1390

Tree-SHA512: 0deee1b8bb58513378c0407cd37a91a292e67825447334f38ebba7ba13ebd8cf1f02880c473cc29f7c40e4feb3e0b31ec841d4631209881cee48fb2d4c62af88

This branch was previously deployed

1 inactive deployment
coverage — 01f5e88a Deployed Sep 17, 2026 by josecelano via Generate Coverage Report #2150
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.

Refactor native tracker test fixture

2 participants