Pull requests / #2552

#2552 tests: the setup tests no longer depend on this PC's network or /proc/cpuinfo (#1935)

closed · @qiuzan2001 · 0 commentaires · Sur GitHub

Setup & installAMD / HIPNVIDIA / CUDAWindowsLinux

Description

The test half of #1935: 8 tests in `tools/test_setup_*.py` passed or failed depending on the PC that runs them.
Test files only; `setup.py` is not changed.

**What it changes.**
- `tools/test_setup_engine_hash.py` (`WhatARefusalDoesToTheCaller`, 2 tests): `get_prebuilt()` first sends a real HEAD
  for the release asset. Offline, or on Linux (no release publishes `strata-linux-x64.zip`), it returned "compiling
  instead" before `download`, so the refusal path the tests are about never ran and they failed. The HEAD's
  `urlopen` is now a stand-in that answers (`release_found()`), next to the existing `download` / `engine_digest` ones.
- `tools/test_setup_choices.py` (`HipVision`, `CudaVision`, `HostCompilers`, 5 tests) and `tools/test_setup_amd.py`
  (`GpuLists.test_build_for_every_arch`): `build_engine(_hip)` read this PC's `/proc/cpuinfo`. On a host without a
  `flags` line it raised (the `cpu_info()` bug fixed in #2551), and on a CPU without AVX2 the build would get another
  floor. `setup.cpu_info` is now `("test CPU", True, False)` there.

**What it leaves alone.** Every other test, and what each of these tests checks.

**How it was checked.** On this PC (x86-64 with network) `tools/test_setup_engine_hash.py` failed 2 tests on
`upstream/main` and passes now (in 0.01 s instead of 1.5 s). With `/proc/cpuinfo` replaced by an aarch64 one (a
wrapper that patches `open`): `test_setup_choices.py` 5 errors and `test_setup_amd.py` 1 error on `main`, OK now. All
four files (`engine_hash`, `choices`, `amd`, `oldcpu`) pass on the normal host and with the aarch64 cpuinfo. Python
3.14, Ubuntu (Linux 7.0); not run on Windows or in a `python:3.12-slim` container.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Sur le site

Liens install, modèles, releases.