mirror of
https://github.com/Niko1221/Strata.git
synced 2026-11-09 03:59:45 -10:00
Tests: the plan and adopt fixtures say NVIDIA, not whatever Intel Arc the box has (9 failures on p1006)
This commit is contained in:
1 parent
e8c3acd2d1
commit
c94ef2375a
6 files changed
+31
-1
No files matched your search
@@ -73,3 +73,12 @@ def run_cli(argv: list[str]) -> tuple[int, str, str]:
|
||||
except SystemExit as e:
|
||||
code = int(e.code or 0)
|
||||
return code, out.getvalue(), err.getvalue()
|
||||
|
||||
|
||||
def not_intel(testcase) -> None:
|
||||
"""These fixtures describe an NVIDIA PC (catalog(HW_12)). Runner.intel_chosen asks the machine that runs the test, so on a box with an
|
||||
Intel Arc (p1006) the launch became an Intel one and the plan words changed. Patched for the length of the test."""
|
||||
from strata_cli.launch.runner import Runner
|
||||
p = mock.patch.object(Runner, "intel_chosen", lambda self: False)
|
||||
p.start()
|
||||
testcase.addCleanup(p.stop)
|
||||
@@ -1017,6 +1017,10 @@ class TheAppAsksControl(unittest.TestCase):
|
||||
class TheDownloadPlanListsIt(unittest.TestCase):
|
||||
"""`strata launch --plan --drafting dflash2` adds the drafter to the download when it would be used."""
|
||||
|
||||
def setUp(self):
|
||||
from tests.terminal.launch_support import not_intel
|
||||
not_intel(self)
|
||||
|
||||
def test_the_plan_line_and_the_part(self):
|
||||
from tests.terminal.launch_support import HW_12, Home, catalog
|
||||
from strata_cli.launch.runner import Runner
|
||||
|
||||
@@ -159,6 +159,11 @@ class LinkedShards(Base):
|
||||
class PlanWords(Base):
|
||||
"""Findings 1 and 7: --plan shows the real model, the picture setting, a copyable line, and what would be downloaded."""
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
from tests.terminal.launch_support import not_intel
|
||||
not_intel(self)
|
||||
|
||||
def plan_text(self, *args):
|
||||
code, out, err = run_cli(["launch", "--plan", *args])
|
||||
self.assertEqual(code, 0, err or out)
|
||||
|
||||
@@ -518,6 +518,10 @@ class SetupArgs(unittest.TestCase):
|
||||
|
||||
|
||||
class AdoptRules(unittest.TestCase):
|
||||
def setUp(self):
|
||||
from tests.terminal.launch_support import not_intel
|
||||
not_intel(self)
|
||||
|
||||
def files(self, root: Path, shards=2, pack=True, tokenizer=True, mtp=True):
|
||||
d = root / "Strata-data"
|
||||
m = d / "models" / "IQ3_XXS"
|
||||
@@ -758,7 +762,9 @@ class AdoptRules(unittest.TestCase):
|
||||
self.assertTrue(store.summary(store.load("Fastest"))["tuned"])
|
||||
|
||||
def test_runner_adopts_when_setup_cannot_handle_the_card(self):
|
||||
with Home() as h:
|
||||
# the engine make is read from the machine (adopt_prepared_files asks engine_component.detect_backend); on a box with an Intel Arc the
|
||||
# second launch below would be refused as an Intel one. This case is the "no NVIDIA driver" one.
|
||||
with Home() as h, mock.patch("strata_control.engine_component.detect_backend", lambda environ=None: ("cuda", "test")):
|
||||
d, m = self.files(h.base)
|
||||
cat = catalog(HW_12)
|
||||
s = S.LaunchSettings(family="qwen", model="IQ3_XXS", context=32768, data_dir=str(d))
|
||||
|
||||
@@ -186,6 +186,10 @@ class SetupArguments(unittest.TestCase):
|
||||
|
||||
|
||||
class PlanPredictsEveryDownload(unittest.TestCase):
|
||||
def setUp(self):
|
||||
from tests.terminal.launch_support import not_intel
|
||||
not_intel(self)
|
||||
|
||||
def plan_text(self, h: Home, own: Path, **kw) -> dict:
|
||||
s = S.LaunchSettings(family="qwen", model="IQ3_XXS", context=32768, vision="on", model_path=str(own), data_dir=str(h.base / "data"), **kw)
|
||||
r = Runner(s, catalog=catalog(HW_12))
|
||||
|
||||
@@ -14,6 +14,8 @@ class DownloadSize(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.home = Home().__enter__()
|
||||
self.addCleanup(self.home.__exit__, None, None, None)
|
||||
from tests.terminal.launch_support import not_intel
|
||||
not_intel(self)
|
||||
|
||||
def runner(self, **kw):
|
||||
values = dict(family="gyro", model="Gyro-S", context=32768, vision="cpu")
|
||||
|
||||
Reference in new issue
Block a user