From f391cba8413982d1e033e85d47b282caefef7e4f Mon Sep 17 00:00:00 2001 From: Sizhe Zhao Date: Sun, 13 Jul 2025 22:54:36 +0800 Subject: [PATCH] nixosTests.vscodium: handleTest -> runTest --- nixos/tests/all-tests.nix | 2 +- nixos/tests/vscodium.nix | 31 ++++++++++++++----------------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 4664120c75db..7aa2dbdbdaf5 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -1528,7 +1528,7 @@ in virtualbox = handleTestOn [ "x86_64-linux" ] ./virtualbox.nix { }; vm-variant = handleTest ./vm-variant.nix { }; vscode-remote-ssh = handleTestOn [ "x86_64-linux" ] ./vscode-remote-ssh.nix { }; - vscodium = discoverTests (import ./vscodium.nix); + vscodium = import ./vscodium.nix { inherit runTest; }; vsftpd = runTest ./vsftpd.nix; waagent = runTest ./waagent.nix; wakapi = runTest ./wakapi.nix; diff --git a/nixos/tests/vscodium.nix b/nixos/tests/vscodium.nix index a3efd07bf501..8badad20b03c 100644 --- a/nixos/tests/vscodium.nix +++ b/nixos/tests/vscodium.nix @@ -1,12 +1,13 @@ +{ runTest }: let tests = { wayland = - { pkgs, ... }: + { lib, pkgs, ... }: { imports = [ ./common/wayland-cage.nix ]; # We scale vscodium to help OCR find the small "Untitled" text. - services.cage.program = "${pkgs.vscodium}/bin/codium --force-device-scale-factor=2"; + services.cage.program = "${lib.getExe pkgs.vscodium} --force-device-scale-factor=2"; environment.variables.NIXOS_OZONE_WL = "1"; environment.variables.DISPLAY = "do not use"; @@ -14,7 +15,7 @@ let fonts.packages = with pkgs; [ dejavu_fonts ]; }; xorg = - { pkgs, ... }: + { lib, pkgs, ... }: { imports = [ ./common/user-account.nix @@ -24,7 +25,7 @@ let virtualisation.memorySize = 2047; services.xserver.enable = true; services.xserver.displayManager.sessionCommands = '' - ${pkgs.vscodium}/bin/codium --force-device-scale-factor=2 + ${lib.getExe pkgs.vscodium} --force-device-scale-factor=2 ''; test-support.displayManager.auto.user = "alice"; }; @@ -32,21 +33,18 @@ let mkTest = name: machine: - import ./make-test-python.nix ( - { pkgs, ... }: + runTest ( + { lib, ... }: { inherit name; - nodes = { - "${name}" = machine; - }; + nodes."${name}" = machine; + + meta.maintainers = with lib.maintainers; [ + synthetica + turion + ]; - meta = with pkgs.lib.maintainers; { - maintainers = [ - synthetica - turion - ]; - }; enableOCR = true; testScript = '' @@ -91,6 +89,5 @@ let ''; } ); - in -builtins.mapAttrs (k: v: mkTest k v) tests +builtins.mapAttrs mkTest tests