From ec44ef9316205191ec2b21b5a11aa383b7abca65 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Fri, 18 Sep 2026 20:39:22 -0400 Subject: [PATCH] aurral: run unit and integration tests Assisted-by: Codex, gpt-5.6-sol medium --- pkgs/by-name/au/aurral/package.nix | 41 ++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/au/aurral/package.nix b/pkgs/by-name/au/aurral/package.nix index 65ed1cc1e821..d471f124b484 100644 --- a/pkgs/by-name/au/aurral/package.nix +++ b/pkgs/by-name/au/aurral/package.nix @@ -2,6 +2,7 @@ lib, buildNpmPackage, fetchFromGitHub, + gitMinimal, nix-update-script, nodejs_26, sqlite, @@ -33,11 +34,26 @@ buildNpmPackage (finalAttrs: { ./package.json.patch ]; + # https://github.com/lklynet/aurral/pull/873 + postPatch = '' + # Keep automatic ports above Fetch's highest blocked port (10080). + substituteInPlace .tests/helpers/backendTestHarness.js \ + --replace-fail '4100 + Math.floor(Math.random() * 1000)' \ + '11000 + Math.floor(Math.random() * 1000)' + ''; + npmDepsHash = "sha256-NVz5eqDDtMBKiTDl3aX0pHBYGTcYal8lmCf8mbKu31I="; nodejs = nodejs_26; env.VITE_APP_VERSION = finalAttrs.version; + env.LD_LIBRARY_PATH = lib.makeLibraryPath [ sqlite ]; + env.FONTCONFIG_FILE = makeFontsConf { + fontDirectories = [ + noto-fonts-color-emoji + dejavu_fonts + ]; + }; npmInstallFlags = [ "--include=optional" @@ -46,6 +62,22 @@ buildNpmPackage (finalAttrs: { npmBuildFlags = [ "--workspace=frontend" ]; + doCheck = true; + + nativeCheckInputs = [ + ffmpeg + gitMinimal + ]; + + checkPhase = '' + runHook preCheck + + npm test + npm run test:integration + + runHook postCheck + ''; + npmPruneFlags = [ "--workspace=backend" "--include=optional" @@ -69,14 +101,7 @@ buildNpmPackage (finalAttrs: { yt-dlp ] }\''${PATH:+:}\$PATH - export FONTCONFIG_FILE=${ - makeFontsConf { - fontDirectories = [ - noto-fonts-color-emoji - dejavu_fonts - ]; - } - } + export FONTCONFIG_FILE=${finalAttrs.env.FONTCONFIG_FILE} export APP_VERSION=${finalAttrs.version} export NODE_ENV=production case "\$1" in