From 2d264a8e5ecfedd42c051225b5a767797b56be2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 18 Aug 2025 12:33:49 +0200 Subject: [PATCH] mark vm tests as pure --- .../clan_cli/tests/test_vars_deployment.py | 2 +- pkgs/clan-cli/clan_cli/tests/test_vms_cli.py | 21 ++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/tests/test_vars_deployment.py b/pkgs/clan-cli/clan_cli/tests/test_vars_deployment.py index a5d726c9d..a06965d56 100644 --- a/pkgs/clan-cli/clan_cli/tests/test_vars_deployment.py +++ b/pkgs/clan-cli/clan_cli/tests/test_vars_deployment.py @@ -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, diff --git a/pkgs/clan-cli/clan_cli/tests/test_vms_cli.py b/pkgs/clan-cli/clan_cli/tests/test_vms_cli.py index a39b2a309..65ca67fe9 100644 --- a/pkgs/clan-cli/clan_cli/tests/test_vms_cli.py +++ b/pkgs/clan-cli/clan_cli/tests/test_vms_cli.py @@ -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: