Skip to content

Commit

Permalink
Tests{Unit|End2End}: replace Assert.Inconclusive with Assert.Fail
Browse files Browse the repository at this point in the history
It seems Assert.Inconclusive doesn't end up as exitCode<>0, just gets
ignored like Assert.Ignore, so we need to stop using it, and add the
"Inconclusive" word as a prefix in the failure message.
  • Loading branch information
knocte committed Aug 11, 2022
1 parent 00469bc commit c697b0b
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 67 deletions.
122 changes: 61 additions & 61 deletions src/GWallet.Backend.Tests.End2End/LN.fs
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,9 @@ type LN() =
OpenChannelWithFundee (Some Config.FundeeNodeEndpoint)
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel-closing inconclusive because Channel open failed, fix this first: %s"
"Inconclusive: channel-closing inconclusive because Channel open failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand Down Expand Up @@ -402,9 +402,9 @@ type LN() =
OpenChannelWithFundee (Some Config.FundeeNodeEndpoint)
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Monohop-sending inconclusive because Channel open failed, fix this first: %s"
"Inconclusive: monohop-sending inconclusive because Channel open failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand Down Expand Up @@ -433,9 +433,9 @@ type LN() =
OpenChannelWithFundee (Some Config.FundeeNodeEndpoint)
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel-closing inconclusive because Channel open failed, fix this first: %s"
"Inconclusive: channel-closing inconclusive because Channel open failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -444,9 +444,9 @@ type LN() =
do! SendMonoHopPayments clientWallet channelId fundingAmount
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel-closing inconclusive because sending of monohop payments failed, fix this first: %s"
"Inconclusive: channel-closing inconclusive because sending of monohop payments failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand Down Expand Up @@ -497,9 +497,9 @@ type LN() =
OpenChannelWithFundee None
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel-closing inconclusive because Channel open failed, fix this first: %s"
"Inconclusive: channel-closing inconclusive because Channel open failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand Down Expand Up @@ -552,9 +552,9 @@ type LN() =
AcceptChannelFromLndFunder ()
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel-closing inconclusive because Channel accept failed, fix this first: %s"
"Inconclusive: channel-closing inconclusive because Channel accept failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand Down Expand Up @@ -616,9 +616,9 @@ type LN() =
OpenChannelWithFundee (Some Config.FundeeNodeEndpoint)
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel local-force-closing inconclusive because Channel open failed, fix this first: %s"
"Inconclusive: channel local-force-closing inconclusive because Channel open failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -627,9 +627,9 @@ type LN() =
do! SendMonoHopPayments clientWallet channelId fundingAmount
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel local-force-closing inconclusive because sending of monohop payments failed, fix this first: %s"
"Inconclusive: channel local-force-closing inconclusive because sending of monohop payments failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand Down Expand Up @@ -691,9 +691,9 @@ type LN() =
AcceptChannelFromGeewalletFunder ()
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel local-force-closing inconclusive because Channel accept failed, fix this first: %s"
"Inconclusive: channel local-force-closing inconclusive because Channel accept failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -702,9 +702,9 @@ type LN() =
do! ReceiveMonoHopPayments serverWallet channelId
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel remote-force-closing inconclusive because receiving of monohop payments failed, fix this first: %s"
"Inconclusive: channel remote-force-closing inconclusive because receiving of monohop payments failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -720,9 +720,9 @@ type LN() =
OpenChannelWithFundee (Some Config.FundeeNodeEndpoint)
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel remote-force-closing inconclusive because Channel open failed, fix this first: %s"
"Inconclusive: channel remote-force-closing inconclusive because Channel open failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -731,9 +731,9 @@ type LN() =
do! SendMonoHopPayments clientWallet channelId fundingAmount
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel remote-force-closing inconclusive because sending of monohop payments failed, fix this first: %s"
"Inconclusive: channel remote-force-closing inconclusive because sending of monohop payments failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand Down Expand Up @@ -805,9 +805,9 @@ type LN() =
AcceptChannelFromGeewalletFunder ()
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel remote-force-closing inconclusive because Channel accept failed, fix this first: %s"
"Inconclusive: channel remote-force-closing inconclusive because Channel accept failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -816,9 +816,9 @@ type LN() =
do! ReceiveMonoHopPayments serverWallet channelId
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel remote-force-closing inconclusive because receiving of monohop payments failed, fix this first: %s"
"Inconclusive: channel remote-force-closing inconclusive because receiving of monohop payments failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand Down Expand Up @@ -859,9 +859,9 @@ type LN() =
OpenChannelWithFundee (Some Config.FundeeNodeEndpoint)
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel remote-force-closing inconclusive because Channel open failed, fix this first: %s"
"Inconclusive: channel remote-force-closing inconclusive because Channel open failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -870,9 +870,9 @@ type LN() =
do! SendMonoHopPayments clientWallet channelId fundingAmount
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel remote-force-closing inconclusive because sending of monohop payments failed, fix this first: %s"
"Inconclusive: channel remote-force-closing inconclusive because sending of monohop payments failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand Down Expand Up @@ -937,9 +937,9 @@ type LN() =
AcceptChannelFromGeewalletFunder ()
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel remote-force-closing inconclusive because Channel accept failed, fix this first: %s"
"Inconclusive: channel remote-force-closing inconclusive because Channel accept failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -948,9 +948,9 @@ type LN() =
do! ReceiveMonoHopPayments serverWallet channelId
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel remote-force-closing inconclusive because receiving of monohop payments failed, fix this first: %s"
"Inconclusive: channel remote-force-closing inconclusive because receiving of monohop payments failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand Down Expand Up @@ -1262,9 +1262,9 @@ type LN() =
OpenChannelWithFundee (Some Config.FundeeNodeEndpoint)
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"CPFP inconclusive because Channel open failed, fix this first: %s"
"Inconclusive: CPFP inconclusive because Channel open failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -1273,9 +1273,9 @@ type LN() =
do! SendMonoHopPayments clientWallet channelId fundingAmount
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"CPFP inconclusive because sending of monohop payments failed, fix this first: %s"
"Inconclusive: CPFP inconclusive because sending of monohop payments failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand Down Expand Up @@ -1308,9 +1308,9 @@ type LN() =
AcceptChannelFromGeewalletFunder ()
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel remote-force-closing inconclusive because Channel accept failed, fix this first: %s"
"Inconclusive: channel remote-force-closing inconclusive because Channel accept failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -1319,9 +1319,9 @@ type LN() =
do! ReceiveMonoHopPayments serverWallet channelId
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"CPFP inconclusive because receiving of monohop payments failed, fix this first: %s"
"Inconclusive: CPFP inconclusive because receiving of monohop payments failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand Down Expand Up @@ -1405,9 +1405,9 @@ type LN() =
OpenChannelWithFundee (Some Config.FundeeNodeEndpoint)
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"UpdateFee message support inconclusive because Channel open failed, fix this first: %s"
"Inconclusive: UpdateFee message support inconclusive because Channel open failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -1417,9 +1417,9 @@ type LN() =
do! SendMonoHopPayments clientWallet channelId fundingAmount
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"UpdateFee message support inconclusive because sending of monohop payments failed, fix this first: %s"
"Inconclusive: UpdateFee message support inconclusive because sending of monohop payments failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -1437,9 +1437,9 @@ type LN() =
do! SendMonoHopPayments clientWallet channelId currentBalance
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Sending of monohop payments failed after UpdateFee message handling: %s"
"Inconclusive: sending of monohop payments failed after UpdateFee message handling: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -1457,9 +1457,9 @@ type LN() =
AcceptChannelFromGeewalletFunder ()
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"UpdateFee message support inconclusive because Channel accept failed, fix this first: %s"
"Inconclusive: UpdateFee message support inconclusive because Channel accept failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -1470,9 +1470,9 @@ type LN() =
do! ReceiveMonoHopPayments serverWallet channelId
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"UpdateFee message support inconclusive because receiving of monohop payments failed, fix this first: %s"
"Inconclusive: UpdateFee message support inconclusive because receiving of monohop payments failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -1486,9 +1486,9 @@ type LN() =
do! ReceiveMonoHopPayments serverWallet channelId
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Receiving of monohop payments failed after UpdateFee message handling: %s"
"Inconclusive: receiving of monohop payments failed after UpdateFee message handling: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -1509,9 +1509,9 @@ type LN() =
OpenChannelWithFundee (Some Config.FundeeNodeEndpoint)
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel-closing inconclusive because Channel open failed, fix this first: %s"
"Inconclusive: channel-closing inconclusive because Channel open failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand All @@ -1520,9 +1520,9 @@ type LN() =
do! SendMonoHopPayments clientWallet channelId fundingAmount
with
| ex ->
Assert.Inconclusive (
Assert.Fail (
sprintf
"Channel-closing inconclusive because sending of monohop payments failed, fix this first: %s"
"Inconclusive: channel-closing inconclusive because sending of monohop payments failed, fix this first: %s"
(ex.ToString())
)
failwith "unreachable"
Expand Down Expand Up @@ -1564,7 +1564,7 @@ type LN() =
return Ok (closingTx, mutualCpfp)
| _ -> return Error "CPFP tx creation failed"
| Tx (Full, _) ->
Assert.Inconclusive "Closing tx got confirmed before we get a chance to create CPFP tx"
Assert.Fail "Inconclusive: Closing tx got confirmed before we get a chance to create CPFP tx"
return Error "Closing tx got confirmed before we get a chance to create CPFP tx"
| _ ->
do! Async.Sleep 1000
Expand Down
Loading

0 comments on commit c697b0b

Please sign in to comment.