Regression test for shader pre-build on a fresh cache #3

Closed
opened 2026-11-26 05:50:23 +00:00 by github-bot · 1 comment
Owner

@⁠HandshakeHackin on GitHub · 2026-11-25 15:04 UTC · original

Following up on PastiiJay/klbf-lab-beta#6. The fix is present on the beta branch at ac838b5. Passing an empty input directory exercises the real Windows CLI setup and exits before any shader pack is required. Here's a regression test for first-run setup.

Save as check_cold_cache.py and run py -3 check_cold_cache.py C:\path\to\victory.exe. Each run uses a new temporary cache and cleans up afterward.

import os
import subprocess
import sys
from pathlib import Path
from tempfile import TemporaryDirectory

victory = Path(sys.argv[1]).resolve(strict=True)
with TemporaryDirectory() as tmp:
    root = Path(tmp)
    inputs = root / "empty-input"
    inputs.mkdir()
    cache = root / "cache"
    env = os.environ.copy()
    env.pop("VICTORY_CONFIG", None)
    env["VICTORY_CACHE_DIR"] = str(cache)
    subprocess.run(
        [str(victory), "translate", "--cache", "--pipelines", str(inputs)],
        cwd=root, env=env, check=True, timeout=60,
    )
    if not (cache / "pipelines").is_dir():
        sys.exit("FAIL: pre-build returned without creating cache/pipelines")
    print("PASS: pre-build created cache/pipelines on a cold start")

Expected on the affected build: the CLI exits successfully but the directory check fails. Expected with the Lab 39 fix: PASS. I traced the beta source and tested both outcomes of the check with stand-in executables on Linux. If anyone has both Windows builds handy, the two results would help confirm this is suitable for Windows CI. This covers directory initialization only.

**@⁠HandshakeHackin** on GitHub · 2026-11-25 15:04 UTC · [original](https://github.com/PastiiJay/klbf-lab/issues/3) Following up on PastiiJay/klbf-lab-beta#6. The fix is present on the beta branch at ac838b5. Passing an empty input directory exercises the real Windows CLI setup and exits before any shader pack is required. Here's a regression test for first-run setup. Save as check_cold_cache.py and run `py -3 check_cold_cache.py C:\path\to\victory.exe`. Each run uses a new temporary cache and cleans up afterward. ~~~python import os import subprocess import sys from pathlib import Path from tempfile import TemporaryDirectory victory = Path(sys.argv[1]).resolve(strict=True) with TemporaryDirectory() as tmp: root = Path(tmp) inputs = root / "empty-input" inputs.mkdir() cache = root / "cache" env = os.environ.copy() env.pop("VICTORY_CONFIG", None) env["VICTORY_CACHE_DIR"] = str(cache) subprocess.run( [str(victory), "translate", "--cache", "--pipelines", str(inputs)], cwd=root, env=env, check=True, timeout=60, ) if not (cache / "pipelines").is_dir(): sys.exit("FAIL: pre-build returned without creating cache/pipelines") print("PASS: pre-build created cache/pipelines on a cold start") ~~~ Expected on the affected build: the CLI exits successfully but the directory check fails. Expected with the Lab 39 fix: PASS. I traced the beta source and tested both outcomes of the check with stand-in executables on Linux. If anyone has both Windows builds handy, the two results would help confirm this is suitable for Windows CI. This covers directory initialization only.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:50:23 +00:00
Author
Owner

@⁠PastiiJay on GitHub · 2026-11-25 15:17 UTC · original

Thanks @⁠HandshakeHackin, a handy check for the fresh-cache case. We'll run it against the next test builds; if you'd like it in the repo, feel free to open it as a PR (e.g. under docs/klbf/ or a tests folder) and we'll merge it.

**@⁠PastiiJay** on GitHub · 2026-11-25 15:17 UTC · [original](https://github.com/PastiiJay/klbf-lab/issues/3#issuecomment-7166616993) Thanks @⁠HandshakeHackin, a handy check for the fresh-cache case. We'll run it against the next test builds; if you'd like it in the repo, feel free to open it as a PR (e.g. under docs/klbf/ or a tests folder) and we'll merge it.
This discussion has been locked. Commenting is limited to contributors.
No description provided.