diff --git a/cabal.project b/cabal.project index a1e7ae4c022..45850f1544f 100644 --- a/cabal.project +++ b/cabal.project @@ -1,5 +1,5 @@ -- run `nix flake lock --update-input hackageNix` after updating index-state. -index-state: 2022-05-09T00:00:00Z +index-state: 2022-05-24T00:00:00Z packages: cardano-api diff --git a/cardano-api/test/Test/Cardano/Api/Typed/TxBody.hs b/cardano-api/test/Test/Cardano/Api/Typed/TxBody.hs index f17957f004f..1bb9c18882e 100644 --- a/cardano-api/test/Test/Cardano/Api/Typed/TxBody.hs +++ b/cardano-api/test/Test/Cardano/Api/Typed/TxBody.hs @@ -1,6 +1,8 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TemplateHaskell #-} +{-# OPTIONS_GHC -Wno-deprecations #-} -- TODO Fix deprecations + module Test.Cardano.Api.Typed.TxBody ( tests ) where @@ -8,7 +10,6 @@ module Test.Cardano.Api.Typed.TxBody import Cardano.Prelude import Hedgehog (Property, annotateShow, failure, (===), MonadTest) -import qualified Hedgehog as H import Test.Tasty (TestTree) import Test.Tasty.Hedgehog (testProperty) import Test.Tasty.TH (testGroupGenerator) @@ -19,6 +20,8 @@ import Data.Type.Equality (TestEquality (testEquality)) import Gen.Cardano.Api.Typed import Test.Cardano.Api.Typed.Orphans () +import qualified Hedgehog as H + {- HLINT ignore "Use camelCase" -} -- | Check the txOuts in a TxBodyContent after a ledger roundtrip. diff --git a/cardano-node-chairman/test/Main.hs b/cardano-node-chairman/test/Main.hs index 65c41b501d7..5ec1c17f58e 100644 --- a/cardano-node-chairman/test/Main.hs +++ b/cardano-node-chairman/test/Main.hs @@ -1,6 +1,5 @@ {-# LANGUAGE FlexibleInstances #-} - -{-# OPTIONS_GHC -Wno-deprecations #-} -- TODO Fix deprecations +{-# LANGUAGE OverloadedStrings #-} module Main ( main @@ -20,11 +19,11 @@ import qualified Spec.Network tests :: IO T.TestTree tests = do - let t0 = H.testProperty "isPortOpen False" Spec.Network.hprop_isPortOpen_False - let t1 = H.testProperty "isPortOpen True" Spec.Network.hprop_isPortOpen_True - let t2 = H.testProperty "chairman" Spec.Chairman.Byron.hprop_chairman - let t3 = H.testProperty "chairman" Spec.Chairman.Cardano.hprop_chairman - let t4 = H.testProperty "chairman" Spec.Chairman.Shelley.hprop_chairman + let t0 = H.testPropertyNamed "isPortOpen False" "isportopen-true" Spec.Network.hprop_isPortOpen_False + let t1 = H.testPropertyNamed "isPortOpen True" "isportopen-false" Spec.Network.hprop_isPortOpen_True + let t2 = H.testPropertyNamed "chairman Byron" "chairman-byron" Spec.Chairman.Byron.hprop_chairman + let t3 = H.testPropertyNamed "chairman Cardano" "chairman-cardano" Spec.Chairman.Cardano.hprop_chairman + let t4 = H.testPropertyNamed "chairman Shelley" "chairman-shell" Spec.Chairman.Shelley.hprop_chairman pure $ T.testGroup "test/Spec.hs" [ T.testGroup "Spec" diff --git a/cardano-testnet/test/Main.hs b/cardano-testnet/test/Main.hs index 437d96fc49d..d6486512927 100644 --- a/cardano-testnet/test/Main.hs +++ b/cardano-testnet/test/Main.hs @@ -1,4 +1,7 @@ {-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE ImportQualifiedPost #-} +{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -Wno-deprecations #-} -- TODO Fix deprecations @@ -7,24 +10,26 @@ module Main ) where import Prelude --- import qualified Spec.Cli.KesPeriodInfo -import qualified Spec.Node.Shutdown -import qualified Spec.ShutdownOnSlotSynced -import qualified System.Environment as E import Test.Tasty (TestTree) + +import qualified System.Environment as E import qualified Test.Tasty as T import qualified Test.Tasty.Ingredients as T import qualified Test.Util as H +-- import qualified Spec.Cli.KesPeriodInfo +import qualified Spec.Node.Shutdown +import qualified Spec.ShutdownOnSlotSynced + tests :: IO TestTree tests = pure $ T.testGroup "test/Spec.hs" [ T.testGroup "Spec" - [ H.ignoreOnWindows "Shutdown" Spec.Node.Shutdown.hprop_shutdown - , H.ignoreOnWindows "ShutdownOnSlotSynced" Spec.ShutdownOnSlotSynced.hprop_shutdownOnSlotSynced + [ H.ignoreOnWindows "Spec.Node.Shutdown" "Spec.Node.Shutdown" Spec.Node.Shutdown.hprop_shutdown + , H.ignoreOnWindows "Spec.ShutdownOnSlotSynced" "Spec.ShutdownOnSlotSynced" Spec.ShutdownOnSlotSynced.hprop_shutdownOnSlotSynced -- Ignored on Windows due to : commitBuffer: invalid argument (invalid character) -- as a result of the kes-period-info output to stdout. -- TODO: Babbage temporarily ignored due to broken protocol-state query - -- H.ignoreOnWindows "kes-period-info" Spec.Cli.KesPeriodInfo.hprop_kes_period_info + -- , H.ignoreOnWindows "Spec.Cli.KesPeriodInfo" "Spec.Cli.KesPeriodInfo" Spec.Cli.KesPeriodInfo.hprop_kes_period_info ] ] diff --git a/cardano-testnet/test/Test/Util.hs b/cardano-testnet/test/Test/Util.hs index 762d6156c46..385f1d5e2c7 100644 --- a/cardano-testnet/test/Test/Util.hs +++ b/cardano-testnet/test/Test/Util.hs @@ -8,9 +8,10 @@ module Test.Util ) where import Data.Bool (bool) -import Hedgehog (Property) +import Hedgehog (Property, PropertyName) import Hedgehog.Extras.Stock.OS (isWin32) import Prelude +import Test.Tasty (TestName) import Test.Tasty.ExpectedFailure (wrapTest) import Test.Tasty.Providers (testPassed) import Test.Tasty.Runners (TestTree, Result(resultShortDescription)) @@ -20,17 +21,17 @@ import qualified System.Info as SYS type Os = String -ignoreOnWindows :: String -> Property -> TestTree -ignoreOnWindows pName prop = - bool id (ignoreOn "Windows") isWin32 $ H.testProperty pName prop +ignoreOnWindows :: TestName -> PropertyName -> Property -> TestTree +ignoreOnWindows name propName prop = + bool id (ignoreOn "Windows") isWin32 $ H.testPropertyNamed name propName prop -ignoreOnMac :: String -> Property -> TestTree -ignoreOnMac pName prop = - bool id (ignoreOn "MacOS") isMacOS $ H.testProperty pName prop +ignoreOnMac :: TestName -> PropertyName -> Property -> TestTree +ignoreOnMac name propName prop = + bool id (ignoreOn "MacOS") isMacOS $ H.testPropertyNamed name propName prop -ignoreOnMacAndWindows :: String -> Property -> TestTree -ignoreOnMacAndWindows pName prop = - bool id (ignoreOn "MacOS and Windows") (isMacOS || isWin32) $ H.testProperty pName prop +ignoreOnMacAndWindows :: TestName -> PropertyName -> Property -> TestTree +ignoreOnMacAndWindows name propName prop = + bool id (ignoreOn "MacOS and Windows") (isMacOS || isWin32) $ H.testPropertyNamed name propName prop isMacOS :: Bool isMacOS = SYS.os == "darwin" diff --git a/flake.lock b/flake.lock index 0a482ec0c35..5b8187a8083 100644 --- a/flake.lock +++ b/flake.lock @@ -2952,11 +2952,11 @@ "hackageNix": { "flake": false, "locked": { - "lastModified": 1652577195, - "narHash": "sha256-BpjiUhjS1k3qWmGrMqhh/kPit8PEpLGFMAsQzGuAA1Q=", + "lastModified": 1653441966, + "narHash": "sha256-aJFK0wDzoOrtb7ucZzKh5J+S2pThpwNCofl74s1olXU=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "b0eecedf42be238ab752cf9c2d3ee86d33aa9d4c", + "rev": "f7fe6ef8de52c43a9efa6fd4ac4902e5957dc573", "type": "github" }, "original": { @@ -3636,11 +3636,11 @@ "stackage": "stackage_2" }, "locked": { - "lastModified": 1649639788, - "narHash": "sha256-nBzRclDcVCEwrIMOYTNOZltd0bUhSyTk0c3UIrjqFhI=", + "lastModified": 1653442077, + "narHash": "sha256-VXdXFcdnxR+trZ1J/kRvYMxa1Lemc8D5lUxTpzR8xII=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "fd74389bcf72b419f25cb6fe81c951b02ede4985", + "rev": "31b4ff7b3cf1b6537da08ca7c20f4a7ab96fe397", "type": "github" }, "original": { @@ -8000,11 +8000,11 @@ "stackage_2": { "flake": false, "locked": { - "lastModified": 1649639721, - "narHash": "sha256-i/nyHyfpvw6en4phdjLS96DhJI95MVX3KubfUJwDtuU=", + "lastModified": 1653355076, + "narHash": "sha256-mQdOgAyFkLUJBPrVDZmZQ2JRtgHKOQkil//SDdcjP1U=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "9d1954e8bf7ce40ce21d59794d19a8d1ddf06cd6", + "rev": "71b16ca68d6acd639121db43238896357fe53f54", "type": "github" }, "original": {