Skip to content

test(targets): use platform-absolute user-root paths in tests - #3815

Merged
Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-t3-p3-win-user-root-tests
Nov 18, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-t3-p3-win-user-root-tests

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fix-forward for a red main. After #3782 merged, the build-release push runs 44174245387 (28e7450) and 44174467822 (59925cd) failed on the Windows x86_64 unit tests:

FAILED tests/unit/adapters/test_hermes_client_adapter.py::TestHermesConfigPath::test_hermes_home_override
PathTraversalError: HERMES_HOME is set to a non-absolute path; ... HERMES_HOME must be an absolute path

The product behavior is correct. #3782 rejects relative harness user-root values (approved decision E1), and on Windows a POSIX literal such as /custom/hermes has no drive, so it is relative. The test was wrong: it hard-coded a POSIX-only absolute path.

Changes (tests only):

  • tests/unit/adapters/test_hermes_client_adapter.py::TestHermesConfigPath::test_hermes_home_override: builds HERMES_HOME from a temp directory.
  • I searched every test that sets COPILOT_HOME, CODEX_HOME, CLAUDE_CONFIG_DIR or HERMES_HOME for POSIX-literal values and fixed the other two the same way:
    • tests/unit/integration/test_scope_integration.py::TestClaudeScopeResolution::test_project_scope_ignores_env_var (CLAUDE_CONFIG_DIR)
    • tests/integration/test_canvas_integration.py::TestGlobalCanvasGuards::test_global_nondefault_copilot_home_refused (COPILOT_HOME)
      The remaining ~/... values are absolute after expanduser on every OS. All tests added by fix(targets): one owner for harness user roots; honor COPILOT_HOME (#3745) #3782 already build their paths from tmp_path.
  • All three tests are marked @pytest.mark.windows_compat, so the PR-time Windows Compatibility Gate runs them.

No CHANGELOG entry: this is a test-only change with no user-visible behavior.

Issue and approved scope

Issue: Refs #3745

Human scope-approval comment: #3745 (comment)

Does this PR complete the issue, or what remains? #3745 was completed by #3782. This PR only repairs the tests' Windows portability.

Type of change

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

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)
Command Result
uvx [email protected] check / format --check on src/ tests/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ scripts/windows_native_symlink_probe_entry.py passed
pytest -p no:xdist tests/unit/adapters/test_hermes_client_adapter.py tests/unit/integration/test_scope_integration.py tests/integration/test_canvas_integration.py (macOS) 91 passed
pytest -m windows_compat --co on the same files selects the 3 fixed tests
Windows Compatibility Gate (PR CI) passed: CI run 44178837939, job 134377385112 (https://github.com/microsoft/apm/actions/runs/44178837939/job/134377385112); all 3 fixed tests PASSED on Windows; 1037 passed, 14 skipped

Fails before: the release runs above show the Windows failure at 28e7450 and 59925cd.

Spec conformance (OpenAPM v0.1)

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated
    (new/changed <a id="req-XXX"></a> anchor + prose + Appendix C
    row).
  • Manifest edit: docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml
    updated.
  • Test edit: a @pytest.mark.req("req-XXX") test under
    tests/spec_conformance/ added or extended.
  • CONFORMANCE.{md,json} regenerated via
    uv run --extra dev python -m tests.spec_conformance.gen_statement
    and committed.
  • N/A -- this PR does not change OpenAPM-observable behaviour.

#3782 rejects relative harness user-root values (decision E1). On Windows a
POSIX literal such as "/custom/hermes" has no drive and is relative, so
TestHermesConfigPath::test_hermes_home_override failed on the release
Windows unit run. Build the values from a temp directory instead, fix the
two other POSIX literals set for CLAUDE_CONFIG_DIR and COPILOT_HOME, and
mark the three tests windows_compat so the PR-time Windows gate runs them.

Refs #3745

Co-authored-by: Copilot App <[email protected]>

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 are recorded for the Windows portability updates to the three user-root tests.

No open issues 🎉

What changed in this PR

Repairs Windows portability in three user-root tests following #3782, without changing production behavior.

Changes:

  • Replaces hard-coded POSIX paths with temporary-directory-based absolute paths.
  • Adds windows_compat markers to the three affected tests.
File Description
tests/​unit/​integration/​test_scope_integration.py Uses a portable CLAUDE_CONFIG_DIR path when checking project-scope isolation.
tests/​unit/​adapters/​test_hermes_client_adapter.py Uses a temporary directory for the HERMES_HOME override test.
tests/​integration/​test_canvas_integration.py Uses a portable COPILOT_HOME path in the global canvas refusal test.

Review effort: Balanced

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 71aa678 into main Nov 18, 2026
25 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-t3-p3-win-user-root-tests branch November 18, 2026 02:51
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 18, 2026
Resolve tests/unit/adapters/test_hermes_client_adapter.py by keeping
#3815's tmp_path-based, windows_compat HERMES_HOME override test; the
#3749 Hermes tests keep their tmp_path fixture and windows_compat marks.

Co-authored-by: Parth-Vasave <[email protected]>
Co-authored-by: Copilot App <[email protected]>
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