google / google/glazier

Python CI runs ubuntu-latest, where WINPE_* and SYS_* constants collapse to the same path

Open
#796 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.3k
Forks
96
Avg merge
3d 15h
Merged PRs (30d)
4

Description

## Steps to Reproduce

1. Note that `.github/workflows/python_tests.yml` runs on `ubuntu-latest`.
2. On Linux, evaluate `os.path.join('X:', os.sep, 'Windows', 'System32')`. The drive letter is discarded.
3. Run `testing/run_tests.py` on Windows and compare `drivers_test.test_driver_wim`.

## Expected Behavior

`WINPE_SYSTEM32` and `SYS_SYSTEM32` name different roots, so a test pinning the wrong one should fail.

## Current Behavior

They render identically on the CI platform:

| constant | Windows | ubuntu-latest |
|---|---|---|
| `WINPE_SYSTEM32` | `X:\Windows\System32` | `/Windows/System32` |
| `SYS_SYSTEM32` | `C:\Windows\System32` | `/Windows/System32` |

Any assertion pinning the wrong root passes there, so CI cannot tell the boot drive from the system drive.

`drivers_test.test_driver_wim` expects `WINPE_DISM`. `winpe.check_winpe()` is unmocked and returns False off WinPE, so the code builds `SYS_DISM`. On Linux both render `/Windows/System32/dism.exe` and it passes.

## Notes

Windows 11, Python 3.13.13.

`ntp.py:30` builds `BINARY` from `WINPE_SYSTEM32` while `ntp_test.py:52` asserts `SYS_SYSTEM32`, the same divergence. That one is currently unreachable on Windows: `ntp_test.py:36` calls `time.tzset()`, which does not exist on win32, so the test errors before the assertion runs. If the assertion is right, `SyncClockToNtp` invokes `X:\Windows\System32\cmd.exe`, which is not present on a booted system.

`go_tests.yml` already runs `windows-latest`, so a Python leg is precedented. It would be red until these are settled.

## Log/Screenshot

```
Expected: call('X:\Windows\System32\dism.exe', ...)
Actual: call('C:\Windows\System32\dism.exe', ...)
```

Contributor guide

Open the contributing guide

Research direction

Start with .github/workflows/python_tests.yml and testing/run_tests.py, then inspect drivers_test.test_driver_wim, winpe.check_winpe(), ntp.py:30, and ntp_test.py:36-52. Run the relevant tests on the existing Linux and Windows CI legs and compare the expected constants with platform behavior. Done means the tests no longer accept identical Linux paths for distinct Windows roots and the Python CI behavior is verified on the relevant platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, python
Domain
ci-cd, operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.