On 18 July 2013 22:15, Gilles <gil...@harfang.homelinux.org> wrote:
> On Thu, 18 Jul 2013 20:35:53 +0100, sebb wrote:
>>
>> On 18 July 2013 20:06, Gilles <gil...@harfang.homelinux.org> wrote:
>>>
>>> On Thu, 18 Jul 2013 16:19:10 +0100, sebb wrote:
>>>>
>>>>
>>>> Some MATH unit tests take a long time to run.
>>>>
>>>> One example is CMAESOptimizerTest, which is run twice - once for the
>>>> deprecated code and once for the new code.
>>>>
>>>> Would it make sense to exclude the long-running tests of deprecated
>>>> classes by default?
>>>>
>>>> Or maybe all the tests of deprecated classes should be skipped by
>>>> default?
>>>>
>>>> In the case where entire packages have been deprecated, that would be
>>>> fairly easy.
>>>
>>>
>>>
>>> By @Ignore'ing the tests for the deprecated classes, we'd run the
>>> risk that a release contains failing code.
>>
>>
>> That is not what I am suggesting.
>
>
> I didn't get what you were suggesting.
>
>
>>> Sometimes deprecated code must be touched, e.g. to redirect the
>>> internals toward new implementations (delegation). Bugs could be
>>> introduced unknowingly.
>>> Also the conversion of unit tests is not always trivial, and it is
>>> very useful to see that converted units tests run in the same way
>>> as those of the deprecated code.
>>>
>>> Isn't it possible to tell Junit to not run some tests (i.e. the
>>> opposite of "-Dtest=SomeTest")?
>>
>>
>> Possibly, but there are too many to make it convenient, and who is
>> going to remember which of the CMAES tests to disable and which needs
>> to be run?
>> They both have the same name; they are in different packages.
>>
>> I'm suggesting using a profile which is disabled by default.
>> In the same way that we don't run performance tests every time,  maybe
>> it's not necessary to run deprecated class tests every time.
>
>
> So, are you proposing to rename e.g.
>   CMAESOptimizerTest
> to
>   CMAESOptimizerTestDeprecated
> ?

No.

> Then I would need to explicitly require the tests to be run. If possible,
> I'd prefer the other way around run everything except when told
> otherwise.[1]

That would be possible.

> Could this be possible with a rename like
>   CMAESOptimizerDeprecatedTest
> and the profile looking for the pattern ".*DeprecatedTest"?

There are various ways of doing it.

One is renaming test class files so they contain a marker string, and
excluding/including by looking for the marker
Another is by specific named exclusions.
Another is by packages (many packages are entirely deprecated).

Only the first option requires changes to anything other than the pom.

> [Overall, I don't think it's worth the hassle given that it will/should
> be used only during a (hopefully short) transition period.]

At present I'm just trying to establish if there is any interest; the
exact mechanics can be left for later.

>
> Gilles
>
> [1] So that the usefulness of getting results of all tests with the same
>     basename is retained when refactoring.

Bad premise; the tests don't have to be renamed.
So it does not matter if the default is true or false.

>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to