Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set up a multi-stage test pipeline in sbt?

Specifically, for a Scalatra project, but the question probably applies to most.

For example, I typically want to run:

  • unit tests
  • code quality checks (coverage, duplication, complexity, jsLint!)
  • integration tests (not too many!)
  • acceptance tests (usually a "pre-checkin" subset)
  • regression tests (basically the same as acceptance tests, but a bigger set)
  • performance tests

I want to run different subsets of these by context - i.e. after a simple code change I might just run the first three; before checking in I might want to run a bigger set, and the Continuous Integration server might have a "fast" and a "slow" build that have even bigger sets.

The basic sbt docs seem to assume a single "test" target - is there a recommended way to implement multiple test phases like this?

like image 528
Korny Avatar asked Jan 23 '11 03:01

Korny


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.

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.


1 Answers

You may want to look at this blog about using integrated testing with SBT and Hudson:

http://henkelmann.eu/2010/11/14/sbt_hudson_with_test_integration

Then, to add your own actions you can use this page:

http://code.google.com/p/simple-build-tool/wiki/CustomActions

Basically, though, you will probably want to add a new action for each of your testing steps, in order to get the particular events you want to happen.

like image 91
James Black Avatar answered Sep 23 '22 21:09

James Black