hedgehogqa / haskell-hedgehog

Release with confidence, state-of-the-art property testing for Haskell.
677 stars 107 forks source link

Diff showing lines as different when they are actually the same #435

Open newhoggy opened 3 years ago

newhoggy commented 3 years ago

To much of the delta between expected and actual is marked as different when they are actually the same.

For example:

    49 ┃   yaml === json
       ┃   ^^^^^^^^^^^^^
       ┃   │ ━━━ Failed (- lhs) (+ rhs) ━━━
       ┃   │   Object
       ┃   │     fromList
       ┃   │ -     [ ( "AlonzoGenesisFile" , String "mainnet-alonzo-genesis.json" )
       ┃   │ -     , ( "AlonzoGenesisHash"
       ┃   │ -       , String
       ┃   │ -           "7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874"
       ┃   │ -       )
       ┃   │ -     , ( "ApplicationName" , String "cardano-sl" )
       ┃   │ -     , ( "ApplicationVersion" , Number 1.0 )
       ┃   │ -     , ( "ByronGenesisFile" , String "mainnet-byron-genesis.json" )
       ┃   │ -     , ( "ByronGenesisHash"
       ┃   │ -       , String
       ┃   │ -           "5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb"
       ┃   │ -       )
       ┃   │ -     , ( "LastKnownBlockVersion-Alt" , Number 0.0 )
       ┃   │ -     , ( "LastKnownBlockVersion-Major" , Number 0.0 )
       ┃   │ -     , ( "LastKnownBlockVersion-Minor" , Number 2.0 )
       ┃   │ -     , ( "MaxConcurrencyBulkSync" , Number 1.0 )
       ┃   │ -     , ( "MaxConcurrencyDeadline" , Number 2.0 )
       ┃   │ -     , ( "Protocol" , String "RealPBFT" )
       ┃   │ -     , ( "RequiresNetworkMagic" , String "RequiresNoMagic" )
       ┃   │ -     , ( "ShelleyGenesisFile" , String "mainnet-shelley-genesis.json" )
       ┃   │ -     , ( "ShelleyGenesisHash"
       ┃   │ -       , String
       ┃   │ -           "1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81"
       ┃   │ -       )
       ┃   │ -     , ( "SocketPath" , String "db/node.socket" )
       ┃   │ -     , ( "TraceBlockFetchClient" , Bool False )
       ┃   │ -     , ( "TraceBlockFetchDecisions" , Bool False )
       ┃   │ -     , ( "TraceBlockFetchProtocol" , Bool False )
       ┃   │ -     , ( "TraceBlockFetchProtocolSerialised" , Bool False )
       ┃   │ -     , ( "TraceBlockFetchServer" , Bool False )
       ┃   │ -     , ( "TraceBlockchainTime" , Bool False )
       ┃   │ -     , ( "TraceChainDb" , Bool True )
       ┃   │ -     , ( "TraceChainSyncBlockServer" , Bool False )
       ┃   │ -     , ( "TraceChainSyncClient" , Bool False )
       ┃   │ -     , ( "TraceChainSyncHeaderServer" , Bool False )
       ┃   │ -     , ( "TraceChainSyncProtocol" , Bool False )
       ┃   │ -     , ( "TraceDNSResolver" , Bool True )
       ┃   │ -     , ( "TraceDNSSubscription" , Bool True )
       ┃   │ -     , ( "TraceErrorPolicy" , Bool True )
       ┃   │ -     , ( "TraceForge" , Bool True )
       ┃   │ -     , ( "TraceHandshake" , Bool False )
       ┃   │ -     , ( "TraceIpSubscription" , Bool True )
       ┃   │ -     , ( "TraceLocalChainSyncProtocol" , Bool False )
       ┃   │ -     , ( "TraceLocalErrorPolicy" , Bool True )
       ┃   │ -     , ( "TraceLocalHandshake" , Bool False )
       ┃   │ -     , ( "TraceLocalTxSubmissionProtocol" , Bool False )
       ┃   │ -     , ( "TraceLocalTxSubmissionServer" , Bool False )
       ┃   │ -     , ( "TraceMempool" , Bool True )
       ┃   │ -     , ( "TraceMux" , Bool False )
       ┃   │ -     , ( "TraceTxInbound" , Bool False )
       ┃   │ -     , ( "TraceTxOutbound" , Bool False )
       ┃   │ -     , ( "TraceTxSubmissionProtocol" , Bool False )
       ┃   │ -     , ( "TracingVerbosity" , String "NormalVerbosity" )
       ┃   │ -     , ( "TurnOnLogMetrics" , Bool True )
       ┃   │ -     , ( "TurnOnLogging" , Bool True )
       ┃   │ -     , ( "defaultBackends" , Array [ String "KatipBK" ] )
       ┃   │ -     , ( "defaultScribes"
       ┃   │ -       , Array
       ┃   │ -           [ Array [ String "FileSK" , String "logs/mainnet.log" ]
       ┃   │ -           , Array [ String "StdoutSK" , String "stdout" ]
       ┃   │ -           ]
       ┃   │ -       )
       ┃   │ -     , ( "minSeverity" , String "Info" )
       ┃   │ -     , ( "options"
       ┃   │ -       , Object
       ┃   │ -           (fromList
       ┃   │ -              [ ( "mapBackends"
       ┃   │ -                , Object
       ┃   │ -                    (fromList
       ┃   │ -                       [ ( "cardano.node.metrics" , Array [ String "EKGViewBK" ] ) ])
       ┃   │ -                )
       ┃   │ -              , ( "mapScribes"
       ┃   │ -                , Object
       ┃   │ -                    (fromList
       ┃   │ -                       [ ( "cardano.node.metrics"
       ┃   │ -                         , Array [ String "FileSK::logs/mainnet.log" ]
       ┃   │ -                         )
       ┃   │ -                       ])
       ┃   │ -                )
       ┃   │ -              , ( "mapSeverity"
       ┃   │ -                , Object
       ┃   │ -                    (fromList
       ┃   │ -                       [ ( "cardano.node.ChainDB" , String "Notice" )
       ┃   │ -                       , ( "cardano.node.DnsSubscription" , String "Debug" )
       ┃   │ -                       ])
       ┃   │ -                )
       ┃   │ -              ])
       ┃   │ -       )
       ┃   │ -     , ( "rotation"
       ┃   │ -       , Object
       ┃   │ -           (fromList
       ┃   │ -              [ ( "rpKeepFilesNum" , Number 3.0 )
       ┃   │ -              , ( "rpLogLimitBytes" , Number 5000000.0 )
       ┃   │ -              , ( "rpMaxAgeHours" , Number 24.0 )
       ┃   │ -              ])
       ┃   │ -       )
       ┃   │ -     , ( "setupBackends" , Array [ String "KatipBK" ] )
       ┃   │ -     , ( "setupScribes"
       ┃   │ -       , Array
       ┃   │ -           [ Object
       ┃   │ -               (fromList
       ┃   │ -                  [ ( "scFormat" , String "ScText" )
       ┃   │ -                  , ( "scKind" , String "FileSK" )
       ┃   │ -                  , ( "scName" , String "logs/mainnet.log" )
       ┃   │ -                  ])
       ┃   │ -           , Object
       ┃   │ -               (fromList
       ┃   │ -                  [ ( "scFormat" , String "ScText" )
       ┃   │ -                  , ( "scKind" , String "StdoutSK" )
       ┃   │ -                  , ( "scName" , String "stdout" )
       ┃   │ -                  ])
       ┃   │ -           ]
       ┃   │ -       )
       ┃   │ -     ]
       ┃   │ +     [ ( "AlonzoGenesisFile" , String "mainnet-alonzo-genesis.json" )
       ┃   │ +     , ( "AlonzoGenesisHash"
       ┃   │ +       , String
       ┃   │ +           "7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874"
       ┃   │ +       )
       ┃   │ +     , ( "ApplicationName" , String "cardano-sl" )
       ┃   │ +     , ( "ApplicationVersion" , Number 1.0 )
       ┃   │ +     , ( "ByronGenesisFile" , String "mainnet-byron-genesis.json" )
       ┃   │ +     , ( "ByronGenesisHash"
       ┃   │ +       , String
       ┃   │ +           "5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb"
       ┃   │ +       )
       ┃   │ +     , ( "LastKnownBlockVersion-Alt" , Number 0.0 )
       ┃   │ +     , ( "LastKnownBlockVersion-Major" , Number 3.0 )
       ┃   │ +     , ( "LastKnownBlockVersion-Minor" , Number 0.0 )
       ┃   │ +     , ( "MaxKnownMajorProtocolVersion" , Number 2.0 )
       ┃   │ +     , ( "Protocol" , String "Cardano" )
       ┃   │ +     , ( "RequiresNetworkMagic" , String "RequiresNoMagic" )
       ┃   │ +     , ( "ShelleyGenesisFile" , String "mainnet-shelley-genesis.json" )
       ┃   │ +     , ( "ShelleyGenesisHash"
       ┃   │ +       , String
       ┃   │ +           "1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81"
       ┃   │ +       )
       ┃   │ +     , ( "TraceAcceptPolicy" , Bool True )
       ┃   │ +     , ( "TraceBlockFetchClient" , Bool False )
       ┃   │ +     , ( "TraceBlockFetchDecisions" , Bool False )
       ┃   │ +     , ( "TraceBlockFetchProtocol" , Bool False )
       ┃   │ +     , ( "TraceBlockFetchProtocolSerialised" , Bool False )
       ┃   │ +     , ( "TraceBlockFetchServer" , Bool False )
       ┃   │ +     , ( "TraceChainDb" , Bool True )
       ┃   │ +     , ( "TraceChainSyncBlockServer" , Bool False )
       ┃   │ +     , ( "TraceChainSyncClient" , Bool False )
       ┃   │ +     , ( "TraceChainSyncHeaderServer" , Bool False )
       ┃   │ +     , ( "TraceChainSyncProtocol" , Bool False )
       ┃   │ +     , ( "TraceConnectionManager" , Bool True )
       ┃   │ +     , ( "TraceDNSResolver" , Bool True )
       ┃   │ +     , ( "TraceDNSSubscription" , Bool True )
       ┃   │ +     , ( "TraceDiffusionInitialization" , Bool True )
       ┃   │ +     , ( "TraceErrorPolicy" , Bool True )
       ┃   │ +     , ( "TraceForge" , Bool True )
       ┃   │ +     , ( "TraceHandshake" , Bool False )
       ┃   │ +     , ( "TraceInboundGovernor" , Bool True )
       ┃   │ +     , ( "TraceIpSubscription" , Bool True )
       ┃   │ +     , ( "TraceLedgerPeers" , Bool True )
       ┃   │ +     , ( "TraceLocalChainSyncProtocol" , Bool False )
       ┃   │ +     , ( "TraceLocalErrorPolicy" , Bool True )
       ┃   │ +     , ( "TraceLocalHandshake" , Bool False )
       ┃   │ +     , ( "TraceLocalRootPeers" , Bool True )
       ┃   │ +     , ( "TraceLocalTxSubmissionProtocol" , Bool False )
       ┃   │ +     , ( "TraceLocalTxSubmissionServer" , Bool False )
       ┃   │ +     , ( "TraceMempool" , Bool True )
       ┃   │ +     , ( "TraceMux" , Bool False )
       ┃   │ +     , ( "TracePeerSelection" , Bool True )
       ┃   │ +     , ( "TracePeerSelectionActions" , Bool True )
       ┃   │ +     , ( "TracePublicRootPeers" , Bool True )
       ┃   │ +     , ( "TraceServer" , Bool True )
       ┃   │ +     , ( "TraceTxInbound" , Bool False )
       ┃   │ +     , ( "TraceTxOutbound" , Bool False )
       ┃   │ +     , ( "TraceTxSubmissionProtocol" , Bool False )
       ┃   │ +     , ( "TracingVerbosity" , String "NormalVerbosity" )
       ┃   │ +     , ( "TurnOnLogMetrics" , Bool True )
       ┃   │ +     , ( "TurnOnLogging" , Bool True )
       ┃   │ +     , ( "defaultBackends" , Array [ String "KatipBK" ] )
       ┃   │ +     , ( "defaultScribes"
       ┃   │ +       , Array [ Array [ String "StdoutSK" , String "stdout" ] ]
       ┃   │ +       )
       ┃   │ +     , ( "hasEKG" , Number 12788.0 )
       ┃   │ +     , ( "hasPrometheus"
       ┃   │ +       , Array [ String "127.0.0.1" , Number 12798.0 ]
       ┃   │ +       )
       ┃   │ +     , ( "minSeverity" , String "Info" )
       ┃   │ +     , ( "options"
       ┃   │ +       , Object
       ┃   │ +           (fromList
       ┃   │ +              [ ( "mapBackends"
       ┃   │ +                , Object
       ┃   │ +                    (fromList
       ┃   │ +                       [ ( "cardano.node.metrics" , Array [ String "EKGViewBK" ] )
       ┃   │ +                       , ( "cardano.node.resources" , Array [ String "EKGViewBK" ] )
       ┃   │ +                       ])
       ┃   │ +                )
       ┃   │ +              , ( "mapSubtrace"
       ┃   │ +                , Object
       ┃   │ +                    (fromList
       ┃   │ +                       [ ( "cardano.node.metrics"
       ┃   │ +                         , Object (fromList [ ( "subtrace" , String "Neutral" ) ])
       ┃   │ +                         )
       ┃   │ +                       ])
       ┃   │ +                )
       ┃   │ +              ])
       ┃   │ +       )
       ┃   │ +     , ( "rotation"
       ┃   │ +       , Object
       ┃   │ +           (fromList
       ┃   │ +              [ ( "rpKeepFilesNum" , Number 10.0 )
       ┃   │ +              , ( "rpLogLimitBytes" , Number 5000000.0 )
       ┃   │ +              , ( "rpMaxAgeHours" , Number 24.0 )
       ┃   │ +              ])
       ┃   │ +       )
       ┃   │ +     , ( "setupBackends" , Array [ String "KatipBK" ] )
       ┃   │ +     , ( "setupScribes"
       ┃   │ +       , Array
       ┃   │ +           [ Object
       ┃   │ +               (fromList
       ┃   │ +                  [ ( "scFormat" , String "ScText" )
       ┃   │ +                  , ( "scKind" , String "StdoutSK" )
       ┃   │ +                  , ( "scName" , String "stdout" )
       ┃   │ +                  , ( "scRotation" , Null )
       ┃   │ +                  ])
       ┃   │ +           ]
       ┃   │ +       )
       ┃   │ +     ]

But the first delta shows no change at all:

       ┃   │ -     [ ( "AlonzoGenesisFile" , String "mainnet-alonzo-genesis.json" )

vs

       ┃   │ +     [ ( "AlonzoGenesisFile" , String "mainnet-alonzo-genesis.json" )
TysonMN commented 3 years ago

Can you share a repository that reproduces this issue?