From d306a6025e228e4112f40f002826cf3109f6df14 Mon Sep 17 00:00:00 2001 From: Ethan Carter Edwards Date: Sun, 17 Aug 2025 05:22:35 -0400 Subject: [PATCH] slipshow: init nixos test Signed-off-by: Ethan Carter Edwards --- nixos/tests/all-tests.nix | 1 + nixos/tests/slipshow.nix | 35 ++++++++++++++++++++++++++++ pkgs/by-name/sl/slipshow/package.nix | 6 ++++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 nixos/tests/slipshow.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 948c86833ae6..772af034f8f8 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -1348,6 +1348,7 @@ in simple = runTest ./simple.nix; sing-box = runTest ./sing-box.nix; slimserver = runTest ./slimserver.nix; + slipshow = runTest ./slipshow.nix; slurm = runTest ./slurm.nix; snmpd = runTest ./snmpd.nix; smokeping = runTest ./smokeping.nix; diff --git a/nixos/tests/slipshow.nix b/nixos/tests/slipshow.nix new file mode 100644 index 000000000000..40e0f0be620e --- /dev/null +++ b/nixos/tests/slipshow.nix @@ -0,0 +1,35 @@ +{ + lib, + pkgs, + ... +}: +{ + name = "slipshow presentation test"; + + meta.maintainers = with lib.maintainers; [ ethancedwards8 ]; + + nodes.machine = { + environment.systemPackages = with pkgs; [ slipshow ]; + + environment.etc."slipshow".source = pkgs.fetchFromGitHub { + owner = "meithecatte"; + repo = "bbslides"; + rev = "ce1c08cafa71ae36dda8cc581956548b8386ae16"; + hash = "sha256-sOydmvtDeMhNejDkwlsXdrbwtqN6lcNnzTnGzBVRFxA="; + }; + }; + + testScript = + { nodes, ... }: + '' + start_all() + + # it may take around a minute to compile the file and serve it + machine.succeed("slipshow serve /etc/slipshow/bbslides.md &>/dev/null &") + + # slipshow serves defaultly on :8080 and unfortunately cannot + # be changed currently + machine.wait_for_open_port(8080) + machine.succeed("curl -i 0.0.0.0:8080") + ''; +} diff --git a/pkgs/by-name/sl/slipshow/package.nix b/pkgs/by-name/sl/slipshow/package.nix index 1dafb04b9b84..15b1f52bd8aa 100644 --- a/pkgs/by-name/sl/slipshow/package.nix +++ b/pkgs/by-name/sl/slipshow/package.nix @@ -3,6 +3,7 @@ ocamlPackages, fetchFromGitHub, versionCheckHook, + nixosTests, nix-update-script, }: @@ -49,7 +50,10 @@ ocamlPackages.buildDunePackage rec { versionCheckProgramArg = "--version"; doInstallCheck = true; - passthru.updateScript = nix-update-script { }; + passthru = { + tests = { inherit (nixosTests) slipshow; }; + updateScript = nix-update-script { }; + }; meta = { description = "Engine for displaying slips, the next-gen version of slides";