test(integration): fix merge-queue failures from removed publish/doctor modules#1797
Merged
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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.publisherimports 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) soCliRunner.invokereceives 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
The merge queue (the
Integration Testsworkflow runs onmerge_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:
apm marketplace publishandmarketplace doctoralias (#1134) #1766 removedapm marketplace publishand themarketplace doctoralias, deletingsrc/apm_cli/marketplace/publisher.py,src/apm_cli/marketplace/pr_integration.py, and thedoctorclick command re-export from the marketplace package.tests/integration/test_marketplace_adapters_coverage.py, written against amainthat still had those modules.Because each PR passed its own checks, the breakage only appeared in the merge queue:
tests/integration/test_marketplace_adapters_coverage.py— collection-timeModuleNotFoundError: No module named 'apm_cli.marketplace.pr_integration'(it also imported the removedmarketplace.publisher). This failed all four shards.tests/integration/marketplace/test_doctor_integration.py—from apm_cli.commands.marketplace import doctornow resolves to the doctor module (run_doctor) instead of a click command, soCliRunner.invokeraisedAttributeError: module ... has no attribute 'name'/KeyError: 'prog_name'across all 9 doctor tests.Approach (WHAT)
apm_cli.commands.doctor.doctor, which is a thin wrapper around the samerun_doctorthe tests exercise — behavior preserved, one-line change.pr_integration/publishermodules, their helper factories (_make_publish_plan,_make_target_result), and thepr_integrationtest section. The valuableclient/audit/ adapters /archivecoverage in the same file is untouched. Also removed the now-unusedAnyandurlsplitimports.Validation evidence
pytest tests/integration/test_marketplace_adapters_coverage.py tests/integration/marketplace/test_doctor_integration.py-> 114 passedpytest 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 skippedruff check src/ tests/andruff format --check src/ tests/both clean.How to test
No production code changes — test-only fix.