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

Closed
opened 2026-11-07 15:33:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2552
Author: @qiuzan2001
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: chief-serve/setup-tests-host


📝 Commits (1)

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

📊 Changes

3 files changed (+12 additions, -2 deletions)

View changed files

📝 tools/test_setup_amd.py (+1 -0)
📝 tools/test_setup_choices.py (+3 -0)
📝 tools/test_setup_engine_hash.py (+8 -2)

📄 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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2552 **Author:** [@qiuzan2001](https://github.com/qiuzan2001) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `chief-serve/setup-tests-host` --- ### 📝 Commits (1) - [`1e02629`](https://github.com/Niko1221/Strata/commit/1e026298b9678bd011e33d78147e801cd65f1989) tests: the setup tests no longer depend on this PC's network or /proc/cpuinfo (#1935) ### 📊 Changes **3 files changed** (+12 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `tools/test_setup_amd.py` (+1 -0) 📝 `tools/test_setup_choices.py` (+3 -0) 📝 `tools/test_setup_engine_hash.py` (+8 -2) </details> ### 📄 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:33:20 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4117
No description provided.