From 32ad6b98337c3fea74050325bd99c5f792d6f562 Mon Sep 17 00:00:00 2001 From: Richard Marko Date: Wed, 15 Nov 2023 15:40:29 +0100 Subject: [PATCH] add BuildStatus ResolvesToAlreadyValid and NoSubstituters --- hnix-store-core/CHANGELOG.md | 1 + hnix-store-core/src/System/Nix/Build.hs | 2 ++ hnix-store-remote/tests/SerializeSpec.hs | 28 +++++++++++++----------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/hnix-store-core/CHANGELOG.md b/hnix-store-core/CHANGELOG.md index 4f890481..a09f8a25 100644 --- a/hnix-store-core/CHANGELOG.md +++ b/hnix-store-core/CHANGELOG.md @@ -8,6 +8,7 @@ * `BuildResult`s `timesBuild` field changes type from `Integer` to `Int` [#231](https://github.com/haskell-nix/hnix-store/pull/231) * Additions: + * `BuildStatus` grows `NoSubstituters` and `ResolvesToAlreadyValid` constructors [#231](https://github.com/haskell-nix/hnix-store/pull/231) * `InvalidPathError` replacing previous stringy error [#231](https://github.com/haskell-nix/hnix-store/pull/231) * Added `Arbitrary` instances for (exported by default) [#230](https://github.com/haskell-nix/hnix-store/pull/230) * `StorePath` diff --git a/hnix-store-core/src/System/Nix/Build.hs b/hnix-store-core/src/System/Nix/Build.hs index ed774bd8..19919ee7 100644 --- a/hnix-store-core/src/System/Nix/Build.hs +++ b/hnix-store-core/src/System/Nix/Build.hs @@ -36,6 +36,8 @@ data BuildStatus = | DependencyFailed | LogLimitExceeded | NotDeterministic + | ResolvesToAlreadyValid + | NoSubstituters deriving (Eq, Generic, Ord, Enum, Show) deriving Arbitrary via GenericArbitrary BuildStatus diff --git a/hnix-store-remote/tests/SerializeSpec.hs b/hnix-store-remote/tests/SerializeSpec.hs index a4a1836d..c3485749 100644 --- a/hnix-store-remote/tests/SerializeSpec.hs +++ b/hnix-store-remote/tests/SerializeSpec.hs @@ -115,16 +115,18 @@ spec_buildMode = it' "Check" System.Nix.Build.Check 2 describe "BuildStatus enum order matches Nix" $ do - it' "Built" System.Nix.Build.Built 0 - it' "Substituted" System.Nix.Build.Substituted 1 - it' "AlreadyValid" System.Nix.Build.AlreadyValid 2 - it' "PermanentFailure" System.Nix.Build.PermanentFailure 3 - it' "InputRejected" System.Nix.Build.InputRejected 4 - it' "OutputRejected" System.Nix.Build.OutputRejected 5 - it' "TransientFailure" System.Nix.Build.TransientFailure 6 - it' "CachedFailure" System.Nix.Build.CachedFailure 7 - it' "TimedOut" System.Nix.Build.TimedOut 8 - it' "MiscFailure" System.Nix.Build.MiscFailure 9 - it' "DependencyFailed" System.Nix.Build.DependencyFailed 10 - it' "LogLimitExceeded" System.Nix.Build.LogLimitExceeded 11 - it' "NotDeterministic" System.Nix.Build.NotDeterministic 12 + it' "Built" System.Nix.Build.Built 0 + it' "Substituted" System.Nix.Build.Substituted 1 + it' "AlreadyValid" System.Nix.Build.AlreadyValid 2 + it' "PermanentFailure" System.Nix.Build.PermanentFailure 3 + it' "InputRejected" System.Nix.Build.InputRejected 4 + it' "OutputRejected" System.Nix.Build.OutputRejected 5 + it' "TransientFailure" System.Nix.Build.TransientFailure 6 + it' "CachedFailure" System.Nix.Build.CachedFailure 7 + it' "TimedOut" System.Nix.Build.TimedOut 8 + it' "MiscFailure" System.Nix.Build.MiscFailure 9 + it' "DependencyFailed" System.Nix.Build.DependencyFailed 10 + it' "LogLimitExceeded" System.Nix.Build.LogLimitExceeded 11 + it' "NotDeterministic" System.Nix.Build.NotDeterministic 12 + it' "ResolvesToAlreadyValid" System.Nix.Build.ResolvesToAlreadyValid 13 + it' "NoSubstituters" System.Nix.Build.NoSubstituters 14