Emmanuel Lecharny wrote:
(1)
Some long running tests have the suffix "ITest" (and so they are
selected only when integration tests should run), and some have not. For
instance there are both ReferralITest and ReferralTest, with exactly the
same javadoc ("Tests to make sure the server is operating correctly when
handling referrals."), but different tests. Is there a rationale whether
a tests is an ITest or a Test? What if I change an ITest and make it
dramatically faster with the help of AbstractServerFastTest. Should I
rename it?
There is a JIRA about this :
https://issues.apache.org/jira/browse/DIRSERVER-1022
I will handle this special case (if I can). But my question is more
general: What makes a Test an ITest? Is there any guideline? For instance:
* If it takes longer than x seconds
* If starting the server in an embedded way is necessary
* If the network layer is used by the test
* ...
?
(2)
Some tests have a prefix "Fast...", like FastAddITest or FastDelITest.
These are in fact subclasses from AbstractServerFastTest. If I refactor
a class XYTest and make it a subclass of AbstractServerFastTest, should
I rename it to FastXYTest? I must say that I do not like it. From a
design point of view, the aspect that a test runs fast should not make
it in the test name.
It's temporary. I just didn't wanted to remove the 'slow' tests,
because theyr are our baseline for tests, so I prefixed the new ones
with FAST.
We had a convo with Alex about that, and I suggested that we add a new
maven's profile to run the new tests (or the old tests). For instance,
the AddITest can be renamed AddSItest (SI for SlowIntegration) and
FastAddITest will be renamed to AddITest.
Why do we still need the old tests in the slow fashion? I thought
migrating existing tests to your new base class (AbstractServerFastTest)
is a very good idea, if we can guarantee that the behavior is
equivalent. I have already done this for ModifyRdnTest and
ModifyRemoveTest. Both were not tagged as ITest in their name before,
although they probably should have been (see above)?. Now they are
dramatically faster, due to JUnit 4 and your BeforeClass feature.
Maybe there are some tests in server-unit, which can't be converted to
AbstractServerFastTest, because they need a totally different setup ...
Greetings,
Stefan