Modulesydtest-0.22.0.0Haskell2010
Test.Syd.Modify
This module defines functions for declaring different test settings
- 5 types
- 26 values
- Packagesydtest-0.22.0.0
- Exports31
- LanguageHaskell2010
- LicenceLicenseRef-OtherLicense
- SourceModify.hs
Declaring different test settings
6 declarationsInstances4Eq, Show, Generic, Rep
Eq TestRunSettingsDefined in sydtest-0.22.0.0 · Test.Syd.RunShow TestRunSettingsDefined in sydtest-0.22.0.0 · Test.Syd.RunGeneric TestRunSettingsDefined in sydtest-0.22.0.0 · Test.Syd.Runtype Rep TestRunSettings = D1 ('MetaDataDefined in sydtest-0.22.0.0 · Test.Syd.Run"TestRunSettings"
"Test.Syd.Run"
"sydtest-0.22.0.0-C6WVjaL6xelIJS238V3PZE"
'False) (C1 ('MetaCons"TestRunSettings"
'PrefixI 'True) ((S1 ('MetaSel ('Just"testRunSettingSeed"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SeedSetting) :*: (S1 ('MetaSel ('Just"testRunSettingMaxSuccess"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int) :*: S1 ('MetaSel ('Just"testRunSettingMaxSize"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int))) :*: ((S1 ('MetaSel ('Just"testRunSettingMaxDiscardRatio"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int) :*: S1 ('MetaSel ('Just"testRunSettingMaxShrinks"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int)) :*: (S1 ('MetaSel ('Just"testRunSettingGoldenStart"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just"testRunSettingGoldenReset"
) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)))))
Declaring parallelism
4 declarationsDeclare that all tests below must be run sequentially
Declare that all tests below may be run in parallel. (This is the default.)
Annotate a test group with Parallelism.
Instances4Eq, Show, Generic, Rep
Eq ParallelismDefined in sydtest-0.22.0.0 · Test.Syd.SpecDefShow ParallelismDefined in sydtest-0.22.0.0 · Test.Syd.SpecDefGeneric ParallelismDefined in sydtest-0.22.0.0 · Test.Syd.SpecDeftype Rep Parallelism = D1 ('MetaDataDefined in sydtest-0.22.0.0 · Test.Syd.SpecDef"Parallelism"
"Test.Syd.SpecDef"
"sydtest-0.22.0.0-C6WVjaL6xelIJS238V3PZE"
'False) (C1 ('MetaCons"Parallel"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Sequential"
'PrefixI 'False) U1)
Declaring randomisation order
4 declarationsDeclare that the order of execution of all tests below may be randomised.
Declare that the order of execution of all tests below must not be randomised.
Annotate a test group with ExecutionOrderRandomisation.
Instances4Eq, Show, Generic, Rep
Eq ExecutionOrderRandomisationDefined in sydtest-0.22.0.0 · Test.Syd.SpecDefShow ExecutionOrderRandomisationDefined in sydtest-0.22.0.0 · Test.Syd.SpecDefGeneric ExecutionOrderRandomisationDefined in sydtest-0.22.0.0 · Test.Syd.SpecDeftype Rep ExecutionOrderRandomisation = D1 ('MetaDataDefined in sydtest-0.22.0.0 · Test.Syd.SpecDef"ExecutionOrderRandomisation"
"Test.Syd.SpecDef"
"sydtest-0.22.0.0-C6WVjaL6xelIJS238V3PZE"
'False) (C1 ('MetaCons"RandomiseExecutionOrder"
'PrefixI 'False) U1 :+: C1 ('MetaCons"DoNotRandomiseExecutionOrder"
'PrefixI 'False) U1)
Modifying timeouts
3 declarationsModify the test timeout
Turn off timeouts
Turn off timeouts
Modifying the number of retries
3 declarationsModify the number of retries to use in flakiness diagnostics.
Turn off retries
Make the number of retries this constant
Declaring flakiness
7 declarationsMark a test suite as "potentially flaky" with a given number of retries.
This will retry any test in the given test group up to the given number of tries, and pass a test if it passes once. The test output will show which tests were flaky.
WARNING: This is only a valid approach to dealing with test flakiness if it is true that tests never pass accidentally. In other words: tests using flaky must be guaranteed to fail every time if an error is introduced in the code, it should only be added to deal with accidental failures, never accidental passes.
Like flaky, but also shows the given message to the user whenever the test is flaky.
You could use it like this:
flakyWith 3 "Something sometimes goes wrong with the database, see issue 6346" ourTestSuiteMark a test suite as "must not be flaky".
This is useful to have a subgroup of a group marked as flaky that must not be flaky afteral.
Mark a test suite as 'potentially flaky', such that it will not fail if it is flaky but passes at least once.
Like potentiallyFlaky, but with a message.
Annotate a test group with FlakinessMode.
Constructors
Instances4Eq, Show, Generic, Rep
Eq FlakinessModeDefined in sydtest-0.22.0.0 · Test.Syd.SpecDefShow FlakinessModeDefined in sydtest-0.22.0.0 · Test.Syd.SpecDefGeneric FlakinessModeDefined in sydtest-0.22.0.0 · Test.Syd.SpecDeftype Rep FlakinessMode = D1 ('MetaDataDefined in sydtest-0.22.0.0 · Test.Syd.SpecDef"FlakinessMode"
"Test.Syd.SpecDef"
"sydtest-0.22.0.0-C6WVjaL6xelIJS238V3PZE"
'False) (C1 ('MetaCons"MayNotBeFlaky"
'PrefixI 'False) U1 :+: C1 ('MetaCons"MayBeFlaky"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe String))))
Declaring expectations
4 declarationsMark a test suite as 'should pass'
Mark a test suite as 'should fail'
Annotate a test suite with ExpectationMode
Instances4Eq, Show, Generic, Rep
Eq ExpectationModeDefined in sydtest-0.22.0.0 · Test.Syd.SpecDefShow ExpectationModeDefined in sydtest-0.22.0.0 · Test.Syd.SpecDefGeneric ExpectationModeDefined in sydtest-0.22.0.0 · Test.Syd.SpecDeftype Rep ExpectationMode = D1 ('MetaDataDefined in sydtest-0.22.0.0 · Test.Syd.SpecDef"ExpectationMode"
"Test.Syd.SpecDef"
"sydtest-0.22.0.0-C6WVjaL6xelIJS238V3PZE"
'False) (C1 ('MetaCons"ExpectPassing"
'PrefixI 'False) U1 :+: C1 ('MetaCons"ExpectFailing"
'PrefixI 'False) U1)