Skip to content

test: raise integration coverage to 75%#1788

Merged
danielmeppiel merged 7 commits into
mainfrom
sergio-sisternes-epam/test-integration-coverage-75
Jun 16, 2026
Merged

test: raise integration coverage to 75%#1788
danielmeppiel merged 7 commits into
mainfrom
sergio-sisternes-epam/test-integration-coverage-75

Conversation

@sergio-sisternes-epam

Copy link
Copy Markdown
Collaborator

Summary

Raises integration test coverage from 69.09% to 75.67%, unblocking the merge queue which was gated at 70% (now targeting 75%).

Changes

Adds 1116 hermetic integration tests across 6 new test files:

File Tests Modules Covered
test_deps_registry_coverage.py 112 registry client/resolver/auth/extractor/outdated, revision pins
test_commands_config_coverage.py 177 config get/set/unset, update, self-update, publish
test_marketplace_adapters_coverage.py 114 marketplace client/audit/PR integration, adapters, archive
test_integration_runtime_coverage.py 179 kiro hooks, LSP integrator, copilot app WS, runtimes
test_wave2_commands_coverage.py 111 cache/runtime/policy/run commands, watcher, MCP registry
test_wave2_adapters_coverage.py 423 adapter base/claude/gemini, LSP models, migration, packer

Key improvements by module

Module Before After
deps/registry/outdated.py 0% 72%
integration/kiro_hook_integrator.py 0% 85%
deps/registry/auth.py 22% 93%
deps/registry/client.py 21% 88%
deps/registry/resolver.py 18% 85%
commands/config.py 32% 97%
commands/publish.py 13% 95%
integration/copilot_app_ws.py 24% 87%
runtime/copilot_runtime.py 35% 93%
models/dependency/lsp.py 17% 95%

Design principles

  • Hermetic: All tests mock network/subprocess -- zero live I/O
  • Marker-driven: No pytestmark needed (hermetic tests skip no gates)
  • URL assertions: All use urllib.parse (never substring matching)
  • No source changes: Pure test additions -- safe to merge independently

Add 1116 hermetic integration tests across 6 new test files targeting
modules that were dragging overall coverage below the CI gate:

- test_deps_registry_coverage.py (112 tests): registry client, resolver,
  auth, extractor, outdated, revision pins
- test_commands_config_coverage.py (177 tests): config get/set/unset,
  update, self-update, publish commands
- test_marketplace_adapters_coverage.py (114 tests): marketplace client,
  audit, PR integration, adapters (codex/kiro/hermes), archive utils
- test_integration_runtime_coverage.py (179 tests): kiro hook integrator,
  LSP integrator, copilot app WS, instruction integrator, runtime manager
- test_wave2_commands_coverage.py (111 tests): cache, runtime, policy, run
  commands, compile watcher, MCP registry, insecure policy, shared clone
- test_wave2_adapters_coverage.py (423 tests): adapter base/claude/gemini,
  LSP models, marketplace migration/version-check, bundle packer, TUI,
  HTTP cache, reflink utils

Integration coverage: 69.09% -> 75.67%

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 15, 2026 22:36
Comment thread tests/integration/test_wave2_commands_coverage.py Fixed
Comment thread tests/integration/test_wave2_commands_coverage.py Fixed
Comment thread tests/integration/test_wave2_commands_coverage.py Fixed
Comment thread tests/integration/test_wave2_commands_coverage.py Fixed

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.

Pull request overview

Adds large hermetic integration-test suites intended to raise integration coverage without touching runtime code, primarily by exercising CLI commands and marketplace/registry helper logic via mocks.

Changes:

  • Adds broad integration coverage for apm cache, apm runtime, apm policy status, apm run, apm update, watcher debounce logic, and several deps/install helpers.
  • Adds coverage for marketplace client/audit/PR-integration and adapter config I/O behavior.
  • Adds coverage for registry auth/client/resolver/outdated/extractor and revision-pin helpers.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 14 comments.

File Description
tests/integration/test_wave2_commands_coverage.py New hermetic integration tests for multiple CLI command paths + watcher + deps/install helpers.
tests/integration/test_marketplace_adapters_coverage.py New hermetic integration tests for marketplace client/audit/PR integration, adapters, and archive utilities.
tests/integration/test_deps_registry_coverage.py New hermetic integration tests for registry auth/client/resolver/outdated/extractor and revision-pin update helpers.

Comment thread tests/integration/test_wave2_commands_coverage.py Outdated
Comment thread tests/integration/test_wave2_commands_coverage.py Outdated
Comment thread tests/integration/test_wave2_commands_coverage.py Outdated
Comment thread tests/integration/test_wave2_commands_coverage.py Outdated
Comment thread tests/integration/test_wave2_commands_coverage.py
Comment thread tests/integration/test_deps_registry_coverage.py Outdated
Comment thread tests/integration/test_deps_registry_coverage.py
Comment thread tests/integration/test_deps_registry_coverage.py
Comment thread tests/integration/test_deps_registry_coverage.py
Comment thread tests/integration/test_deps_registry_coverage.py
Sergio Sisternes and others added 6 commits June 16, 2026 00:50
- Replace non-ASCII arrows and section symbols with ASCII equivalents
- Rewrite URL substring assertions to use urllib.parse hostname equality
- Fix test exit code assertions per copilot-reviewer feedback
- Use any(h == x for h in result) instead of 'x in result' for host lists

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CI ruff version treats inline section comments as import-block
separators, causing I001 isort violation. Consolidate all imports
into a single sorted block.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CI lint fails with I001 because ruff cannot detect apm_cli as
first-party on the merge commit (package not installed editable).
Explicit known-first-party config makes detection deterministic.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rewrite URL assertions in test_commands_config_coverage.py and
test_wave2_adapters_coverage.py to use urllib.parse component
equality instead of substring matching.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@danielmeppiel danielmeppiel merged commit 8da5820 into main Jun 16, 2026
13 checks passed
@danielmeppiel danielmeppiel deleted the sergio-sisternes-epam/test-integration-coverage-75 branch June 16, 2026 04:19
danielmeppiel added a commit that referenced this pull request Jun 16, 2026
The merge queue surfaced two integration-test failures caused by semantic
merge conflicts between #1766 (removed marketplace publish/pr_integration
and the marketplace doctor alias) and #1788 (added a coverage test).

- test_doctor_integration.py imported the doctor *module*
  (apm_cli.commands.marketplace.doctor) instead of the click command,
  which no longer exists as an alias after #1766. Point it at the
  top-level command apm_cli.commands.doctor.doctor, which wraps run_doctor.
- test_marketplace_adapters_coverage.py imported the removed
  marketplace.pr_integration and marketplace.publisher modules (a
  collection-time ImportError). Drop those imports, their helper
  factories, and the pr_integration test section; the remaining adapters/
  audit/client/archive coverage is unaffected.

Co-authored-by: danielmeppiel <danielmeppiel@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

4 participants