Pull requests / #472

#472 tests: test_prebuilt_hip_zip passes on Linux (EXE as on Windows)

closed · @homeofe · 0 コメント · GitHub で見る

Setup & installAMD / HIPWindowsLinux

本文

`tools.test_setup_amd` fails on Linux on `main` (0.1.34), in the new `WindowsDetection.test_prebuilt_hip_zip`:

```
AssertionError: None != PosixPath('/tmp/.../engine')
```

**Cause.** `get_prebuilt_hip` checks `(tmp / EXE).exists()` after unpacking the zip (`setup.py`, ~1309). The test publishes a zip that holds `strata.exe`, which is right, since the asset is the Windows HIP engine. On Linux, though, `setup.EXE` is `strata`, so the unpacked zip is refused and the function returns `None`.

**Fix (test only).** The test patches `setup.EXE` to `"strata.exe"`, as on Windows, alongside its other `mock.patch.object` calls. On Windows that's a no-op. `setup.py` is unchanged, because the function only ever handles the Windows zip.

**Result.** `python3 -m unittest tools.test_setup_amd`: 1 failure → OK on Linux (Ubuntu 24.04, Python 3.12.3). `tools.test_setup_choices`, `_pins` and `_risk` are still OK. This is the same kind of problem as #428 (`test_setup_golden` on Linux): tests written on Windows that depend on `EXE`.

関連リンク

インストール・モデル・リリースへの站内リンク。