aurral: run unit and integration tests

Assisted-by: Codex, gpt-5.6-sol medium
This commit is contained in:
Ihar Hrachyshka
2026-09-18 20:39:22 -04:00
parent 872c024f59
commit ec44ef9316

View File

@@ -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