Begin Firecracker microVM support

This commit is contained in:
Joakim Hellsén 2026-04-25 06:34:37 +02:00
commit ed8ad1bee9
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
11 changed files with 290 additions and 7 deletions

View file

@ -0,0 +1,36 @@
from __future__ import annotations
from unittest.mock import patch
from django.test import override_settings
from config.checks import check_required_dev_commands
@override_settings(DEBUG=False, TESTING=False)
def test_command_check_is_silent_in_production_runtime() -> None:
"""Production runtime must not warn about dev-only command dependencies."""
with patch("config.checks.shutil.which", return_value=None):
warnings = check_required_dev_commands()
assert warnings == []
@override_settings(DEBUG=True, TESTING=False)
def test_command_check_warns_and_mentions_dev_only_dependencies() -> None:
"""Dev runtime must warn and clearly label these dependencies as dev-only."""
def fake_which(command: str) -> str | None:
if command == "curl":
return None
return f"/usr/bin/{command}"
with patch("config.checks.shutil.which", side_effect=fake_which):
warnings = check_required_dev_commands()
assert len(warnings) == 1
warning = warnings[0]
assert warning.id == "tussilago.W001"
assert warning.hint is not None
assert "Dev-only tooling missing" in warning.hint
assert "curl" in warning.hint