Skip to content

Commit c62e4b3

Browse files
cootcrocodile-dentist
authored andcommitted
dmq-node: disable StandardCrypto tests on Windows
They are flaky on GH windows instances.
1 parent 6108733 commit c62e4b3

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

dmq-node/dmq-node.cabal

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,15 @@ extra-doc-files: CHANGELOG.md
2020

2121
flag cddl
2222
description: Enable CDDL based tests of the CBOR encoding
23-
manual: True
2423
-- These tests need the cddl and the cbor-diag Ruby-package
2524
default: True
2625

26+
flag standardcrypto-tests
27+
description: Enable StandardCrypto tests
28+
-- these tests are flaky on GH Windows instances
29+
manual: True
30+
default: True
31+
2732
common extensions
2833
default-extensions:
2934
BangPatterns
@@ -186,6 +191,9 @@ test-suite dmq-tests
186191
-T
187192
-RTS
188193

194+
if flag(standardcrypto-tests)
195+
cpp-options: -DSTANDARDCRYPTO_TESTS
196+
189197
test-suite dmq-cddl
190198
import:
191199
warnings,

dmq-node/test/DMQ/Protocol/SigSubmission/Test.hs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE BangPatterns #-}
22
{-# LANGUAGE BlockArguments #-}
3+
{-# LANGUAGE CPP #-}
34
{-# LANGUAGE DeriveFunctor #-}
45
{-# LANGUAGE FlexibleContexts #-}
56
{-# LANGUAGE FlexibleInstances #-}
@@ -16,8 +17,11 @@
1617
{-# LANGUAGE UndecidableInstances #-}
1718

1819
{-# OPTIONS_GHC -Wno-orphans #-}
20+
#ifndef STANDARDCRYPTO_TESTS
21+
{-# OPTIONS_GHC -Wno-unused-top-binds #-}
22+
#endif
1923

20-
module DMQ.Protocol.SigSubmission.Test where
24+
module DMQ.Protocol.SigSubmission.Test (tests) where
2125

2226
import Codec.CBOR.Encoding qualified as CBOR
2327
import Codec.CBOR.Read qualified as CBOR
@@ -84,6 +88,7 @@ tests =
8488
, testProperty "codec valid cbor" prop_codec_valid_cbor_mockcrypto
8589
, testProperty "OCert" prop_codec_cbor_mockcrypto
8690
]
91+
#ifdef STANDARDCRYPTO_TESTS
8792
, testGroup "StandardCrypto"
8893
[ testProperty "OCert" prop_codec_ocert_standardcrypto
8994
, testProperty "Sig" prop_codec_sig_standardcrypto
@@ -101,17 +106,20 @@ tests =
101106
, testProperty "codec cbor" prop_codec_cbor_standardcrypto
102107
, testProperty "codec valid cbor" prop_codec_valid_cbor_standardcrypto
103108
]
109+
#endif
104110
]
105111
]
106112
, testGroup "Crypto"
107113
[ testGroup "MockCrypto"
108114
[ testProperty "KES sign verify" prop_sign_verify_mockcrypto
109115
, testProperty "validateSig" prop_validateSig_mockcrypto
110116
]
117+
#ifdef STANDARDCRYPTO_TESTS
111118
, testGroup "StandardCrypto"
112119
[ testProperty "KES sign verify" prop_sign_verify_standardcrypto
113120
, testProperty "validateSig" prop_validateSig_standardcrypto
114121
]
122+
#endif
115123
]
116124
]
117125

@@ -244,13 +252,6 @@ shrinkWithConstr update shrinker constr =
244252
unsafePerformIO (sequenceWithConstr update $ shrinker <$> constr)
245253
++ shrinkWithConstrCtx constr
246254

247-
shrinkWithConstr' :: Arbitrary ctx
248-
=> (a -> key -> a)
249-
-> (a -> [a])
250-
-> WithConstr ctx key a
251-
-> [WithConstr ctx key a]
252-
shrinkWithConstr' update = shrinkWithConstr (\a k -> pure (update a k))
253-
254255

255256
type KESCTX size = PinnedSizedBytes size
256257
type WithConstrKES size crypto a = WithConstr (KESCTX size) (SignKeyKES crypto, VerKeyKES crypto) a
@@ -772,8 +773,10 @@ prop_codec_splits3_mockcrypto :: Blind (AnySigMessage MockCrypto) -> Property
772773
prop_codec_splits3_mockcrypto = prop_codec_splits3 . getBlind
773774
-}
774775

776+
{-
775777
prop_codec_splits3_standardcrypto :: Blind (AnySigMessage StandardCrypto) -> Property
776778
prop_codec_splits3_standardcrypto = prop_codec_splits3 . getBlind
779+
-}
777780

778781

779782
prop_codec_cbor

0 commit comments

Comments
 (0)