From 4cf4a010dc58902a5f799b200a3fe55e6b6bc3cf Mon Sep 17 00:00:00 2001 From: Daniel Firth Date: Thu, 23 May 2024 10:32:37 +0000 Subject: [PATCH] Test to demonstrate non-matching network failures --- hydra-cluster/test/Test/CardanoNodeSpec.hs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/hydra-cluster/test/Test/CardanoNodeSpec.hs b/hydra-cluster/test/Test/CardanoNodeSpec.hs index 04e029c3859..5421a356bcd 100644 --- a/hydra-cluster/test/Test/CardanoNodeSpec.hs +++ b/hydra-cluster/test/Test/CardanoNodeSpec.hs @@ -24,9 +24,6 @@ supportedNetworks = [Preview, Preproduction, Mainnet] quickNetworks :: [KnownNetwork] quickNetworks = [Sanchonet, Preview] -supportedQuickNetworks :: [KnownNetwork] -supportedQuickNetworks = filter (`elem` quickNetworks) supportedNetworks - supportedCardanoNodeVersion :: String supportedCardanoNodeVersion = "8.9.0" @@ -37,13 +34,6 @@ forSupportedKnownNetworks msg action = forEachKnownNetwork msg $ \network -> do "cardano-node " <> supportedCardanoNodeVersion <> " is only supported on " ++ show supportedNetworks action network -forASupportedQuickNetwork :: String -> (KnownNetwork -> IO ()) -> Spec -forASupportedQuickNetwork msg action = - it msg $ - case supportedQuickNetworks of - (network : _) -> action network - _ -> pendingWith "No supported networks capable of running this test." - spec :: Spec spec = do -- NOTE: We also hard-code the cardano-node version here to allow prevent @@ -67,12 +57,12 @@ spec = do slot2 `shouldSatisfy` (> slot1) describe "findRunningCardanoNode" $ do - forASupportedQuickNetwork "returns Nothing on non-matching network" $ \network -> do + forSupportedKnownNetworks "returns Nothing on non-matching network" $ \network -> do setupTracerAndTempDir $ \(tr, tmp) -> withCardanoNodeOnKnownNetwork tr tmp network $ \_ -> do - findRunningCardanoNode tr tmp Preproduction `shouldReturn` Nothing + findRunningCardanoNode tr tmp Sanchonet `shouldReturn` Nothing - forASupportedQuickNetwork "returns Just running node on matching network" $ \network -> do + forSupportedKnownNetworks "returns Just running node on matching network" $ \network -> do setupTracerAndTempDir $ \(tr, tmp) -> withCardanoNodeOnKnownNetwork tr tmp network $ \runningNode -> do findRunningCardanoNode tr tmp network `shouldReturn` Just runningNode