Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have SBT re-run only failed tests

Is there a way to have SBT re-run only the tests that have failed in the last run of the test suite? For example, if I run sbt test and 3 out of the 20 tests I run fail, is there any command I can run to have SBT just re-run those 3 tests that fail?

Specifically I am using Scala Test and Scala Check for the tests I am running through SBT.

like image 816
Christopher Wells Avatar asked Mar 04 '17 18:03

Christopher Wells


People also ask

Does sbt run tests in parallel?

By default, sbt executes tasks in parallel (subject to the ordering constraints already described) in an effort to utilize all available processors. Also by default, each test class is mapped to its own task to enable executing tests in parallel.

How do I clear my sbt cache?

You can use Pretty Clean to clean the all of dev tools caches including SBT. PrettyClean also cleans the SBT project's target folder.

What is sbt testing?

The serum bactericidal test (SBT) has been used for almost 40 years to monitor therapy in patients with bacterial endocarditis, osteomyelitis, and other serious infections.

What does sbt run do?

Runs the main class for the project in the same virtual machine as sbt. Creates a jar file containing the files in src/main/resources and the classes compiled from src/main/scala and src/main/java. Displays detailed help for the specified command. If no command is provided, displays brief descriptions of all commands.


1 Answers

If you are using the latest version of sbt simply run sbt testQuick.

http://www.scala-sbt.org/0.13/docs/Testing.html

like image 162
Cameron Meyer Avatar answered Oct 15 '22 05:10

Cameron Meyer