mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-05-05 15:33:00 +00:00
wip: tests
Some checks failed
Nix / check-zig-cache-hash (push) Has been cancelled
Test / test (push) Has been cancelled
Test / prettier (push) Has been cancelled
Test / alejandra (push) Has been cancelled
Test / typos (push) Has been cancelled
Test / translations (push) Has been cancelled
Nix / Required Checks: Nix (push) Has been cancelled
Test / Required Checks: Test (push) Has been cancelled
Test / build-bench (push) Has been cancelled
Test / build-flatpak (push) Has been cancelled
Test / build-linux (namespace-profile-ghostty-md) (push) Has been cancelled
Test / build-linux (namespace-profile-ghostty-md-arm64) (push) Has been cancelled
Test / build-linux-libghostty (push) Has been cancelled
Test / build-nix (namespace-profile-ghostty-md) (push) Has been cancelled
Test / build-nix (namespace-profile-ghostty-md-arm64) (push) Has been cancelled
Test / build-macos (push) Has been cancelled
Test / build-macos-matrix (push) Has been cancelled
Test / build-snap (namespace-profile-ghostty-snap) (push) Has been cancelled
Test / build-snap (namespace-profile-ghostty-snap-arm64) (push) Has been cancelled
Test / build-windows (push) Has been cancelled
Test / build-windows-cross (namespace-profile-ghostty-md, x86-windows-gnu) (push) Has been cancelled
Test / build-windows-cross (namespace-profile-ghostty-md, x86_64-windows-gnu) (push) Has been cancelled
Test / GTK x11=${{ matrix.x11 }} wayland=${{ matrix.wayland }} (false, false) (push) Has been cancelled
Test / GTK x11=${{ matrix.x11 }} wayland=${{ matrix.wayland }} (false, true) (push) Has been cancelled
Test / GTK x11=${{ matrix.x11 }} wayland=${{ matrix.wayland }} (true, false) (push) Has been cancelled
Test / GTK x11=${{ matrix.x11 }} wayland=${{ matrix.wayland }} (true, true) (push) Has been cancelled
Test / Build -Dsentry=${{ matrix.sentry }} (false) (push) Has been cancelled
Test / Build -Dsentry=${{ matrix.sentry }} (true) (push) Has been cancelled
Test / test-macos (push) Has been cancelled
Test / Test pkg/${{ matrix.pkg }} (wuffs) (push) Has been cancelled
Test / Test build on Debian 12 (push) Has been cancelled
Some checks failed
Nix / check-zig-cache-hash (push) Has been cancelled
Test / test (push) Has been cancelled
Test / prettier (push) Has been cancelled
Test / alejandra (push) Has been cancelled
Test / typos (push) Has been cancelled
Test / translations (push) Has been cancelled
Nix / Required Checks: Nix (push) Has been cancelled
Test / Required Checks: Test (push) Has been cancelled
Test / build-bench (push) Has been cancelled
Test / build-flatpak (push) Has been cancelled
Test / build-linux (namespace-profile-ghostty-md) (push) Has been cancelled
Test / build-linux (namespace-profile-ghostty-md-arm64) (push) Has been cancelled
Test / build-linux-libghostty (push) Has been cancelled
Test / build-nix (namespace-profile-ghostty-md) (push) Has been cancelled
Test / build-nix (namespace-profile-ghostty-md-arm64) (push) Has been cancelled
Test / build-macos (push) Has been cancelled
Test / build-macos-matrix (push) Has been cancelled
Test / build-snap (namespace-profile-ghostty-snap) (push) Has been cancelled
Test / build-snap (namespace-profile-ghostty-snap-arm64) (push) Has been cancelled
Test / build-windows (push) Has been cancelled
Test / build-windows-cross (namespace-profile-ghostty-md, x86-windows-gnu) (push) Has been cancelled
Test / build-windows-cross (namespace-profile-ghostty-md, x86_64-windows-gnu) (push) Has been cancelled
Test / GTK x11=${{ matrix.x11 }} wayland=${{ matrix.wayland }} (false, false) (push) Has been cancelled
Test / GTK x11=${{ matrix.x11 }} wayland=${{ matrix.wayland }} (false, true) (push) Has been cancelled
Test / GTK x11=${{ matrix.x11 }} wayland=${{ matrix.wayland }} (true, false) (push) Has been cancelled
Test / GTK x11=${{ matrix.x11 }} wayland=${{ matrix.wayland }} (true, true) (push) Has been cancelled
Test / Build -Dsentry=${{ matrix.sentry }} (false) (push) Has been cancelled
Test / Build -Dsentry=${{ matrix.sentry }} (true) (push) Has been cancelled
Test / test-macos (push) Has been cancelled
Test / Test pkg/${{ matrix.pkg }} (wuffs) (push) Has been cancelled
Test / Test build on Debian 12 (push) Has been cancelled
Not meant for merging.
This commit is contained in:
parent
0f2f0ab69f
commit
f9b7ba36d9
39
flake.nix
39
flake.nix
@ -47,6 +47,11 @@
|
||||
system: let
|
||||
pkgs-stable = nixpkgs-stable.legacyPackages.${system};
|
||||
pkgs-unstable = nixpkgs-unstable.legacyPackages.${system};
|
||||
|
||||
# These are all of our VM tests.
|
||||
tests = import ./nix/tests/default.nix {
|
||||
nixpkgs = pkgs-unstable;
|
||||
};
|
||||
in {
|
||||
devShell.${system} = pkgs-stable.callPackage ./nix/devShell.nix {
|
||||
zig = zig.packages.${system}."0.14.0";
|
||||
@ -72,6 +77,8 @@
|
||||
|
||||
formatter.${system} = pkgs-stable.alejandra;
|
||||
|
||||
checks.${system} = tests;
|
||||
|
||||
apps.${system} = let
|
||||
runVM = (
|
||||
module: let
|
||||
@ -91,15 +98,29 @@
|
||||
program = "${program}";
|
||||
}
|
||||
);
|
||||
in {
|
||||
wayland-cinnamon = runVM ./nix/vm/wayland-cinnamon.nix;
|
||||
wayland-gnome = runVM ./nix/vm/wayland-gnome.nix;
|
||||
wayland-plasma6 = runVM ./nix/vm/wayland-plasma6.nix;
|
||||
x11-cinnamon = runVM ./nix/vm/x11-cinnamon.nix;
|
||||
x11-gnome = runVM ./nix/vm/x11-gnome.nix;
|
||||
x11-plasma6 = runVM ./nix/vm/x11-plasma6.nix;
|
||||
x11-xfce = runVM ./nix/vm/x11-xfce.nix;
|
||||
};
|
||||
in
|
||||
{
|
||||
wayland-cinnamon = runVM ./nix/vm/wayland-cinnamon.nix;
|
||||
wayland-gnome = runVM ./nix/vm/wayland-gnome.nix;
|
||||
wayland-plasma6 = runVM ./nix/vm/wayland-plasma6.nix;
|
||||
x11-cinnamon = runVM ./nix/vm/x11-cinnamon.nix;
|
||||
x11-gnome = runVM ./nix/vm/x11-gnome.nix;
|
||||
x11-plasma6 = runVM ./nix/vm/x11-plasma6.nix;
|
||||
x11-xfce = runVM ./nix/vm/x11-xfce.nix;
|
||||
}
|
||||
// (pkgs-stable.lib.mapAttrs' (
|
||||
# This adds all of our VM tests as runnable apps that load
|
||||
# the interactive driver (repl). We map all the names of the
|
||||
# tests to "test-<name>" so its distinct from other apps.
|
||||
name: value: {
|
||||
name = "test-${name}";
|
||||
value = {
|
||||
type = "app";
|
||||
program = pkgs-unstable.lib.getExe tests.${name}.driverInteractive;
|
||||
};
|
||||
}
|
||||
)
|
||||
tests);
|
||||
}
|
||||
# Our supported systems are the same supported systems as the Zig binaries.
|
||||
) (builtins.attrNames zig.packages)
|
||||
|
26
nix/tests/basic.nix
Normal file
26
nix/tests/basic.nix
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
name = "basic";
|
||||
|
||||
nodes.machine = {
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
users.users.alice = {
|
||||
isNormalUser = true;
|
||||
extraGroups = ["wheel"];
|
||||
packages = with pkgs; [
|
||||
firefox
|
||||
(pkgs.callPackage ../package.nix {})
|
||||
];
|
||||
};
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
machine.wait_for_unit("default.target")
|
||||
machine.succeed("su -- alice -c 'which firefox'")
|
||||
machine.fail("su -- root -c 'which firefox'")
|
||||
'';
|
||||
}
|
14
nix/tests/default.nix
Normal file
14
nix/tests/default.nix
Normal file
@ -0,0 +1,14 @@
|
||||
{nixpkgs}: let
|
||||
# mkTest does nothing special right now, its just a wrapper around
|
||||
# runNixOSTest, but it could be extended in the future so I pulled it out.
|
||||
mkTest = path:
|
||||
nixpkgs.testers.runNixOSTest {
|
||||
imports = [
|
||||
path
|
||||
];
|
||||
};
|
||||
in {
|
||||
basic = mkTest ./basic.nix;
|
||||
gnome = mkTest ./gnome.nix;
|
||||
i3 = mkTest ./i3.nix;
|
||||
}
|
56
nix/tests/gnome.nix
Normal file
56
nix/tests/gnome.nix
Normal file
@ -0,0 +1,56 @@
|
||||
{
|
||||
name = "gnome";
|
||||
|
||||
nodes.machine = {
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
users.users.alice = {
|
||||
isNormalUser = true;
|
||||
password = "alice";
|
||||
extraGroups = ["wheel"];
|
||||
packages = with pkgs; [
|
||||
(pkgs.callPackage ../package.nix {})
|
||||
];
|
||||
};
|
||||
|
||||
services.xserver.enable = true;
|
||||
|
||||
services.xserver.displayManager = {
|
||||
gdm.enable = true;
|
||||
gdm.debug = true;
|
||||
};
|
||||
|
||||
services.displayManager.autoLogin = {
|
||||
enable = true;
|
||||
user = "alice";
|
||||
};
|
||||
|
||||
services.xserver.desktopManager.gnome.enable = true;
|
||||
services.xserver.desktopManager.gnome.debug = true;
|
||||
|
||||
systemd.user.services = {
|
||||
"org.gnome.Shell@wayland" = {
|
||||
serviceConfig = {
|
||||
ExecStart = [
|
||||
# Clear the list before overriding it.
|
||||
""
|
||||
# Eval API is now internal so Shell needs to run in unsafe mode.
|
||||
# TODO: improve test driver so that it supports openqa-like manipulation
|
||||
# that would allow us to drop this mess.
|
||||
"${pkgs.gnome-shell}/bin/gnome-shell --unsafe-mode"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
machine.wait_for_unit("default.target")
|
||||
machine.succeed("su -- alice -c 'which firefox'")
|
||||
machine.fail("su -- root -c 'which firefox'")
|
||||
'';
|
||||
}
|
59
nix/tests/i3.nix
Normal file
59
nix/tests/i3.nix
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
name = "gnome";
|
||||
|
||||
nodes.machine = {
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
users.users.alice = {
|
||||
isNormalUser = true;
|
||||
password = "alice";
|
||||
extraGroups = ["wheel"];
|
||||
packages = with pkgs; [
|
||||
(pkgs.callPackage ../package.nix {})
|
||||
];
|
||||
};
|
||||
|
||||
# We need an XDG portal for various applications to work properly,
|
||||
# such as Flatpak applications.
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
config.common.default = "*";
|
||||
};
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
xkb.layout = "us";
|
||||
dpi = 220;
|
||||
|
||||
desktopManager = {
|
||||
xterm.enable = false;
|
||||
wallpaper.mode = "fill";
|
||||
};
|
||||
|
||||
displayManager = {
|
||||
defaultSession = "none+i3";
|
||||
lightdm.enable = true;
|
||||
};
|
||||
|
||||
windowManager = {
|
||||
i3.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.displayManager.autoLogin = {
|
||||
enable = true;
|
||||
user = "alice";
|
||||
};
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
machine.wait_for_unit("default.target")
|
||||
machine.succeed("su -- alice -c 'which firefox'")
|
||||
machine.fail("su -- root -c 'which firefox'")
|
||||
'';
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user