Skip to content

test(deps): keep git lookup env in GitLab routing tests - #3828

Merged
Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
fix/gitlab-routing-test-keeps-path
Nov 18, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
fix/gitlab-routing-test-keeps-path

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

Test-only fix for a Windows unit failure that breaks main's build-release (run 44233799606 on e217a53, Windows x86_64):

  • test_type_gitlab_routes_untrusted_bespoke_host_without_private_token
  • test_type_gitlab_routes_trusted_bespoke_host_with_private_token

Both fail with FileNotFoundError: git executable not found on trusted PATH directories.

The helper clears os.environ with patch.dict(..., clear=True). Since #3790, the GitLab REST fallback builds the native git credential env and reads git config through get_git_executable(). On Windows, with PATH cleared, git is found only if an earlier test on the same xdist worker has already cached it, so the result depends on test order. That makes it a risk for the v0.36.1 pre-tag gate. The fix keeps PATH, SYSTEMROOT and PATHEXT in the cleared env and marks the module windows_compat, so the PR-time Windows Compatibility Gate runs it. Product code is unchanged.

Issue and approved scope

Issue: Refs #3790 (milestone 0.36.1, which 0.36.1 release PR #3827 depends on)

Human scope-approval comment: Part of the 0.36.1 release Daniel Meppiel (@danielmeppiel) authorized on 2026-11-17. This is a test-only fix for a red main.

Does this PR complete the issue, or what remains? It removes a test-order-dependent Windows failure. Nothing else remains.

Type of change

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

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

Local test runs were skipped (shared machine). uvx [email protected] check and ruff format --check on the changed file both pass. The Windows Compatibility Gate on this PR runs the module on win32.

Spec conformance (OpenAPM v0.1)

  • N/A -- this PR does not change OpenAPM-observable behaviour.

The GitLab routing tests clear os.environ, but since #3790 the REST fallback reads git config through get_git_executable(). On Windows, with PATH cleared, git cannot be found unless an earlier test on the same xdist worker already cached it, so the tests fail depending on test order (build-release run 44233799606 on e217a53). Keep PATH, SYSTEMROOT and PATHEXT in the cleared env, and mark the module windows_compat so the PR-time Windows gate runs it.

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 identified for the test-only changes preserving Windows Git discovery and enabling compatibility-gate coverage.

No open issues 🎉

What changed in this PR

This test-only PR addresses order-dependent Windows failures in GitLab routing tests ahead of the v0.36.1 release gate. Product code is unchanged.

Changes:

  • Preserve PATH, SYSTEMROOT, and PATHEXT when clearing the test environment so native Git remains discoverable.
  • Mark the module windows_compat to include it in the PR-time Windows Compatibility Gate.
File Description
tests/​unit/​deps/​test_github_downloader_gitlab_routing.py Preserves Git lookup environment variables and enables Windows gate coverage.

Review effort: Balanced

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 2be1328 into main Nov 18, 2026
24 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the fix/gitlab-routing-test-keeps-path branch November 18, 2026 04:23
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