mark vm tests as pure

This commit is contained in:
Jörg Thalheim
2025-08-18 12:33:49 +02:00
parent abf6893714
commit 2d264a8e5e
2 changed files with 17 additions and 6 deletions

View File

@@ -13,7 +13,7 @@ from clan_lib.machines.machines import Machine
from clan_lib.nix import nix_eval, run
@pytest.mark.impure
@pytest.mark.with_core
@pytest.mark.skipif(sys.platform == "darwin", reason="preload doesn't work on darwin")
def test_vm_deployment(
vm_test_flake: Path,

View File

@@ -25,14 +25,14 @@ def test_inspect(
@pytest.mark.skipif(no_kvm, reason="Requires KVM")
@pytest.mark.impure
@pytest.mark.with_core
def test_run(
monkeypatch: pytest.MonkeyPatch,
test_flake_with_core: FlakeForTest,
vm_test_flake: Path,
age_keys: list["KeyPair"],
) -> None:
with monkeypatch.context():
monkeypatch.chdir(test_flake_with_core.path)
monkeypatch.chdir(vm_test_flake)
monkeypatch.setenv("SOPS_AGE_KEY", age_keys[0].privkey)
cli.run(
@@ -53,11 +53,22 @@ def test_run(
"user1",
]
)
cli.run(["vms", "run", "--no-block", "vm1", "-c", "shutdown", "-h", "now"])
cli.run(
[
"vms",
"run",
"--no-block",
"test-vm-deployment",
"-c",
"shutdown",
"-h",
"now",
]
)
@pytest.mark.skipif(no_kvm, reason="Requires KVM")
@pytest.mark.impure
@pytest.mark.with_core
def test_vm_persistence(
vm_test_flake: Path,
) -> None: