Haskell Hspec - only run expensive test on command line flag

Rob Murray

I want to run an expensive Hspec test only when some flag on the command line is set for stack test. I understand that I can use stack test --test-arguments=... but what would I use on the command line and how would I carry out the conditional testing in my Spec.hs? I can't seem to find a good example elsewhere online.

EDIT: Is it possible to get a test to be skipped when just running stack test with no skip specified? Or would this be possible by having another similar specification file with just the expensive test in?

Zeta

You can use --skip=PATTERN to skip a test. Other than that, you can check the command line arguments in your own main if you don't use automatic test discovery and set the Config for hspecWith (the configSkipPredicate).

If you want to automatically skip a test without specifying it on the command line you can use a .hspec file, see here. The you can override the skip by specifying to match the pattern instead on the command line.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Unicode error only when code run with -n flag at the command-line

From Dev

Run appium test on command line

From Dev

How to run devtools::test from the command line?

From Dev

Run NUnit test on Ubuntu from command line

From Dev

Run Junit Test via command line

From Dev

Flag command line parsing in golang

From Dev

Grails custom flag in command line

From Dev

Haskell Pipes and testing with HSpec

From Dev

Haskell Pipes and testing with HSpec

From Dev

How do you run Google Test through the command line?

From Dev

Run Unit Test by command line - Swift Project with cocoaPods

From Dev

Cannot run individual Test Specifictations from the command line

From Dev

How to run multiple PHPUnit test suites from command line?

From Dev

Compile and run test with JUnit in command line on a single Java class

From Dev

How detect failure of Web Performance Test run from command line

From Dev

How to run multiple PHPUnit test suites from command line?

From Dev

Cannot run individual Test Specifictations from the command line

From Dev

How to run Post-Build Command Line on only 1 target?

From Dev

getopt_long: only modify flag if user supplied command-line option

From Dev

Run expensive code only once, on triggering multiple changes

From Dev

Run Evolutions in Command Line

From Dev

Run command line in PowerShell

From Dev

Command line run error

From Dev

Is there a convenient way to test if a given flag is supported on a command?

From Dev

Run jekyll build Command with Different url Flag

From Dev

Run jekyll build Command with Different url Flag

From Dev

Command line flag for mplayer to use hardware acceleration?

From Dev

Java command line tool, verbose output flag

From Dev

Can UVM flag a bad command line argument?

Related Related

  1. 1

    Unicode error only when code run with -n flag at the command-line

  2. 2

    Run appium test on command line

  3. 3

    How to run devtools::test from the command line?

  4. 4

    Run NUnit test on Ubuntu from command line

  5. 5

    Run Junit Test via command line

  6. 6

    Flag command line parsing in golang

  7. 7

    Grails custom flag in command line

  8. 8

    Haskell Pipes and testing with HSpec

  9. 9

    Haskell Pipes and testing with HSpec

  10. 10

    How do you run Google Test through the command line?

  11. 11

    Run Unit Test by command line - Swift Project with cocoaPods

  12. 12

    Cannot run individual Test Specifictations from the command line

  13. 13

    How to run multiple PHPUnit test suites from command line?

  14. 14

    Compile and run test with JUnit in command line on a single Java class

  15. 15

    How detect failure of Web Performance Test run from command line

  16. 16

    How to run multiple PHPUnit test suites from command line?

  17. 17

    Cannot run individual Test Specifictations from the command line

  18. 18

    How to run Post-Build Command Line on only 1 target?

  19. 19

    getopt_long: only modify flag if user supplied command-line option

  20. 20

    Run expensive code only once, on triggering multiple changes

  21. 21

    Run Evolutions in Command Line

  22. 22

    Run command line in PowerShell

  23. 23

    Command line run error

  24. 24

    Is there a convenient way to test if a given flag is supported on a command?

  25. 25

    Run jekyll build Command with Different url Flag

  26. 26

    Run jekyll build Command with Different url Flag

  27. 27

    Command line flag for mplayer to use hardware acceleration?

  28. 28

    Java command line tool, verbose output flag

  29. 29

    Can UVM flag a bad command line argument?

HotTag

Archive