Repository navigation
fix(tests): restore arm64 integration lanes for 0.36.0 - #3766
Conversation
Gate run 44090072790 (main e9860ee) failed 27 Linux arm64 integration tests (19 also on macOS arm64), introduced by PRs that landed after the previous gate. PR CI never runs this corpus. Product regression, fixed: - On case-sensitive file systems a stale apm_modules/Test/C beside apm_modules/test/e made every repeat install fail ("Found multiple package directories"), and switching the declared casing failed with a false casing collision. Materialization now treats only two complete paths for one package as a collision and relocates into an existing case-variant owner directory (Refs #3698). Stale tests, updated to intentional behaviour changes: - #3672 (Refs #3649): stale-file removal needs a recorded hash (#3663); runtime-scoped MCP cleanup without marker dir (#3664); audit replays the install image (#3667); --frozen fails closed on edited skills (#3654); unverifiable marketplace ref is an error (#3670); architecture owner/semantic mutation matrix and audit.py re-anchor (#3659). - #3716 (Refs #3649): unpack writes only under managed integration dirs; registry token via headers_for(); raw-file fetch passes allow_netrc. - #3709: case-only user-file collisions branch on the actual file system (#3679, #3684); conflicted-lockfile path survives rich 80-col wrapping (#3695); a package and its own subdirectory package cannot both be declared (#3699). apm-spec-waiver: restores pre-existing install behaviour on case-sensitive file systems; no OpenAPM-observable change Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Case-normalization migration leaves empty source directories that later cause root dependency lookup to fail with “Found multiple package directories,” requiring rollback-safe pruning and a regression test.
1 open issue
What changed in this PR
This PR targets the remaining Linux and macOS arm64 integration failures for 0.36.0, following #3723. It fixes package-directory casing migration and updates stale tests to match behavior introduced by recent regression fixes and security hardening.
Changes:
- Allow distinct packages under case-variant owner directories and add regression coverage.
- Update lifecycle fixtures and assertions for cleanup, frozen installs, bundles, and package collisions.
- Repair credential-handling mocks, ref-resolution mocks, and architecture mutation checks.
| File | Description |
|---|---|
tests/unit/models/test_dependency_materialization.py |
Covers packages sharing case-variant owner directories. |
tests/integration/test_wave6_integrators_coverage.py |
Supplies recorded hashes for hook cleanup. |
tests/integration/test_wave4_pure_logic_coverage.py |
Uses managed unpack destinations and verifies deployed content. |
tests/integration/test_user_authored_name_collision_lifecycle.py |
Adapts collision assertions to filesystem case sensitivity. |
tests/integration/test_skill_materialization_receipt_lifecycle.py |
Expects frozen installs to reject edited deployed skills. |
tests/integration/test_plugin_e2e.py |
Tests nested-package rejection and independent sequential installs. |
tests/integration/test_mcp_integrator_characterisation.py |
Distinguishes runtime-scoped cleanup from broadcast cleanup. |
tests/integration/test_integrators_hooks_phase3c.py |
Adds hash evidence to managed-hook removal. |
tests/integration/test_integrators_hooks_execution.py |
Adds hash evidence to managed-hook removal. |
tests/integration/test_install_conflicted_lockfile_e2e.py |
Makes path assertions resilient to terminal wrapping. |
tests/integration/test_gitlab_install_e2e.py |
Updates the HTTP stub and checks netrc suppression. |
tests/integration/test_deps_models_validation.py |
Verifies audit replays the materialized local package. |
tests/integration/test_coverage_phase4.py |
Mocks remote refs and verifies the resolved commit. |
tests/integration/test_artifactory_install_e2e.py |
Uses real registry credential scoping in redirect coverage. |
tests/integration/test_architecture_semantic_rule_mutations.py |
Re-anchors audit mutation and removes the moved source-parsing case. |
tests/integration/test_architecture_owner_rule_mutations.py |
Adds packed-source parsing guard coverage. |
src/apm_cli/models/dependency/materialization.py |
Checks complete package paths and relocates across case-variant parents. |
Review effort: Balanced
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Python Architect | 0 | 1 | 0 | Relocation is semantically safe, rollback stays correct, and no guard is weakened. Empty owner directories should be cleaned up. |
| Test Coverage Expert | 0 | 1 | 0 | No protective test was weakened, and the unit test fails without the fix. No lifecycle test covers owner directories that differ only in case. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 2 follow-ups
- [Test Coverage Expert] Add a lifecycle test for owner directories that differ only in case on a case-sensitive file system ([FEATURE] Prune empty case-variant owner dirs after relocation; lifecycle test for case-variant owners #3770). -- It would pin the behavior of this code path, which writes durable state, before materialization is refactored again.
- [Python Architect] Remove empty owner directories after a cross-parent relocation ([FEATURE] Prune empty case-variant owner dirs after relocation; lifecycle test for case-variant owners #3770). --
_remove_empty_parentscurrently runs only on rollback.
Recommendation
Ship now to unblock the v0.36.0 tag. The fix is correct and unit-tested, and the test updates follow from changes already merged. #3770 tracks the follow-ups.
Full per-persona findings
Python Architect
- [recommended] After a package moves to a different parent directory, the old, now-empty owner directory is never removed. At
src/apm_cli/models/dependency/materialization.py:420.
When the source and target parents differ, the original owner directory (for exampleTest/) is left empty._remove_empty_parentsalready exists but runs only on rollback. Nothing behaves incorrectly today, but these directories accumulate.
Test Coverage Expert
- [recommended] The case-variant owner fix has a unit test but no lifecycle test. At
tests/unit/models/test_dependency_materialization.py.
This path writes durable state, and the unit test fails without the fix. What is missing is an install-update-uninstall test with two distinct packages under owner directories that differ only in case.
Proof (missing at):tests/integration/test_case_insensitive_parent_identity_lifecycle.py
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Generated by autopilot-pr-review-worker. This comment is AI-generated and may contain errors.
…ation Moving Test/C/packages/a beside test/c/packages/b on a case-sensitive file system left an empty Test/C tree that a later root dependency test/c counted as a second package directory. relocate_path now removes emptied source ancestors below apm_modules; rollback already recreates them via source.parent.mkdir(parents=True). apm-spec-waiver: restores pre-existing install behaviour on case-sensitive file systems; no OpenAPM-observable change Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…#3787) CaseSensitiveMaterializationReader.samefile compared Path objects. On Windows, WindowsPath equality is case-insensitive, so the fake reported apm_modules/Test and apm_modules/test as the same directory and the #3766 regression test recorded an extra owner rename (push run 44116362481, Windows x86_64). Compare .parts, which is case-sensitive on every platform, matching the case-sensitive file system the fake models. The product reader uses os.path.samefile and is unaffected. Mark the test windows_compat so the PR-time Windows gate runs it. Refs #3698 Co-authored-by: danielmeppiel <danielmeppiel@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Description
Gate run 44090072790 on main
e9860ee169, which includes #3723, turned Windows, macOS x86_64 and both Linux Build & Test lanes green. Integration Tests on Linux arm64 still failed 27 tests. macOS arm64 failed 19 of the same tests and no others. The tests broke because of PRs that landed after the previous gate (#3672, #3709, #3716). PR CI never runs this full integration corpus. 18 failures reproduced locally; 9 failed only on Linux (case-sensitive file system, 80-column wrapping, network).Product regression (fixed in
src/)test_case_insensitive_parent_identity_lifecycle.py::test_mixed_case_parent_records_canonical_parent_identity(Linux only)apm_modules/Test/Cnext toapm_modules/test/emade every repeat install fail with "Found multiple package directories". Switching the declared casing then failed with a false "Package directory casing collides".models/dependency/materialization.py: only two complete paths for the same package count as a collision. Relocation moves the package into an existing owner directory that differs only in case. A real duplicate at the package path still fails. New unit regression test intests/unit/models/test_dependency_materialization.py, which fails without the fix. Refs #3698.Stale tests (behavior changed on purpose; updated)
test_removes_managed_hook_json(x2),test_removes_tracked_hook_filescompute_deployed_hashes(...)and still assert removal.test_mcp_integrator_characterisation.py::TestRemoveStale(x2)test_deps_models_validation.pylocal depapm_modules/, and the fixture now includes anapm.yml.test_skill_materialization_receipt_lifecycle.pyfrozen cases (x2)--frozenexits 1 on an edited skill. The tests still assert the edit and the receipt are kept.test_coverage_phase4.pymarketplace settest_architecture_semantic_rule_mutations.py(x4)test_wave4_pure_logic_coverage.py::TestUnpackBundle(x3)unpackwrites only under managed integration directories, so the fixtures now live under.github/prompts/.test_artifactory_install_e2e.pyredirectRegistryConfig.headers_for(). Still proves the token is not sent cross-host and.netrcis not used.test_gitlab_install_e2e.pyallow_netrc. The test asserts token-bearing fetches passallow_netrc=False.test_user_authored_name_collision_lifecycle.py(Linux only)test_install_conflicted_lockfile_e2e.py(x6, Linux only)test_plugin_e2e.pysequential install (network)No CHANGELOG entry, because these are regressions in the unreleased cycle (per the release captain).
Issue and approved scope
Issue: Refs #3649. Also refs #3698, #3663, #3664, #3667, #3654, #3670, #3659, #3679, #3684, #3695 and #3699, the issues behind each change.
Human scope-approval comment: commissioned by the 0.36.0 coordinator as a release-blocking repair of the tag-gate lanes. Each change stays within the approved scope of the PR that broke it. Admin merge is coordinated with the release captain.
What remains: re-dispatch
manual-build-releaseafter merge and repeat until it is green, then the captain tags v0.36.0.Type of change
Testing
On macOS arm64 with
APM_E2E_TESTS=1 APM_BINARY_PATH=.venv/bin/apm -p no:xdist -m "not live":test_architecture_owner_rule_mutations.py(the full module),test_local_shared_root_skill_cleanup.pyandtests/unit/models/test_dependency_materialization.py: 1769 passed, 12 skipped in a clean run. On unmodified main, 18 of the 27 failures reproduced.--basetemp(wrapping); both pass after the fix.test_plugin_e2ewas run with a token (not skipped): passed.ruff checkandformat --check(0.15.12), pylint R0801,lint-auth-signals.shand the architecture-boundaries lint all pass. ASCII-only and file-length guards pass.apm_modules/Test/) remains. Prune,deps listand audit all ignore it.Spec conformance (OpenAPM v0.1)
docs/src/content/docs/specs/openapm-v0.1.mdupdated(new/changed
<a id="req-XXX"></a>anchor + prose + Appendix Crow).
docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.ymlupdated.
@pytest.mark.req("req-XXX")test undertests/spec_conformance/added or extended.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.