Skip to content

test: restore coverage for two paths the consolidation left untested - #4374

Merged
Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-c1-coverage-restore
Nov 20, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-c1-coverage-restore

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

A coverage check after the test consolidation (#4137) found five source lines that no test reached any more. This PR restores coverage for both paths with direct tests on real inputs:

  • apm outdated: when a marketplace alias now names a different catalog than the lock recorded, the row reports origin-conflict and never fetches; an unregistered alias falls back to the git check (src/apm_cli/commands/outdated.py).
  • Orphan check: a project with apm.yml but no apm_modules/, and an unparsable apm.yml next to apm_modules/, both report no orphans (src/apm_cli/commands/_helpers.py).

Owners: P-OWN marketplace alias origin (outdated) and the commands helper orphan scan.

Issue and approved scope

Issue: Refs #4082

Human scope-approval comment: the #4082 apm-scope:v1 record (duplicate consolidation; restoring coverage a consolidation wave dropped is part of its done-when).

Does this PR complete the issue, or what remains? It closes the coverage follow-up for #4137. A second consolidation train follows separately.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally: the 7 selected tests pass (pytest -k "TestCheckOrphanedPackages or TestCheckMarketplaceRefOriginCheck" on both files), and a coverage run confirms outdated.py lines 178, 187, 188 and _helpers.py lines 262, 272 are now covered.
  • All existing tests pass (CI)
  • Added tests for new functionality (if applicable)

Changelog

  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • N/A -- this PR does not change OpenAPM-observable behaviour.

Cover the outdated command's locked-origin conflict row and its
unregistered-alias fallback, and the orphan check's no-modules and
unparsable-manifest early returns, with direct tests on real inputs.

Co-authored-by: Copilot App <[email protected]>
@danielmeppiel Daniel Meppiel (danielmeppiel) added this to the 0.37.0 milestone Nov 20, 2026
Copilot AI balanced review requested due to automatic review settings November 20, 2026 15:18
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit d03ef84 into main Nov 20, 2026
20 of 25 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-c1-coverage-restore branch November 20, 2026 15:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block the added marketplace and orphan-detection test coverage.

No open issues 🎉

What changed in this PR

Restores coverage lost during test consolidation (#4137) for marketplace checks and orphan detection, without changing production behavior.

Changes:

  • Adds tests for marketplace alias origin conflicts, fetch suppression, and unregistered-alias fallback.
  • Adds orphan-check tests for a missing apm_modules/ directory and an unparsable manifest.
File Description
tests/​unit/​test_outdated_marketplace_detection.py Tests origin-conflict reporting without fetching and fallback signaling for unregistered aliases.
tests/​unit/​commands/​test_helpers_coverage.py Tests empty orphan results when modules are absent or the manifest cannot be parsed.

Review effort: Balanced

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.

2 participants