From 3a661a77f76e64276f9da1c55785ed4af1392fb1 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Tue, 1 Jul 2025 11:23:34 +0100 Subject: [PATCH] nexusmods-app: run tests in a passthru Avoid running `dotnet test` in the main package: - The test-suite is slow - Some tests fail intermittently - The package is often uncached; especially the unfree variant Instead, we can enable tests in a `passthru.tests` override. --- pkgs/by-name/ne/nexusmods-app/package.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ne/nexusmods-app/package.nix b/pkgs/by-name/ne/nexusmods-app/package.nix index 35a6aa834ef2..70b90ec17b02 100644 --- a/pkgs/by-name/ne/nexusmods-app/package.nix +++ b/pkgs/by-name/ne/nexusmods-app/package.nix @@ -118,7 +118,12 @@ buildDotnetModule (finalAttrs: { "--property:DefineConstants=${lib.strings.concatStringsSep "%3B" constants}" ]; - doCheck = true; + # Avoid running `dotnet test` in the main package: + # - The test-suite is slow + # - Some tests fail intermittently + # - The package is often uncached; especially the unfree variant + # - We can enable tests in a `passthru.tests` override + doCheck = false; dotnetTestFlags = [ "--environment=USER=nobody" @@ -174,6 +179,14 @@ buildDotnetModule (finalAttrs: { runHook postInstallCheck ''; + passthru.tests = { + # Build the package and run `dotnet test` + app = finalAttrs.finalPackage.overrideAttrs { + pname = "${finalAttrs.pname}-tested"; + doCheck = true; + }; + }; + passthru.updateScript = nix-update-script { }; meta = {