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

Remove some pending tests #1778

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions hydra-cluster/test/Test/CardanoNodeSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,10 @@ spec = do

describe "findRunningCardanoNode" $ do
it "returns Nothing on non-matching network" $ \(tr, tmp) -> do
unless (Preview `elem` supportedNetworks) $
pendingWith "Preview is not supported so skipping this test."
withCardanoNodeOnKnownNetwork tr tmp Preview $ \_ -> do
findRunningCardanoNode tr tmp Preproduction `shouldReturn` Nothing

it "returns Just running node on matching network" $ \(tr, tmp) -> do
unless (Preview `elem` supportedNetworks) $
pendingWith "Preview is not supported so skipping this test."
withCardanoNodeOnKnownNetwork tr tmp Preview $ \runningNode -> do
findRunningCardanoNode tr tmp Preview `shouldReturn` Just runningNode

Expand Down
13 changes: 11 additions & 2 deletions hydra-node/src/Hydra/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ data PublishOptions = PublishOptions
}
deriving stock (Show, Eq)

-- | Default options as they should also be provided by 'runOptionsParser'.
defaultPublishOptions :: PublishOptions
defaultPublishOptions =
PublishOptions
{ publishNetworkId = Testnet (NetworkMagic 42)
, publishNodeSocket = "node.socket"
, publishSigningKey = "cardano.sk"
}

publishOptionsParser :: Parser PublishOptions
publishOptionsParser =
PublishOptions
Expand Down Expand Up @@ -493,7 +502,7 @@ nodeSocketParser =
strOption
( long "node-socket"
<> metavar "FILE"
<> value "node.socket"
<> value (publishNodeSocket defaultPublishOptions)
<> showDefault
<> help
"Filepath to local unix domain socket used to communicate with \
Expand All @@ -506,7 +515,7 @@ cardanoSigningKeyFileParser =
( long "cardano-signing-key"
<> metavar "FILE"
<> showDefault
<> value "cardano.sk"
<> value (publishSigningKey defaultPublishOptions)
<> help
"Cardano signing key of our hydra-node. This will be used to authorize \
\Hydra protocol transactions for heads the node takes part in and any \
Expand Down
53 changes: 27 additions & 26 deletions hydra-node/test/Hydra/OptionsSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import Hydra.Options (
defaultDirectChainConfig,
defaultLedgerConfig,
defaultOfflineChainConfig,
defaultPublishOptions,
defaultRunOptions,
outputFile,
parseHydraCommandFromArgs,
Expand Down Expand Up @@ -284,34 +285,34 @@ spec = parallel $
}

describe "publish-scripts sub-command" $ do
xit "does not parse without any options" $
shouldNotParse
[ "publish-scripts"
it "parses without any options" $
[ "publish-scripts"
]
`shouldParse` Publish defaultPublishOptions

it "parses with some missing option (1)" $
mconcat
[ ["publish-scripts"]
, ["--node-socket", "foo"]
, ["--mainnet"]
]
`shouldParse` Publish defaultPublishOptions{publishNodeSocket = "foo", publishNetworkId = Mainnet}

xit "does not parse with some missing option (1)" $
shouldNotParse $
mconcat
[ ["publish-scripts"]
, ["--node-socket", "foo"]
, ["--mainnet"]
]

xit "does not parse with some missing option (2)" $
shouldNotParse $
mconcat
[ ["publish-scripts"]
, ["--testnet-magic", "42"]
, ["--cardano-signing-key", "foo"]
]

xit "does not parse with some missing option (3)" $
shouldNotParse $
mconcat
[ ["publish-scripts"]
, ["--node-socket", "foo"]
, ["--cardano-signing-key", "foo"]
]
it "parses with some missing option (2)" $
mconcat
[ ["publish-scripts"]
, ["--testnet-magic", "42"]
, ["--cardano-signing-key", "foo"]
]
`shouldParse` Publish defaultPublishOptions{publishSigningKey = "foo", publishNetworkId = Testnet (NetworkMagic 42)}

it "parses with some missing option (3)" $
mconcat
[ ["publish-scripts"]
, ["--node-socket", "foo"]
, ["--cardano-signing-key", "foo"]
]
`shouldParse` Publish defaultPublishOptions{publishNodeSocket = "foo", publishSigningKey = "foo"}

it "should parse using testnet and all options" $
mconcat
Expand Down
Loading