title: Dependencies between tests in scala
body: <p>I want to test a complex workflow, both by unit-testing its components, and running an integration test for the whole thing, without running sub-components twice unnecessarily.</p>
  
  <p>For example, routine <code>c</code> processes the results of <code>a</code> and <code>b</code>. I would like to have the following test suites:</p>
  
  <ul>
  <li>Unit test 1: Running <code>a</code> and validating the results</li>
  <li>Unit test 2: Running <code>b</code> and validating the results</li>
  <li>Nightly integration test: Running <code>a</code> and <code>b</code>, validating their results, then running <code>c</code> and validating its results, <em>without re-running <code>a</code> and <code>b</code></em>, but re-using the outputs</li>
  </ul>
  
  <p>Running each component takes some time, so the obvious solution of "just run everything every time" is not practical.</p>
  
  <p>The code is in Scala, but I don't care which test framework to use - scalatest, specs2, even TestNG, all are fine, though I would prefer a Scala-ish solution. Thanks!</p>