Commit only for debugging Container

This commit is contained in:
Luis Hebendanz 2023-10-25 11:30:38 +02:00
parent efd201c7c5
commit b1d0129fc0
4 changed files with 10 additions and 3 deletions

View File

@ -8,7 +8,7 @@ from pydantic import AnyUrl, BaseModel
from ..async_cmd import run
from ..dirs import specific_flake_dir
from ..nix import nix_config, nix_eval
from ..debug import repro_env_break
class VmConfig(BaseModel):
flake_url: AnyUrl | Path
@ -22,6 +22,7 @@ class VmConfig(BaseModel):
async def inspect_vm(flake_url: AnyUrl | Path, flake_attr: str) -> VmConfig:
config = nix_config()
system = config["system"]
cmd = nix_eval(
[
f'{flake_url}#clanInternals.machines."{system}"."{flake_attr}".config.system.clan.vm.config'

View File

@ -34,6 +34,7 @@
, gnupg
, e2fsprogs
, mypy
, cntr
}:
let

View File

@ -21,7 +21,7 @@ testpaths = "tests"
faulthandler_timeout = 60
log_level = "DEBUG"
log_format = "%(levelname)s: %(message)s"
addopts = "--cov . --cov-report term --cov-report html:.reports/html --no-cov-on-fail --durations 5 --color=yes --maxfail=1 --new-first -nauto" # Add --pdb for debugging
addopts = "--cov . --cov-report term --cov-report html:.reports/html --no-cov-on-fail --durations 5 --color=yes --maxfail=1 --new-first -n0 -s" # Add --pdb for debugging
norecursedirs = "tests/helpers"
markers = [ "impure" ]

View File

@ -1,7 +1,9 @@
import pytest
from api import TestClient
from fixtures_flakes import FlakeForTest
from clan_cli.debug import repro_env_break
import sys
import time
@pytest.mark.impure
def test_inspect(api: TestClient, test_flake_with_core: FlakeForTest) -> None:
@ -10,6 +12,9 @@ def test_inspect(api: TestClient, test_flake_with_core: FlakeForTest) -> None:
json=dict(flake_url=str(test_flake_with_core.path), flake_attr="vm1"),
)
print(f"SLEEPING FOR EVER: {99999}", file=sys.stderr)
time.sleep(99999)
assert response.status_code == 200, f"Failed to inspect vm: {response.text}"
config = response.json()["config"]
assert config.get("flake_attr") == "vm1"