Jumit SBT - unit vs integration tests

13 views
Skip to first unread message

Bruno Bieth

unread,
Nov 1, 2013, 7:43:42 AM11/1/13
to jumi-tes...@googlegroups.com
When I execute jumiTest, both unit and integration tests get executed. How can I segregate the two?

Thanks

Esko Luontola

unread,
Nov 2, 2013, 3:55:43 PM11/2/13
to jumi-tes...@googlegroups.com
Bruno Bieth wrote on 1.11.2013 13:43:
> When I execute jumiTest, both unit and integration tests get executed.
> How can I segregate the two?

Currently it's possible to use file name patterns to choose what to
execute. Jumi's IncludedTestsPattern and ExcludedTestsPattern parameters
accept both glob and regex patterns. Here is the syntax reference:

http://docs.oracle.com/javase/tutorial/essential/io/fileOps.html#glob
http://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystem.html#getPathMatcher(java.lang.String)

If you name your normal classes "FooTest" and integration tests "FooIT",
then it should be quite easy to use glob patterns to segregate them. If
all integration tests are in a particular package or class, then
segregating them can be done by using ExcludedTestsPattern to exclude
them from unit tests. For more complicated situations regular
expressions might be needed. [1]

In the future I might add other ways to filter the tests, for example
using tags, but that's far into the future; I don't yet have a clear
idea of what would be the best way to do it in a way that would fit most
testing frameworks. Running only a single test in a test class is
another thing for which it's hard to invent a generic mechanism, so it
may need to be a 80/20% solution.

[1]
http://www.codinghorror.com/blog/2008/06/regular-expressions-now-you-have-two-problems.html

--
Esko Luontola
www.orfjackal.net
Reply all
Reply to author
Forward
0 new messages