Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change testTarget -> testTargets #646

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

TeofilC
Copy link
Contributor

@TeofilC TeofilC commented Feb 10, 2025

We refactor testTarget from an unstructured string, to a list of strings representing testTargets.

See the corresponding nixpkgs PR: https://github.com/NixOS/nixpkgs/pull/306283/files

Copy link
Member

@sternenseemann sternenseemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -123,7 +123,7 @@ hooks =
, ("hlibgit2 >= 0.18.0.14", set (testDepends . tool . contains (pkg "git")) True)
, ("hmatrix < 0.18.1.1", set phaseOverrides "preConfigure = \"sed -i hmatrix.cabal -e '/\\\\/usr\\\\//D'\";")
, ("holy-project", set doCheck False) -- attempts to access the network
, ("hoogle", set testTarget "--test-option=--no-net")
, ("hoogle", set testTargets ["--test-option=--no-net"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be testFlags instead, but I suspect cabal2nix doesn't know about it yet. Maybe something to take care of in a follow up change / #504.

We refactor testTarget from an unstructured string, to a list of strings
representing testTargets.

See the corresponding nixpkgs PR: https://github.com/NixOS/nixpkgs/pull/306283/files

Co-authored-by: sternenseemann <[email protected]>
@sternenseemann
Copy link
Member

sternenseemann commented Feb 11, 2025

Result (zero rebuilds!):

diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix
index bd0fb7354264..503a37fe3a30 100644
--- a/pkgs/development/haskell-modules/hackage-packages.nix
+++ b/pkgs/development/haskell-modules/hackage-packages.nix
@@ -92690,7 +92690,7 @@ self: {
        ];
        testToolDepends = [ hspec-discover ];
        doHaddock = false;
-       testTarget = "spec";
+       testTargets = [ "spec" ];
        description = "DNS library in Haskell";
        license = lib.licenses.bsd3;
      }) {};
@@ -157039,7 +157039,7 @@ self: {
          wai wai-logger warp warp-tls zlib
        ];
        executableHaskellDepends = [ base ];
-       testTarget = "--test-option=--no-net";
+       testTargets = [ "--test-option=--no-net" ];
        description = "Haskell API Search";
        license = lib.licenses.bsd3;
        mainProgram = "hoogle";
@@ -163560,7 +163560,7 @@ self: {
          transformers
        ];
        testToolDepends = [ hspec-meta ];
-       testTarget = "--test-option=--skip --test-option='Test.Hspec.Core.Runner.hspecResult runs specs in parallel'";
+       testTargets = [ "--test-option=--skip" "--test-option='Test.Hspec.Core.Runner.hspecResult runs specs in parallel'" ];
        description = "A Testing Framework for Haskell";
        license = lib.licenses.mit;
        hydraPlatforms = lib.platforms.none;
@@ -163589,7 +163589,7 @@ self: {
          temporary tf-random time transformers
        ];
        testToolDepends = [ hspec-meta ];
-       testTarget = "--test-option=--skip --test-option='Test.Hspec.Core.Runner.hspecResult runs specs in parallel'";
+       testTargets = [ "--test-option=--skip" "--test-option='Test.Hspec.Core.Runner.hspecResult runs specs in parallel'" ];
        description = "A Testing Framework for Haskell";
        license = lib.licenses.mit;
      }) {};

@sternenseemann sternenseemann merged commit 1a77d06 into NixOS:master Feb 11, 2025
7 checks passed
@TeofilC
Copy link
Contributor Author

TeofilC commented Feb 11, 2025

Thanks!

@TeofilC TeofilC deleted the wip/teo/testTargets branch February 11, 2025 14:31
@sternenseemann

This comment was marked as outdated.

@sternenseemann
Copy link
Member

Disregard the comment above, I was looking at the wrong PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants