How to differentiate between unit tests and integration tests in Buildr?

136 Views Asked by At

The Buildr quickstart documentation has a section on integration tests should be written. It briefly says you can write integration tests "[in] much the same way as you write unit tests."

However, it doesn't say how Buildr figures out which tests (whether it be JUnit4, scalatest or whatever) should only be invoked as integration tests (executed after package) and which ones are simply treated as unit tests (executed after build).

As a long shot I have tried putting (Java) JUnit4 test sources into src/it/java (the proposed location for integration tests in the future versions of Maven) but Buildr did not pick those tests up.

Can somebody clarify what I must do in a Buildr project to have a test not run after build but only after package?

1

There are 1 best solutions below

1
On

Any given subproject in buildr can only have either unit or integration tests. The location of the tests in the project is the same whether they are unit or integration tests. For JUnit4 the location would be [subproject_root]/src/test/java.

Unit tests are the default. You indicate that a subproject's tests are integration tests via the test.using directive:

define 'foo' do
  # ...
  test.using :integration
  # ...
end