Ipr runner and Test patterns

We have some classes here in our project whose names end with "Test" even though they aren't junit Tests.
The Ipr runner tries to execute them as Unit tests and fails, because these classes e.g. don't have a public constructor (and of course they also don't contain junit test cases).

I know that I can configure some test patterns in the build configuration, but I didn't get it to work. Whenever I enter something there, no tests are run at all (TC 1.2).
It would find that unnecessary anyway because of this:

It is really a little bit weird, because these classes aren't located in a test source folder, but in a "real" (production) source folder.

Why does the Ipr runner even try to run anything as junit test that isn't located under a configured test source folder?

By the way, what would be the correct entry in the "Test patterns" field to exclude a class named "de.foo.bar.FooBarTest" from being run as unit test?

9 comments
Comment actions Permalink

By the way, what would be the correct entry in the
"Test patterns" field to exclude a class named
"de.foo.bar.FooBarTest" from being run as unit test?


This should be something like:

-:*/de/foo/bar/FooBarTest.java

Please let us know if this works for you.

Regards,
KIR

0
Comment actions Permalink

No, this doesn't work in TC 1.2
I entered these two lines into the Test patterns field:

-:*/de/zeiss/milano/basic/gui/PingTest.java
-:*/de/zeiss/milano/basic/gui/service/DownloadTestjava

The result is that no tests are run at all.

How about the idea to look for tests only in directories that are marked as "test source" in the Ipr file?
That would basically free the TC admin from the burden to configure these test patterns at all.

0
Comment actions Permalink

You should also add the line

:/Test.java

(this is default pattern which is used when field is empty).
We show it in Agra.

Regards,
KIR

0
Comment actions Permalink

Allright, after fiddling with these settings for hours and with professional help I finally got it to work. ;)

However I still don't get the rational behind looking for unit tests in production source folders.

0
Comment actions Permalink

Is there any chance that in TC 2.0 a change is made so that tests are only searched in source folders marked as test folders (and thus making the administration effort less)?

0
Comment actions Permalink

Tobias, Agra will be released within next couple of days. So there are no chances.
I'd really appreciate if you write a feature request for this in our Jira. We'll probably fix it in the Agra bugfix update.

And, as long as you're online, please try our RC build.

Kind regards,
KIR

0
Comment actions Permalink

I'll be back in office on Tuesday and I'll try the RC immediately then. I already downloaded it. ;)

0
Comment actions Permalink

Thanks Tobias but I think on Tuesday you'll be downloading the release ;)

0
Comment actions Permalink

Allright, let's see who's faster... :D

But as the RC was released on Saturday evenening, there probably wasn't very much effort spent by anyone to test it if you release 2.0 on Tuesday.

I created a jira issue for the test search topic:
http://www.jetbrains.net/jira/browse/TW-2333

0

Please sign in to leave a comment.