[PR #3782] [CLOSED] [TUI] make Terminal regression fixtures portable #4778

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3782
Author: @BColsey
Created: 10/23/2026
Status: ❌ Closed

Base: main ← Head: fix/terminal-test-portability


📝 Commits (2)

  • 37b729c [TUI] make Terminal test fixtures portable across platforms
  • 2bd275e [TUI] finish portable shared-folder and privacy fixtures

📊 Changes

5 files changed (+22 additions, -6 deletions)

View changed files

📝 tests/terminal/test_discovery.py (+5 -3)
📝 tests/terminal/test_gfx_selection.py (+6 -1)
📝 tests/terminal/test_launch_tui.py (+1 -1)
📝 tests/terminal/test_private_files.py (+9 -0)
📝 tests/terminal/test_shared_models_folder.py (+1 -1)

📄 Description

Problem and result

Several Terminal regression fixtures fail on Linux even though the behavior under test works: they write settings to %APPDATA%, mutate the process-wide os.name while exercising Windows probes, assume an inherited Windows ACL on POSIX, or depend on Textual's exact line wrapping. The fixtures now model the platform being exercised and keep the existing behavioral assertions.

Found while validating #2769 and reproduced on unmodified main 011c9e600a93bbc9fd451c563501b5831c32bbca. This is a separate test-only change; no Muse or production code is included. The search also found #3406, which addresses Windows SDDL aliases in different assertions; those Windows assertions remain unchanged here.

Approach

Discovery and shared-folder fixtures use %APPDATA%/Strata on Windows and $XDG_CONFIG_HOME/strata on POSIX. The Windows GPU probe test replaces only the modules' OS stubs and filesystem boundary, so host pathlib keeps its real platform. The private-file fixture explicitly checks that POSIX 0600 is private/unshared and 0644 is rejected by both checks. The Cloudflare help assertion normalizes rendered whitespace with the existing helper.

Validation

Submitted revision: 2bd275e9838f005462f62293766ac6f933a5e60a, based on main 011c9e60.

Linux x86-64, Intel Xeon E5-2690 v2, Python 3.11.2, pytest 9.1.1, pytest-asyncio 1.4.0, Textual 8.2.8 and Rich 15.0.0. Runs used an isolated container with dependencies in normal site-packages, --init, read-only source and no network.

Passed:

  • The four initial discovery/GPU/TUI reproductions pass; all four fail on unmodified main.
  • python3 -m pytest -q -p no:cacheprovider tests/terminal/test_discovery.py tests/terminal/test_shared_models_folder.py tests/terminal/test_gfx_selection.py tests/terminal/test_private_files.py: 85 passed, 9 existing Windows-only skips.
  • The shared-folder/private-file pair changes from 10 failed, 43 passed, 9 skipped on main to 53 passed, 9 skipped with the fix.
  • python3 -m unittest tests.terminal.test_private_files passes under both umask 022 and umask 077: 13 tests, 9 existing Windows-only skips in each run.
  • git diff --check origin/main...HEAD.

The complete Terminal suite also passed on combined validation revision dcb54ca39104f77695c3820b8597b7a5af4bfd95: Muse e0002b04 plus this companion and the independent setup-fixture fix #3778. This is combined-branch evidence, not a claim that the companion fixes have merged into main or #2769.

docker run --rm --init --network none \
  --mount type=bind,src=/path/to/combined-validation,dst=/src,readonly \
  --workdir /src -e PYTHONDONTWRITEBYTECODE=1 \
  local/strata-pr2769-terminal-standard \
  python3 -m pytest -q -p no:cacheprovider tests/terminal

Observed: 1,312 passed, 42 skipped, 226 subtests passed, exit 0, in 632.64 seconds. Six warnings were emitted: three invalid-escape deprecations and three TUI worker/closed-loop warnings. The same three worker/coroutine warnings reproduce on unmodified main in the ordered TUI test pair (two tests pass there and here). They are not claimed fixed by this portability change.

The changed TUI reproduction:

python3 -m pytest -q -p no:cacheprovider \
  tests/terminal/test_discovery.py::GuiLayout::test_a_remembered_older_install_and_the_app_install_are_both_listed \
  tests/terminal/test_discovery.py::GuiLayout::test_an_own_setting_beats_the_apps_folder \
  tests/terminal/test_gfx_selection.py::Detection::test_windows_without_hipinfo_reads_the_gfx_from_the_adapters \
  tests/terminal/test_launch_tui.py::AccessStep::test_cloudflare_without_the_helper_says_how_to_install_it_and_does_not_block

Failed: baseline fixture failures above; none remain in the listed fixed-branch checks.

Not run: actual Windows ACL execution or macOS execution.

Limits

No production behavior, defaults or dependencies change. Windows-specific ACL checks retain their existing assertions and skips. These fixes make the existing regression suite portable; they do not validate Windows hardware or ACL behavior from Linux.


🔄 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/3782 **Author:** [@BColsey](https://github.com/BColsey) **Created:** 10/23/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/terminal-test-portability` --- ### 📝 Commits (2) - [`37b729c`](https://github.com/Niko1221/Strata/commit/37b729c72e6f8df6515ced4ecbae6f263e9fbe68) [TUI] make Terminal test fixtures portable across platforms - [`2bd275e`](https://github.com/Niko1221/Strata/commit/2bd275e9838f005462f62293766ac6f933a5e60a) [TUI] finish portable shared-folder and privacy fixtures ### 📊 Changes **5 files changed** (+22 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `tests/terminal/test_discovery.py` (+5 -3) 📝 `tests/terminal/test_gfx_selection.py` (+6 -1) 📝 `tests/terminal/test_launch_tui.py` (+1 -1) 📝 `tests/terminal/test_private_files.py` (+9 -0) 📝 `tests/terminal/test_shared_models_folder.py` (+1 -1) </details> ### 📄 Description ## Problem and result Several Terminal regression fixtures fail on Linux even though the behavior under test works: they write settings to `%APPDATA%`, mutate the process-wide `os.name` while exercising Windows probes, assume an inherited Windows ACL on POSIX, or depend on Textual's exact line wrapping. The fixtures now model the platform being exercised and keep the existing behavioral assertions. ## Related discussion Found while validating #2769 and reproduced on unmodified main `011c9e600a93bbc9fd451c563501b5831c32bbca`. This is a separate test-only change; no Muse or production code is included. The search also found #3406, which addresses Windows SDDL aliases in different assertions; those Windows assertions remain unchanged here. ## Approach Discovery and shared-folder fixtures use `%APPDATA%/Strata` on Windows and `$XDG_CONFIG_HOME/strata` on POSIX. The Windows GPU probe test replaces only the modules' OS stubs and filesystem boundary, so host `pathlib` keeps its real platform. The private-file fixture explicitly checks that POSIX `0600` is private/unshared and `0644` is rejected by both checks. The Cloudflare help assertion normalizes rendered whitespace with the existing helper. ## Validation Submitted revision: `2bd275e9838f005462f62293766ac6f933a5e60a`, based on main `011c9e60`. Linux x86-64, Intel Xeon E5-2690 v2, Python 3.11.2, pytest 9.1.1, pytest-asyncio 1.4.0, Textual 8.2.8 and Rich 15.0.0. Runs used an isolated container with dependencies in normal site-packages, `--init`, read-only source and no network. **Passed:** - The four initial discovery/GPU/TUI reproductions pass; all four fail on unmodified main. - `python3 -m pytest -q -p no:cacheprovider tests/terminal/test_discovery.py tests/terminal/test_shared_models_folder.py tests/terminal/test_gfx_selection.py tests/terminal/test_private_files.py`: **85 passed, 9 existing Windows-only skips**. - The shared-folder/private-file pair changes from **10 failed, 43 passed, 9 skipped** on main to **53 passed, 9 skipped** with the fix. - `python3 -m unittest tests.terminal.test_private_files` passes under both `umask 022` and `umask 077`: 13 tests, 9 existing Windows-only skips in each run. - `git diff --check origin/main...HEAD`. The complete Terminal suite also passed on combined validation revision [`dcb54ca39104f77695c3820b8597b7a5af4bfd95`](https://github.com/BColsey/Strata/commit/dcb54ca39104f77695c3820b8597b7a5af4bfd95): Muse `e0002b04` plus this companion and the independent setup-fixture fix #3778. This is combined-branch evidence, not a claim that the companion fixes have merged into main or #2769. ```sh docker run --rm --init --network none \ --mount type=bind,src=/path/to/combined-validation,dst=/src,readonly \ --workdir /src -e PYTHONDONTWRITEBYTECODE=1 \ local/strata-pr2769-terminal-standard \ python3 -m pytest -q -p no:cacheprovider tests/terminal ``` Observed: **1,312 passed, 42 skipped, 226 subtests passed**, exit 0, in 632.64 seconds. Six warnings were emitted: three invalid-escape deprecations and three TUI worker/closed-loop warnings. The same three worker/coroutine warnings reproduce on unmodified main in the ordered TUI test pair (two tests pass there and here). They are not claimed fixed by this portability change. The changed TUI reproduction: ```sh python3 -m pytest -q -p no:cacheprovider \ tests/terminal/test_discovery.py::GuiLayout::test_a_remembered_older_install_and_the_app_install_are_both_listed \ tests/terminal/test_discovery.py::GuiLayout::test_an_own_setting_beats_the_apps_folder \ tests/terminal/test_gfx_selection.py::Detection::test_windows_without_hipinfo_reads_the_gfx_from_the_adapters \ tests/terminal/test_launch_tui.py::AccessStep::test_cloudflare_without_the_helper_says_how_to_install_it_and_does_not_block ``` **Failed:** baseline fixture failures above; none remain in the listed fixed-branch checks. **Not run:** actual Windows ACL execution or macOS execution. ## Limits No production behavior, defaults or dependencies change. Windows-specific ACL checks retain their existing assertions and skips. These fixes make the existing regression suite portable; they do not validate Windows hardware or ACL behavior from Linux. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:38:59 +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#4778
No description provided.