Skip to content

Commit

Permalink
Disable kes-period-info test with code rather than comments
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Jul 6, 2022
1 parent 205702e commit 9265bcd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 4 additions & 4 deletions cardano-testnet/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Test.Tasty (TestTree)

import qualified Spec.Cli.Alonzo.LeadershipSchedule
import qualified Spec.Cli.Babbage.LeadershipSchedule
-- import qualified Spec.Cli.KesPeriodInfo
import qualified Spec.Cli.KesPeriodInfo
import qualified Spec.Node.Shutdown
import qualified Spec.ShutdownOnSlotSynced
import qualified System.Environment as E
Expand All @@ -23,15 +23,15 @@ tests = pure $ T.testGroup "test/Spec.hs"
[ H.ignoreOnWindows "Shutdown" Spec.Node.Shutdown.hprop_shutdown
, H.ignoreOnWindows "ShutdownOnSlotSynced" Spec.ShutdownOnSlotSynced.hprop_shutdownOnSlotSynced
, T.testGroup "Alonzo"
[ H.ignoreOnWindows "leadership-schedule" Spec.Cli.Alonzo.LeadershipSchedule.hprop_leadershipSchedule
[ H.ignoreOnMacAndWindows "leadership-schedule" Spec.Cli.Alonzo.LeadershipSchedule.hprop_leadershipSchedule
]
, T.testGroup "Babbage"
[ H.ignoreOnWindows "leadership-schedule" Spec.Cli.Babbage.LeadershipSchedule.hprop_leadershipSchedule
[ H.ignoreOnMacAndWindows "leadership-schedule" Spec.Cli.Babbage.LeadershipSchedule.hprop_leadershipSchedule
]
-- Ignored on Windows due to <stdout>: 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.disabled "kes-period-info" Spec.Cli.KesPeriodInfo.hprop_kes_period_info
]
]

Expand Down
10 changes: 7 additions & 3 deletions cardano-testnet/test/Test/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ module Test.Util
, ignoreOnWindows
, ignoreOnMac
, ignoreOnMacAndWindows
, disabled
) where

import Data.Bool (bool)
import Data.String (IsString(..))
import Data.String (IsString (..))
import Hedgehog (Property)
import Hedgehog.Extras.Stock.OS (isWin32)
import Prelude
import Test.Tasty.ExpectedFailure (wrapTest)
import Test.Tasty.Providers (testPassed)
import Test.Tasty.Runners (TestTree, Result(resultShortDescription))
import Test.Tasty.Runners (Result (resultShortDescription), TestTree)

import qualified Test.Tasty.Hedgehog as H
import qualified System.Info as SYS
import qualified Test.Tasty.Hedgehog as H

type Os = String

Expand All @@ -40,3 +41,6 @@ ignoreOn os = wrapTest $ const $ return $
(testPassed ("IGNORED on " <> os))
{ resultShortDescription = "IGNORED on " <> os
}

disabled :: String -> Property -> TestTree
disabled pName prop = ignoreOn "Disabled" $ H.testPropertyNamed pName (fromString pName) prop

0 comments on commit 9265bcd

Please sign in to comment.