Skip to content

test(integration): fix merge-queue failures from removed publish/doctor modules#1797

Merged
danielmeppiel merged 1 commit into
mainfrom
danielmeppiel/effective-engine
Jun 16, 2026
Merged

test(integration): fix merge-queue failures from removed publish/doctor modules#1797
danielmeppiel merged 1 commit into
mainfrom
danielmeppiel/effective-engine

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

TL;DR

The merge queue (the Integration Tests workflow runs on merge_group, not on individual PRs) was failing for every queued PR — surfaced most recently on #1789. The cause is a semantic merge conflict between two already-merged PRs, not anything in the dompurify bump. This PR repoints/removes the stale test references so the integration suite collects and passes again.

Problem (WHY)

Two PRs landed independently and only collided once merged together:

Because each PR passed its own checks, the breakage only appeared in the merge queue:

  1. tests/integration/test_marketplace_adapters_coverage.py — collection-time ModuleNotFoundError: No module named 'apm_cli.marketplace.pr_integration' (it also imported the removed marketplace.publisher). This failed all four shards.
  2. tests/integration/marketplace/test_doctor_integration.pyfrom apm_cli.commands.marketplace import doctor now resolves to the doctor module (run_doctor) instead of a click command, so CliRunner.invoke raised AttributeError: module ... has no attribute 'name' / KeyError: 'prog_name' across all 9 doctor tests.

Approach (WHAT)

  • doctor test: repoint the import to the surviving top-level click command apm_cli.commands.doctor.doctor, which is a thin wrapper around the same run_doctor the tests exercise — behavior preserved, one-line change.
  • coverage test: drop the imports of the removed pr_integration/publisher modules, their helper factories (_make_publish_plan, _make_target_result), and the pr_integration test section. The valuable client / audit / adapters / archive coverage in the same file is untouched. Also removed the now-unused Any and urlsplit imports.

Validation evidence

  • pytest tests/integration/test_marketplace_adapters_coverage.py tests/integration/marketplace/test_doctor_integration.py -> 114 passed
  • pytest tests/integration --collect-only -> 10284 collected, 0 errors (previously 1 collection error)
  • pytest tests/integration/marketplace tests/integration/test_marketplace_adapters_coverage.py -> 169 passed, 7 skipped
  • Lint (CI mirror): ruff check src/ tests/ and ruff format --check src/ tests/ both clean.

How to test

uv run --extra dev python -m pytest \
  tests/integration/test_marketplace_adapters_coverage.py \
  tests/integration/marketplace/test_doctor_integration.py -q

No production code changes — test-only fix.

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: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 16, 2026 07:42

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

Fixes integration-test merge-queue collection/runtime failures caused by stale references to marketplace modules that were removed in earlier merged PRs, by updating/removing the affected test imports and test sections.

Changes:

  • Remove marketplace.pr_integration / marketplace.publisher imports and the associated PR-integration test section from the marketplace adapters coverage integration test file.
  • Repoint the doctor integration tests to import the surviving top-level Click command (apm_cli.commands.doctor.doctor) so CliRunner.invoke receives a Click command again.
Show a summary per file
File Description
tests/integration/test_marketplace_adapters_coverage.py Drops removed-module imports and deletes the PR-integration coverage block so the integration suite collects cleanly.
tests/integration/marketplace/test_doctor_integration.py Updates the doctor command import to the top-level Click command implementation so tests invoke a valid command object.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines 4 to 5
All tests are hermetic - no live network calls are made; HTTP is mocked via
``unittest.mock.patch``. URL assertions use ``urllib.parse`` throughout.
@danielmeppiel danielmeppiel merged commit c0b87a6 into main Jun 16, 2026
21 checks passed
@danielmeppiel danielmeppiel deleted the danielmeppiel/effective-engine branch June 16, 2026 08:12
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