[PR #4138] [Other] run the test suites on a Mac: name the PC each fake engine package is built for #4916

Open
opened 2026-11-07 16:31:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4138
Author: @sergrefraction
Created: 10/25/2026
Status: 🔄 Open

Base: main ← Head: tests-macos-fixes


📝 Commits (3)

  • ed75608 [Tests] run the setup and host suites on a Mac
  • 19c215d [Tests] name the PC the fake engine packages are built for
  • 3428909 [Tests] ask the product where its own settings file is

📊 Changes

15 files changed (+238 additions, -109 deletions)

View changed files

📝 apps/host/tests/chat-files.test.mjs (+2 -2)
📝 apps/host/tests/helpers/native-fixture.mjs (+2 -2)
📝 apps/host/tests/packaged-control.test.mjs (+8 -6)
📝 tests/terminal/test_archive_gaps.py (+4 -4)
📝 tests/terminal/test_component_start.py (+26 -15)
📝 tests/terminal/test_discovery.py (+24 -3)
📝 tests/terminal/test_engine_component.py (+57 -32)
📝 tests/terminal/test_engine_manifest.py (+13 -6)
📝 tests/terminal/test_shared_models_folder.py (+1 -1)
📝 tests/terminal/test_updater.py (+24 -19)
📝 tests/terminal/update_fixture.py (+49 -8)
📝 tools/test_setup_choices.py (+3 -0)
📝 tools/test_setup_golden.py (+9 -1)
📝 tools/test_setup_unsloth.py (+7 -4)
📝 tools/test_setup_update.py (+9 -6)

📄 Description

Problem and resulting behaviour

Every test in tests/terminal, tools/test_setup_*.py and apps/host/tests that builds a throwaway engine package failed on Apple Silicon, and 105 of the Terminal tests failed in total. The code under test is fine: the tests build a CUDA or HIP package and then ask the resolver to use it here, and the resolver drops a package whose platform this machine does not take before the rule the test is about is reached. A Mac takes Metal, and the tests never said which PC they were talking about.

After this change the same tests pass on a Mac, and on Windows and Linux they name this machine, so those runs are unchanged by construction.

Approach

  • tests/terminal/update_fixture.py: the shared package builder names the engine family and the folder tag of the machine running the test (metal / apple-gpu on a Mac, cuda / cuda13 elsewhere). Cases that are about CUDA code for another card name a CUDA PC themselves.
  • tests/terminal/test_engine_component.py, test_engine_manifest.py, test_archive_gaps.py: one PC constant per file. Packages are built for it, resolve is asked about it, and where the production code asks this machine which GPU family it takes, the test points that probe at the PC it is speaking about (per test, with addCleanup, never at import time).
  • tests/terminal/test_updater.py: each case reads its own family and folder tag instead of assuming cuda; the runtime-library check accepts the Metal library as well.
  • tests/terminal/test_component_start.py: the stub engine is one this machine takes, and carries a picture reader on a Mac, where packaging/package_engine.py refuses a macOS package without one (#3697).
  • tools/test_setup_*.py: setup.py hands a Mac run to metal/setup_mac.py before it reads its arguments (setup.py:8418), so every harness that drove setup.main() through the CUDA/Windows path got exit 2 and an empty log. The harness now patches sys.platform for those runs, only when it is a Mac. The golden baseline stored the vision file as strata-vision.exe; on a Mac and on Linux the name has no .exe, so all 48 comparisons differed — the baseline and the new run now go through the same name rule. test_setup_choices also ran a real pip install rocm[...], which broke the rule that setup tests run without a GPU or downloads.
  • apps/host/tests/*: on macOS /var is a link to /private/var and the host resolves it, so three tests that compared a temp path as written now compare the resolved path.

No production file is touched: only test files and test fixtures.

Validation

Measured on this machine (Apple M2 Max, macOS 26.6.2, Python 3.15), python -m pytest tests/terminal:

  • Before: 105 failed, 1556 passed, 55 skipped.
  • After the files in this pull request: 56 failed, 1603 passed, 55 skipped. The remaining failures are a different class (data-folder discovery preferring ~/Documents, process handling, the launch warnings) and are not addressed here.
  • The five files changed here, run together: test_updater.py 19 failed → 40 passed; test_engine_component.py 18 → 39 passed and 1 skipped; test_engine_manifest.py 8 → 23 passed; test_component_start.py 6 → 8 passed; test_archive_gaps.py 1 → 0. Together: 120 passed, 2 skipped, 0 failed.
  • The eleven files that build packages through update_fixture.py: 158 passed, 12 skipped, 0 failed.
  • python tools/test_setup_<name>.py (the setup suite): 49 of 49 pass.
  • npm test in apps/host: passes on this Mac.

Not run: Windows and Linux. The changes are no-ops there by construction (the PC named is this machine), but they have not been executed on either. No GPU was used and nothing was downloaded.

Scope

No production behaviour, no default and no file a user runs is changed, so no scope-agreement issue was opened. If you would rather have one first, say so and this can wait behind it.

Limits

  • The 55 skips are unchanged and are what they were before: 38 are Windows-only (ACL, NTFS, taskkill, long paths, the installer), 10 are Docker images built for other platforms, and the rest need a GPU, a second card, a real installer or STRATA_VISION_GGUF_TEST.
  • The Metal path is exercised only through fake packages: these tests never start a real engine, so they prove the resolver and the packager rules, not the Metal build itself.

🔄 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/4138 **Author:** [@sergrefraction](https://github.com/sergrefraction) **Created:** 10/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `tests-macos-fixes` --- ### 📝 Commits (3) - [`ed75608`](https://github.com/Niko1221/Strata/commit/ed7560843ef4a9751a66ba6f40e5c07f391e6acc) [Tests] run the setup and host suites on a Mac - [`19c215d`](https://github.com/Niko1221/Strata/commit/19c215d98bab0750ae0180c0400a5b673eb2c11a) [Tests] name the PC the fake engine packages are built for - [`3428909`](https://github.com/Niko1221/Strata/commit/34289092a557b42ffc0439764b82801a0ad7ddb8) [Tests] ask the product where its own settings file is ### 📊 Changes **15 files changed** (+238 additions, -109 deletions) <details> <summary>View changed files</summary> 📝 `apps/host/tests/chat-files.test.mjs` (+2 -2) 📝 `apps/host/tests/helpers/native-fixture.mjs` (+2 -2) 📝 `apps/host/tests/packaged-control.test.mjs` (+8 -6) 📝 `tests/terminal/test_archive_gaps.py` (+4 -4) 📝 `tests/terminal/test_component_start.py` (+26 -15) 📝 `tests/terminal/test_discovery.py` (+24 -3) 📝 `tests/terminal/test_engine_component.py` (+57 -32) 📝 `tests/terminal/test_engine_manifest.py` (+13 -6) 📝 `tests/terminal/test_shared_models_folder.py` (+1 -1) 📝 `tests/terminal/test_updater.py` (+24 -19) 📝 `tests/terminal/update_fixture.py` (+49 -8) 📝 `tools/test_setup_choices.py` (+3 -0) 📝 `tools/test_setup_golden.py` (+9 -1) 📝 `tools/test_setup_unsloth.py` (+7 -4) 📝 `tools/test_setup_update.py` (+9 -6) </details> ### 📄 Description ### Problem and resulting behaviour Every test in `tests/terminal`, `tools/test_setup_*.py` and `apps/host/tests` that builds a throwaway engine package failed on Apple Silicon, and 105 of the Terminal tests failed in total. The code under test is fine: the tests build a CUDA or HIP package and then ask the resolver to use it **here**, and the resolver drops a package whose platform this machine does not take before the rule the test is about is reached. A Mac takes Metal, and the tests never said which PC they were talking about. After this change the same tests pass on a Mac, and on Windows and Linux they name this machine, so those runs are unchanged by construction. ### Approach - `tests/terminal/update_fixture.py`: the shared package builder names the engine family and the folder tag of the machine running the test (`metal` / `apple-gpu` on a Mac, `cuda` / `cuda13` elsewhere). Cases that are about CUDA code for another card name a CUDA PC themselves. - `tests/terminal/test_engine_component.py`, `test_engine_manifest.py`, `test_archive_gaps.py`: one PC constant per file. Packages are built for it, `resolve` is asked about it, and where the production code asks this machine which GPU family it takes, the test points that probe at the PC it is speaking about (per test, with `addCleanup`, never at import time). - `tests/terminal/test_updater.py`: each case reads its own family and folder tag instead of assuming `cuda`; the runtime-library check accepts the Metal library as well. - `tests/terminal/test_component_start.py`: the stub engine is one this machine takes, and carries a picture reader on a Mac, where `packaging/package_engine.py` refuses a macOS package without one (#3697). - `tools/test_setup_*.py`: `setup.py` hands a Mac run to `metal/setup_mac.py` before it reads its arguments (`setup.py:8418`), so every harness that drove `setup.main()` through the CUDA/Windows path got exit 2 and an empty log. The harness now patches `sys.platform` for those runs, only when it is a Mac. The golden baseline stored the vision file as `strata-vision.exe`; on a Mac and on Linux the name has no `.exe`, so all 48 comparisons differed — the baseline and the new run now go through the same name rule. `test_setup_choices` also ran a real `pip install rocm[...]`, which broke the rule that setup tests run without a GPU or downloads. - `apps/host/tests/*`: on macOS `/var` is a link to `/private/var` and the host resolves it, so three tests that compared a temp path as written now compare the resolved path. No production file is touched: only test files and test fixtures. ### Validation Measured on this machine (Apple M2 Max, macOS 26.6.2, Python 3.15), `python -m pytest tests/terminal`: - Before: 105 failed, 1556 passed, 55 skipped. - After the files in this pull request: 56 failed, 1603 passed, 55 skipped. The remaining failures are a different class (data-folder discovery preferring `~/Documents`, process handling, the launch warnings) and are not addressed here. - The five files changed here, run together: `test_updater.py` 19 failed → 40 passed; `test_engine_component.py` 18 → 39 passed and 1 skipped; `test_engine_manifest.py` 8 → 23 passed; `test_component_start.py` 6 → 8 passed; `test_archive_gaps.py` 1 → 0. Together: 120 passed, 2 skipped, 0 failed. - The eleven files that build packages through `update_fixture.py`: 158 passed, 12 skipped, 0 failed. - `python tools/test_setup_<name>.py` (the setup suite): 49 of 49 pass. - `npm test` in `apps/host`: passes on this Mac. Not run: Windows and Linux. The changes are no-ops there by construction (the PC named is this machine), but they have not been executed on either. No GPU was used and nothing was downloaded. ### Scope No production behaviour, no default and no file a user runs is changed, so no scope-agreement issue was opened. If you would rather have one first, say so and this can wait behind it. ### Limits - The 55 skips are unchanged and are what they were before: 38 are Windows-only (ACL, NTFS, `taskkill`, long paths, the installer), 10 are Docker images built for other platforms, and the rest need a GPU, a second card, a real installer or `STRATA_VISION_GGUF_TEST`. - The Metal path is exercised only through fake packages: these tests never start a real engine, so they prove the resolver and the packager rules, not the Metal build itself. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#4916
No description provided.