test descriptions

This commit is contained in:
Dobromir Popov
2026-07-11 22:25:30 +03:00
parent 7d259d7c9b
commit 7cf8d9bcf3
43 changed files with 876 additions and 265 deletions

View File

@@ -35,7 +35,7 @@ from meshnet_tracker.server import TrackerServer
def test_with_forced_cpu_overrides_device_but_keeps_gpu_inventory():
"""--cpu should register and run on CPU while preserving detected GPU metadata."""
"--cpu should register and run on CPU while preserving detected GPU metadata.\n\nTags: node, startup"
import meshnet_node.hardware as hardware_mod
hw = hardware_mod.with_forced_cpu(
@@ -56,7 +56,7 @@ def test_with_forced_cpu_overrides_device_but_keeps_gpu_inventory():
def test_detect_hardware_returns_valid_profile():
"""Hardware detection always returns a dict with required keys."""
"Hardware detection always returns a dict with required keys.\n\nTags: node, startup"
hw = detect_hardware()
assert hw["device"] in {"cuda", "cpu"}
assert isinstance(hw.get("vram_mb"), int)
@@ -71,7 +71,7 @@ def test_detect_hardware_returns_valid_profile():
def test_windows_ram_fallback_is_used_when_sysconf_is_unavailable(monkeypatch):
"""Windows hosts do not have os.sysconf; RAM must not collapse to 0 MB."""
"Windows hosts do not have os.sysconf; RAM must not collapse to 0 MB.\n\nTags: node, startup"
import meshnet_node.hardware as hardware_mod
monkeypatch.setattr(
@@ -86,7 +86,7 @@ def test_windows_ram_fallback_is_used_when_sysconf_is_unavailable(monkeypatch):
def test_windows_gpu_memory_fallback_preserves_cpu_execution(monkeypatch):
"""A Windows-visible GPU is reported, but CUDA execution is not claimed without CUDA."""
"A Windows-visible GPU is reported, but CUDA execution is not claimed without CUDA.\n\nTags: node, startup"
import meshnet_node.hardware as hardware_mod
calls = []
@@ -127,7 +127,7 @@ def test_windows_gpu_memory_fallback_preserves_cpu_execution(monkeypatch):
def test_nvidia_smi_without_torch_cuda_keeps_cpu_execution(monkeypatch):
"""nvidia-smi proves GPU inventory, not that this Python can execute CUDA."""
"nvidia-smi proves GPU inventory, not that this Python can execute CUDA.\n\nTags: node, startup"
import meshnet_node.hardware as hardware_mod
class FakeResult:
@@ -150,7 +150,7 @@ def test_nvidia_smi_without_torch_cuda_keeps_cpu_execution(monkeypatch):
def test_torch_rocm_inventory_is_reported_when_kernels_are_not_executable(monkeypatch):
"""ROCm can expose GPU metadata even when this torch wheel cannot run kernels."""
"ROCm can expose GPU metadata even when this torch wheel cannot run kernels.\n\nTags: node, startup"
import meshnet_node.hardware as hardware_mod
class FakeProps:
@@ -203,6 +203,7 @@ def test_torch_rocm_inventory_is_reported_when_kernels_are_not_executable(monkey
def test_memory_budget_uses_ram_for_cpu_and_shared_memory_for_cuda():
"Memory budget uses ram for cpu and shared memory for cuda\n\nTags: node, startup"
assert _memory_budget("cpu", vram_mb=8192, ram_mb=80 * 1024, shared_vram_mb=40 * 1024) == (
80 * 1024,
"RAM",
@@ -214,26 +215,27 @@ def test_memory_budget_uses_ram_for_cpu_and_shared_memory_for_cuda():
def test_hardware_label_marks_inventory_only_gpu_as_cuda_inactive():
"Hardware label marks inventory only gpu as cuda inactive\n\nTags: node, startup"
assert _hardware_label("cpu", "NVIDIA GeForce RTX 4060 Laptop GPU") == "CPU (CUDA inactive)"
assert _hardware_label("cpu", None) == "CPU"
assert _hardware_label("cuda", "NVIDIA GeForce RTX 4060 Laptop GPU") == "CUDA"
def test_benchmark_throughput_cpu_returns_positive():
"""CPU benchmark returns a positive float greater than the 1.0 error fallback."""
"CPU benchmark returns a positive float greater than the 1.0 error fallback.\n\nTags: node, performance, startup"
result = benchmark_throughput("cpu")
assert isinstance(result, float)
assert result > 1.0, f"expected benchmark > 1.0, got {result}"
def test_benchmark_throughput_fallback_on_bad_device():
"""benchmark_throughput returns 1.0 (not raises) when device is invalid."""
"benchmark_throughput returns 1.0 (not raises) when device is invalid.\n\nTags: node, performance, startup"
result = benchmark_throughput("invalid_device_xyz")
assert result == 1.0
def test_configure_torch_threads_applies_explicit_settings(monkeypatch):
"""Node startup can tune PyTorch CPU thread pools before loading a model."""
"Node startup can tune PyTorch CPU thread pools before loading a model.\n\nTags: node, startup"
calls: dict[str, int] = {}
fake_torch = types.SimpleNamespace(
@@ -256,7 +258,7 @@ def test_configure_torch_threads_applies_explicit_settings(monkeypatch):
def test_benchmark_throughput_is_registered_in_payload(monkeypatch, tmp_path):
"""benchmark_tokens_per_sec from the benchmark is included in the tracker registration."""
"benchmark_tokens_per_sec from the benchmark is included in the tracker registration.\n\nTags: node, performance, startup"
import meshnet_node.startup as startup_mod
captured: dict = {}
@@ -316,6 +318,7 @@ def test_benchmark_throughput_is_registered_in_payload(monkeypatch, tmp_path):
def test_real_model_startup_passes_download_dir_and_kimi_metadata(monkeypatch, tmp_path):
"Real model startup passes download dir and kimi metadata\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
captured_registration: dict = {}
@@ -375,6 +378,7 @@ def test_real_model_startup_passes_download_dir_and_kimi_metadata(monkeypatch, t
def test_cuda_benchmark_failure_is_registered_for_inventory_only_gpu(monkeypatch, tmp_path, capsys):
"Cuda benchmark failure is registered for inventory only gpu\n\nTags: node, performance, startup"
import meshnet_node.startup as startup_mod
captured: dict = {}
@@ -434,7 +438,7 @@ def test_cuda_benchmark_failure_is_registered_for_inventory_only_gpu(monkeypatch
def test_wallet_generates_new_keypair(tmp_path):
"""A new wallet is created when none exists, saved to disk."""
"A new wallet is created when none exists, saved to disk.\n\nTags: node, security, startup, wallet"
wallet_file = tmp_path / "wallet.json"
assert not wallet_file.exists()
@@ -451,7 +455,7 @@ def test_wallet_generates_new_keypair(tmp_path):
def test_wallet_loads_existing_keypair(tmp_path):
"""Loading the same wallet file twice returns identical keys and address."""
"Loading the same wallet file twice returns identical keys and address.\n\nTags: node, security, startup, wallet"
wallet_file = tmp_path / "wallet.json"
secret1, public1, address1 = load_or_create_wallet(path=wallet_file)
@@ -463,7 +467,7 @@ def test_wallet_loads_existing_keypair(tmp_path):
def test_wallet_load_repairs_insecure_permissions(tmp_path):
"""Existing private key files are tightened to owner-only permissions."""
"Existing private key files are tightened to owner-only permissions.\n\nTags: node, security, startup, wallet"
wallet_file = tmp_path / "wallet.json"
load_or_create_wallet(path=wallet_file)
wallet_file.chmod(0o644)
@@ -474,12 +478,12 @@ def test_wallet_load_repairs_insecure_permissions(tmp_path):
def test_base58_counts_only_leading_zero_bytes():
"""Zero bytes inside the public key do not become extra base58 leading ones."""
"Zero bytes inside the public key do not become extra base58 leading ones.\n\nTags: node, startup"
assert _b58encode(bytes([0, 1, 0])) == "15R"
def test_download_shard_stub_creates_cache(tmp_path):
"""Stub-model shard creates a local cache file without network access."""
"Stub-model shard creates a local cache file without network access.\n\nTags: cache, node, startup"
shard_dir = download_shard("stub-model", 0, 31, cache_dir=tmp_path)
assert shard_dir.exists()
weights = shard_dir / "weights.json"
@@ -491,7 +495,7 @@ def test_download_shard_stub_creates_cache(tmp_path):
def test_download_shard_uses_huggingface_when_repo_is_assigned(tmp_path, monkeypatch):
"""Non-stub shards use the HuggingFace snapshot_download path."""
"Non-stub shards use the HuggingFace snapshot_download path.\n\nTags: node, startup"
calls = []
def fake_snapshot_download(repo_id, cache_dir, local_dir):
@@ -526,7 +530,7 @@ def test_download_shard_reuses_model_cache_for_narrower_layer_range(
tmp_path,
monkeypatch,
):
"""A wider cached shard satisfies a later narrower assignment for the same model."""
"A wider cached shard satisfies a later narrower assignment for the same model.\n\nTags: cache, node, startup"
cache_dir = tmp_path / "cache"
model_dir = cache_dir / "tiny-llama"
model_dir.mkdir(parents=True)
@@ -574,7 +578,7 @@ def test_download_shard_prefers_tracker_model_source_over_huggingface(
tmp_path,
monkeypatch,
):
"""A working tracker model source is used exclusively — HF is never contacted."""
"A working tracker model source is used exclusively — HF is never contacted.\n\nTags: node, startup"
contents = {
"config.json": b"{}",
"model-00002-of-00004.safetensors": b"tracker",
@@ -646,7 +650,7 @@ def test_download_shard_prefers_tracker_full_model_source_over_huggingface(
tmp_path,
monkeypatch,
):
"""A tracker-advertised full snapshot is sufficient on its own — HF is never contacted."""
"A tracker-advertised full snapshot is sufficient on its own — HF is never contacted.\n\nTags: node, startup"
contents = {
"config.json": b"{}",
"weights-a.safetensors": b"tracker-a",
@@ -718,7 +722,7 @@ def test_download_shard_falls_back_to_huggingface_when_tracker_source_fails(
tmp_path,
monkeypatch,
):
"""A dead tracker source falls through to HF with allow_patterns from the source files."""
"A dead tracker source falls through to HF with allow_patterns from the source files.\n\nTags: node, startup"
def failing_urlopen(*args, **kwargs):
raise ConnectionResetError("tracker went away")
@@ -758,7 +762,7 @@ def test_download_shard_falls_back_to_huggingface_when_tracker_source_fails(
def test_download_shard_logs_huggingface_source(tmp_path, monkeypatch, capsys):
"""Shard download status tells the node operator when HuggingFace was used."""
"Shard download status tells the node operator when HuggingFace was used.\n\nTags: node, startup"
def fake_snapshot_download(repo_id, cache_dir, local_dir):
Path(local_dir).mkdir(parents=True, exist_ok=True)
@@ -786,7 +790,7 @@ def test_download_shard_rejects_peer_checksum_mismatch_before_fallback(
tmp_path,
monkeypatch,
):
"""Corrupt peer chunks are not marked complete; HuggingFace remains the fallback."""
"Corrupt peer chunks are not marked complete; HuggingFace remains the fallback.\n\nTags: node, startup"
corrupt_dir = tmp_path / "corrupt"
corrupt_dir.mkdir()
(corrupt_dir / "weights.json").write_text(json.dumps({"payload": "corrupt"}))
@@ -841,14 +845,14 @@ def test_download_shard_rejects_peer_checksum_mismatch_before_fallback(
def test_download_shard_stub_idempotent(tmp_path):
"""Calling download_shard twice does not error — file already exists."""
"Calling download_shard twice does not error — file already exists.\n\nTags: node, startup"
download_shard("stub-model", 0, 31, cache_dir=tmp_path, progress=False)
shard_dir = download_shard("stub-model", 0, 31, cache_dir=tmp_path, progress=False)
assert shard_dir.exists()
def test_startup_formats_probationary_jobs_remaining():
"""Startup status tells a node how many free jobs remain before earning."""
"Startup status tells a node how many free jobs remain before earning.\n\nTags: node, startup"
contracts = LocalSolanaContracts(probationary_job_count=50)
for _ in range(12):
contracts.registry.record_completed_job("node-wallet-a")
@@ -869,7 +873,7 @@ def _get_json(url: str) -> dict:
def test_tracker_assign_returns_shard_for_empty_registry():
"""Tracker assigns the full layer range when no nodes are registered."""
"Tracker assigns the full layer range when no nodes are registered.\n\nTags: node, startup"
tracker = TrackerServer()
port = tracker.start()
try:
@@ -885,7 +889,7 @@ def test_tracker_assign_returns_shard_for_empty_registry():
def test_tracker_assign_fills_gap():
"""Tracker assigns the first uncovered layer range when a node is already registered."""
"Tracker assigns the first uncovered layer range when a node is already registered.\n\nTags: node, startup"
import json as _json
import urllib.request as _ur
@@ -920,7 +924,7 @@ def test_tracker_assign_fills_gap():
def test_tracker_assign_returns_huggingface_repo_when_configured():
"""Tracker includes the HuggingFace repo identifier in shard assignments."""
"Tracker includes the HuggingFace repo identifier in shard assignments.\n\nTags: node, startup"
tracker = TrackerServer(model_presets={
"tiny-llama": {"layers_start": 0, "layers_end": 7, "hf_repo": "org/tiny-llama-shards"}
})
@@ -938,7 +942,7 @@ def test_tracker_assign_returns_huggingface_repo_when_configured():
def test_tracker_assign_advertises_local_model_source_and_serves_subset(tmp_path):
"""Tracker with models_dir advertises and serves only files needed for the shard."""
"Tracker with models_dir advertises and serves only files needed for the shard.\n\nTags: node, startup"
snapshot = tmp_path / "models" / "models--org--tiny-llama-shards" / "snapshots" / "abc"
nested = snapshot / "nested"
nested.mkdir(parents=True)
@@ -1015,7 +1019,7 @@ def test_tracker_assign_advertises_local_model_source_and_serves_subset(tmp_path
def test_tracker_assign_lists_peers_for_same_model_shard():
"""A registered node with a completed shard is returned as a same-shard peer."""
"A registered node with a completed shard is returned as a same-shard peer.\n\nTags: node, startup"
import json as _json
import urllib.request as _ur
@@ -1058,6 +1062,7 @@ def test_tracker_assign_lists_peers_for_same_model_shard():
def test_infer_relay_url_from_public_https_tracker():
"Infer relay url from public https tracker\n\nTags: node, startup"
assert _infer_relay_url_from_tracker("https://ai.neuron.d-popov.com") == (
"wss://ai.neuron.d-popov.com/ws"
)
@@ -1073,7 +1078,7 @@ def test_public_https_tracker_infers_relay_when_network_map_omits_relay_url(
monkeypatch,
capsys,
):
"""Nodes bootstrap relay from the tracker origin when map relay_url is null."""
"Nodes bootstrap relay from the tracker origin when map relay_url is null.\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
class FakeBackend:
@@ -1146,7 +1151,7 @@ def test_public_https_tracker_infers_relay_when_network_map_omits_relay_url(
def test_real_model_startup_summary_shows_total_layers(tmp_path, monkeypatch, capsys):
"""Real-model startup summary prints the shard range plus total model layers."""
"Real-model startup summary prints the shard range plus total model layers.\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
captured_registration = {}
@@ -1201,7 +1206,7 @@ def test_real_model_startup_autodetects_cpu_memory_budget_and_logs_shard_budget(
monkeypatch,
capsys,
):
"""Without --memory, startup reports RAM-backed capacity to the tracker and operator."""
"Without --memory, startup reports RAM-backed capacity to the tracker and operator.\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
captured_registration = {}
@@ -1265,7 +1270,7 @@ def test_public_tracker_model_node_registers_relay_metadata_from_tracker_url_onl
monkeypatch,
capsys,
):
"""A node only needs the public tracker URL to discover relay metadata and register."""
"A node only needs the public tracker URL to discover relay metadata and register.\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
class FakeBackend:
@@ -1355,7 +1360,7 @@ def test_public_tracker_relay_suppresses_virtual_ip_warning(
monkeypatch,
capsys,
):
"""A WSL/Docker endpoint is acceptable when the tracker advertises relay RPC."""
"A WSL/Docker endpoint is acceptable when the tracker advertises relay RPC.\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
class FakeBackend:
@@ -1432,7 +1437,7 @@ def test_later_node_auto_joins_existing_public_hf_model_with_only_tracker_url(
tmp_path,
monkeypatch,
):
"""After a model exists, a node can join by knowing only the public tracker URL."""
"After a model exists, a node can join by knowing only the public tracker URL.\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
captured = {}
@@ -1512,7 +1517,7 @@ def test_later_node_auto_joins_redundant_copy_when_model_is_fully_covered(
tmp_path,
monkeypatch,
):
"""Model-less joins should load the served HF model even when gap_found=false."""
"Model-less joins should load the served HF model even when gap_found=false.\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
captured = {}
@@ -1592,7 +1597,7 @@ def test_later_node_auto_joins_redundant_copy_when_model_is_fully_covered(
def test_full_startup_sequence(tmp_path):
"""Full startup: hardware → wallet → assign → download → start → register."""
"Full startup: hardware → wallet → assign → download → start → register.\n\nTags: node, startup"
tracker = TrackerServer(model_presets={"stub-model": {"layers_start": 0, "layers_end": 15}})
tracker_port = tracker.start()
tracker_url = f"http://127.0.0.1:{tracker_port}"
@@ -1644,6 +1649,7 @@ def test_full_startup_sequence(tmp_path):
def test_preset_model_startup_starts_heartbeat(tmp_path, monkeypatch):
"Preset model startup starts heartbeat\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
monkeypatch.setattr(
@@ -1681,7 +1687,7 @@ def test_preset_model_startup_starts_heartbeat(tmp_path, monkeypatch):
def test_preset_model_startup_honors_pinned_shard_range(tmp_path, monkeypatch):
"""Explicit --shard-start/--shard-end override tracker auto-assignment."""
"Explicit --shard-start/--shard-end override tracker auto-assignment.\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
monkeypatch.setattr(
@@ -1722,7 +1728,7 @@ def test_preset_model_startup_honors_pinned_shard_range(tmp_path, monkeypatch):
def test_preset_startup_rejects_pinned_shard_above_memory_budget(tmp_path, monkeypatch):
"""Pinned layer ranges that exceed the node memory budget fail before model load."""
"Pinned layer ranges that exceed the node memory budget fail before model load.\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
monkeypatch.setattr(
@@ -1756,7 +1762,7 @@ def test_preset_startup_rejects_pinned_shard_above_memory_budget(tmp_path, monke
def test_network_auto_join_clips_oversized_cpu_assignment(tmp_path, monkeypatch, capsys):
"""Old trackers may assign too many CPU layers; node clips before model load."""
"Old trackers may assign too many CPU layers; node clips before model load.\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
torch_calls: list[dict] = []
@@ -1816,7 +1822,7 @@ def test_network_auto_join_clips_oversized_cpu_assignment(tmp_path, monkeypatch,
def test_preset_model_with_hf_repo_loads_torch_backend(tmp_path, monkeypatch, capsys):
"""Named presets that advertise hf_repo must load TorchNodeServer, not the stub server."""
"Named presets that advertise hf_repo must load TorchNodeServer, not the stub server.\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
class FakeBackend:
@@ -1885,7 +1891,7 @@ def test_torch_startup_retries_registration_when_tracker_unreachable(
tmp_path,
monkeypatch,
):
"""Failed initial registration should start background retry, not stay unregistered."""
"Failed initial registration should start background retry, not stay unregistered.\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
class FakeBackend:
@@ -1959,7 +1965,7 @@ def test_real_model_startup_registers_downloaded_inventory_without_checksum(
monkeypatch,
capsys,
):
"""Real model folders are reported as inventory without hashing their contents."""
"Real model folders are reported as inventory without hashing their contents.\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
monkeypatch.setattr(
@@ -2025,6 +2031,7 @@ def test_real_model_startup_registers_downloaded_inventory_without_checksum(
def test_downloaded_model_inventory_reports_local_model_percentage(tmp_path):
"Downloaded model inventory reports local model percentage\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
model_dir = tmp_path / "models" / "tiny-llama"
@@ -2065,7 +2072,7 @@ def test_downloaded_model_inventory_reports_local_model_percentage(tmp_path):
def test_network_assign_gap_found_field():
"""network/assign sets gap_found=True when a real gap exists, False when fully covered."""
"network/assign sets gap_found=True when a real gap exists, False when fully covered.\n\nTags: node, startup"
import json as _json
import urllib.request as _ur
@@ -2132,7 +2139,7 @@ def test_network_assign_gap_found_field():
def test_network_assign_uses_conservative_cpu_runtime_budget():
"""CPU assignments leave headroom for partial-load overhead, not just raw weights."""
"CPU assignments leave headroom for partial-load overhead, not just raw weights.\n\nTags: node, startup"
import json as _json
import urllib.request as _ur
@@ -2181,7 +2188,7 @@ def test_network_assign_uses_conservative_cpu_runtime_budget():
def test_route_finds_hf_model_across_two_nodes():
"""Tracker /v1/route returns ordered route for HF model even without a preset."""
"Tracker /v1/route returns ordered route for HF model even without a preset.\n\nTags: node, routing, startup"
import json as _json
import urllib.request as _ur
@@ -2227,7 +2234,7 @@ def test_route_finds_hf_model_across_two_nodes():
def test_register_deduplicates_same_endpoint():
"""Re-registering the same endpoint replaces the old entry, not duplicates it."""
"Re-registering the same endpoint replaces the old entry, not duplicates it.\n\nTags: node, startup"
import json as _json
import urllib.request as _ur
@@ -2271,7 +2278,7 @@ def test_register_deduplicates_same_endpoint():
def test_startup_cpu_fallback(tmp_path, monkeypatch):
"""Node starts with CPU warning when no GPU is detected."""
"Node starts with CPU warning when no GPU is detected.\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
monkeypatch.setattr(
@@ -2306,6 +2313,7 @@ def test_startup_cpu_fallback(tmp_path, monkeypatch):
def test_detect_num_layers_prefers_flattened_local_model_config(tmp_path, monkeypatch):
"Detect num layers prefers flattened local model config\n\nTags: node, startup"
import meshnet_node.startup as startup_mod
model_dir = tmp_path / "Qwen3.6-35B-A3B"
@@ -2330,6 +2338,7 @@ def test_detect_num_layers_prefers_flattened_local_model_config(tmp_path, monkey
def test_layers_from_config_top_level():
"Layers from config top level\n\nTags: node, startup"
from meshnet_node.model_catalog import layers_from_config
cfg = types.SimpleNamespace(num_hidden_layers=24)
@@ -2337,7 +2346,7 @@ def test_layers_from_config_top_level():
def test_layers_from_config_nested_text_config():
"""VLM/MoE composites (e.g. Qwen3.5-MoE) keep the layer count in text_config."""
"VLM/MoE composites (e.g.\n\nTags: node, startup"
from meshnet_node.model_catalog import layers_from_config
cfg = types.SimpleNamespace(text_config=types.SimpleNamespace(num_hidden_layers=40))
@@ -2345,6 +2354,7 @@ def test_layers_from_config_nested_text_config():
def test_layers_from_config_get_text_config_and_variants():
"Layers from config get text config and variants\n\nTags: node, startup"
from meshnet_node.model_catalog import layers_from_config
inner = types.SimpleNamespace(n_layer=32)
@@ -2354,6 +2364,7 @@ def test_layers_from_config_get_text_config_and_variants():
def test_download_dir_env_override(tmp_path, monkeypatch):
"Download dir env override\n\nTags: node, startup"
import importlib
from meshnet_node import config as config_mod
@@ -2368,6 +2379,7 @@ def test_download_dir_env_override(tmp_path, monkeypatch):
def test_cli_loads_local_env_before_config_defaults(tmp_path, monkeypatch):
"Cli loads local env before config defaults\n\nTags: node, startup"
import importlib
from meshnet_node import cli as cli_mod
@@ -2388,6 +2400,7 @@ def test_cli_loads_local_env_before_config_defaults(tmp_path, monkeypatch):
def test_default_quantization_is_auto(monkeypatch):
"Default quantization is auto\n\nTags: node, startup"
import importlib
from meshnet_node import config as config_mod
@@ -2401,6 +2414,7 @@ def test_default_quantization_is_auto(monkeypatch):
def test_auto_quantization_uses_native_model_dtype_for_unquantized_config():
"Auto quantization uses native model dtype for unquantized config\n\nTags: node, startup"
from meshnet_node.model_backend import _model_load_plan
class AutoConfigStub:
@@ -2427,6 +2441,7 @@ def test_auto_quantization_uses_native_model_dtype_for_unquantized_config():
def test_auto_quantization_preserves_native_quantized_config():
"Auto quantization preserves native quantized config\n\nTags: node, startup"
from meshnet_node.model_backend import _model_load_plan
class AutoConfigStub: