You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by Sai Boorlagadda <sa...@apache.org> on 2018/08/21 16:52:33 UTC

no test category, rename tests?

Many tests file names are *JUnitTest.java[1] even though it is an
integration test or distributed test. After we segregated into respective
folders and removed the test category it is not visible which test it is
unless we look back into the path of the source directory (integrationTest
or distributedTest).

So I wanted to rename tests to reflect test category. Let me know if there
is okay and if I do rename are there any downstream impacts (eg: metrics,
auto diagnosis etc)

Any integration test will be renamed as *IntegrationTest.java
Any distributed test will be renamed as *DistributedTest.java
Any unit test will be renamed as *Test.java.

[1]
https://github.com/apache/geode/blob/develop/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/ComplexDiskRegionJUnitTest.java

Re: no test category, rename tests?

Posted by Kirk Lund <kl...@apache.org>.
There was already an open discussion about how to name tests recently on
the dev list, and the (newish) content about "Writing tests" on the Wiki
reflects what the group wanted at that time. I think everyone in this
community needs to be more active on the dev list in the future, especially
anyone with an opinion.

On Tue, Aug 21, 2018 at 11:33 AM, Jacob Barrett <jb...@pivotal.io> wrote:

> Yeah +0 from me for the same reason.
>
> I’d just make them all *Test. Let the grouping speak for itself.
>
> > On Aug 21, 2018, at 11:28 AM, Anthony Baker <ab...@pivotal.io> wrote:
> >
> > The original purpose of specific names was because we filtered test
> execution based on the name pattern (then we switched to categories and now
> we use source sets / dirs).
> >
> > I like the idea of changing *JUnitTest to *Test.  I’m not as excited
> about *IntegrationTest and friends.  But I’m willing to go with group
> consensus on this (aka +0).
> >
> > Anthony
> >
> >
> >> On Aug 21, 2018, at 10:11 AM, Kirk Lund <kl...@apache.org> wrote:
> >>
> >> +1 Yes! This naming scheme matches what we already have on the Apache
> Geode
> >> Wiki [1] for naming tests.
> >>
> >> Side note: Looks like we need to update the pages on the Wiki to match
> our
> >> recent changes involving JUnit categories.
> >>
> >> [1] https://cwiki.apache.org/confluence/display/GEODE/Writing+tests
> >>
> >> On Tue, Aug 21, 2018 at 9:52 AM, Sai Boorlagadda <
> sai_boorlagadda@apache.org
> >>> wrote:
> >>
> >>> Many tests file names are *JUnitTest.java[1] even though it is an
> >>> integration test or distributed test. After we segregated into
> respective
> >>> folders and removed the test category it is not visible which test it
> is
> >>> unless we look back into the path of the source directory
> (integrationTest
> >>> or distributedTest).
> >>>
> >>> So I wanted to rename tests to reflect test category. Let me know if
> there
> >>> is okay and if I do rename are there any downstream impacts (eg:
> metrics,
> >>> auto diagnosis etc)
> >>>
> >>> Any integration test will be renamed as *IntegrationTest.java
> >>> Any distributed test will be renamed as *DistributedTest.java
> >>> Any unit test will be renamed as *Test.java.
> >>>
> >>> [1]
> >>> https://github.com/apache/geode/blob/develop/geode-core/
> >>> src/integrationTest/java/org/apache/geode/internal/cache/
> >>> ComplexDiskRegionJUnitTest.java
> >>>
> >
>

Re: no test category, rename tests?

Posted by Jacob Barrett <jb...@pivotal.io>.
Yeah +0 from me for the same reason.

I’d just make them all *Test. Let the grouping speak for itself.

> On Aug 21, 2018, at 11:28 AM, Anthony Baker <ab...@pivotal.io> wrote:
> 
> The original purpose of specific names was because we filtered test execution based on the name pattern (then we switched to categories and now we use source sets / dirs).
> 
> I like the idea of changing *JUnitTest to *Test.  I’m not as excited about *IntegrationTest and friends.  But I’m willing to go with group consensus on this (aka +0).
> 
> Anthony
> 
> 
>> On Aug 21, 2018, at 10:11 AM, Kirk Lund <kl...@apache.org> wrote:
>> 
>> +1 Yes! This naming scheme matches what we already have on the Apache Geode
>> Wiki [1] for naming tests.
>> 
>> Side note: Looks like we need to update the pages on the Wiki to match our
>> recent changes involving JUnit categories.
>> 
>> [1] https://cwiki.apache.org/confluence/display/GEODE/Writing+tests
>> 
>> On Tue, Aug 21, 2018 at 9:52 AM, Sai Boorlagadda <sai_boorlagadda@apache.org
>>> wrote:
>> 
>>> Many tests file names are *JUnitTest.java[1] even though it is an
>>> integration test or distributed test. After we segregated into respective
>>> folders and removed the test category it is not visible which test it is
>>> unless we look back into the path of the source directory (integrationTest
>>> or distributedTest).
>>> 
>>> So I wanted to rename tests to reflect test category. Let me know if there
>>> is okay and if I do rename are there any downstream impacts (eg: metrics,
>>> auto diagnosis etc)
>>> 
>>> Any integration test will be renamed as *IntegrationTest.java
>>> Any distributed test will be renamed as *DistributedTest.java
>>> Any unit test will be renamed as *Test.java.
>>> 
>>> [1]
>>> https://github.com/apache/geode/blob/develop/geode-core/
>>> src/integrationTest/java/org/apache/geode/internal/cache/
>>> ComplexDiskRegionJUnitTest.java
>>> 
> 

Re: no test category, rename tests?

Posted by Ryan McMahon <rm...@pivotal.io>.
+1 for the naming convention of *Test, *IntegrationTest, and
*DistributedTest.  It’s mostly personal preference, but I also agree with
Kirk’s comment that it makes it easier to find the test you are looking for
by file name.  I also find it easier to see the test type I’m working with
in the file tabs of my IDE without thinking about the source set.  Again,
it’s mostly personal preference but I think it’s a good convention.

Ryan

On Tue, Aug 21, 2018 at 12:00 PM Kirk Lund <kl...@apache.org> wrote:

> Imagine if all the dunits and integration tests were named FooTest and now
> you finally want to write a unit test for Foo. You'll need to create a 3rd
> test named FootTest or rename the existing FooTests to FooIntegrationTest
> or FooDistributedTest. Since we have separate source sets for all three,
> naming all three FooTest is possible. But in my opinion this is just going
> to cause a lot of suffering when you're searching for the right test to
> modify for a code change or to debug a CI failure. What do you prefer?
>
> On Tue, Aug 21, 2018 at 11:51 AM, Sai Boorlagadda <
> sai.boorlagadda@gmail.com
> > wrote:
>
> > Are there any benefits of naming them specifically to reflect the
> category?
> > I am used to look at test category annotation to differentiate a test is
> a
> > single-vm or a multi-vm.
> >
> > On Tue, Aug 21, 2018 at 11:29 AM Anthony Baker <ab...@pivotal.io>
> wrote:
> >
> > > The original purpose of specific names was because we filtered test
> > > execution based on the name pattern (then we switched to categories and
> > now
> > > we use source sets / dirs).
> > >
> > > I like the idea of changing *JUnitTest to *Test.  I’m not as excited
> > about
> > > *IntegrationTest and friends.  But I’m willing to go with group
> consensus
> > > on this (aka +0).
> > >
> > > Anthony
> > >
> > >
> > > > On Aug 21, 2018, at 10:11 AM, Kirk Lund <kl...@apache.org> wrote:
> > > >
> > > > +1 Yes! This naming scheme matches what we already have on the Apache
> > > Geode
> > > > Wiki [1] for naming tests.
> > > >
> > > > Side note: Looks like we need to update the pages on the Wiki to
> match
> > > our
> > > > recent changes involving JUnit categories.
> > > >
> > > > [1] https://cwiki.apache.org/confluence/display/GEODE/Writing+tests
> > > >
> > > > On Tue, Aug 21, 2018 at 9:52 AM, Sai Boorlagadda <
> > > sai_boorlagadda@apache.org
> > > >> wrote:
> > > >
> > > >> Many tests file names are *JUnitTest.java[1] even though it is an
> > > >> integration test or distributed test. After we segregated into
> > > respective
> > > >> folders and removed the test category it is not visible which test
> it
> > is
> > > >> unless we look back into the path of the source directory
> > > (integrationTest
> > > >> or distributedTest).
> > > >>
> > > >> So I wanted to rename tests to reflect test category. Let me know if
> > > there
> > > >> is okay and if I do rename are there any downstream impacts (eg:
> > > metrics,
> > > >> auto diagnosis etc)
> > > >>
> > > >> Any integration test will be renamed as *IntegrationTest.java
> > > >> Any distributed test will be renamed as *DistributedTest.java
> > > >> Any unit test will be renamed as *Test.java.
> > > >>
> > > >> [1]
> > > >> https://github.com/apache/geode/blob/develop/geode-core/
> > > >> src/integrationTest/java/org/apache/geode/internal/cache/
> > > >> ComplexDiskRegionJUnitTest.java
> > > >>
> > >
> > >
> >
>

Re: no test category, rename tests?

Posted by Kirk Lund <kl...@apache.org>.
Imagine if all the dunits and integration tests were named FooTest and now
you finally want to write a unit test for Foo. You'll need to create a 3rd
test named FootTest or rename the existing FooTests to FooIntegrationTest
or FooDistributedTest. Since we have separate source sets for all three,
naming all three FooTest is possible. But in my opinion this is just going
to cause a lot of suffering when you're searching for the right test to
modify for a code change or to debug a CI failure. What do you prefer?

On Tue, Aug 21, 2018 at 11:51 AM, Sai Boorlagadda <sai.boorlagadda@gmail.com
> wrote:

> Are there any benefits of naming them specifically to reflect the category?
> I am used to look at test category annotation to differentiate a test is a
> single-vm or a multi-vm.
>
> On Tue, Aug 21, 2018 at 11:29 AM Anthony Baker <ab...@pivotal.io> wrote:
>
> > The original purpose of specific names was because we filtered test
> > execution based on the name pattern (then we switched to categories and
> now
> > we use source sets / dirs).
> >
> > I like the idea of changing *JUnitTest to *Test.  I’m not as excited
> about
> > *IntegrationTest and friends.  But I’m willing to go with group consensus
> > on this (aka +0).
> >
> > Anthony
> >
> >
> > > On Aug 21, 2018, at 10:11 AM, Kirk Lund <kl...@apache.org> wrote:
> > >
> > > +1 Yes! This naming scheme matches what we already have on the Apache
> > Geode
> > > Wiki [1] for naming tests.
> > >
> > > Side note: Looks like we need to update the pages on the Wiki to match
> > our
> > > recent changes involving JUnit categories.
> > >
> > > [1] https://cwiki.apache.org/confluence/display/GEODE/Writing+tests
> > >
> > > On Tue, Aug 21, 2018 at 9:52 AM, Sai Boorlagadda <
> > sai_boorlagadda@apache.org
> > >> wrote:
> > >
> > >> Many tests file names are *JUnitTest.java[1] even though it is an
> > >> integration test or distributed test. After we segregated into
> > respective
> > >> folders and removed the test category it is not visible which test it
> is
> > >> unless we look back into the path of the source directory
> > (integrationTest
> > >> or distributedTest).
> > >>
> > >> So I wanted to rename tests to reflect test category. Let me know if
> > there
> > >> is okay and if I do rename are there any downstream impacts (eg:
> > metrics,
> > >> auto diagnosis etc)
> > >>
> > >> Any integration test will be renamed as *IntegrationTest.java
> > >> Any distributed test will be renamed as *DistributedTest.java
> > >> Any unit test will be renamed as *Test.java.
> > >>
> > >> [1]
> > >> https://github.com/apache/geode/blob/develop/geode-core/
> > >> src/integrationTest/java/org/apache/geode/internal/cache/
> > >> ComplexDiskRegionJUnitTest.java
> > >>
> >
> >
>

Re: no test category, rename tests?

Posted by Sai Boorlagadda <sa...@gmail.com>.
Are there any benefits of naming them specifically to reflect the category?
I am used to look at test category annotation to differentiate a test is a
single-vm or a multi-vm.

On Tue, Aug 21, 2018 at 11:29 AM Anthony Baker <ab...@pivotal.io> wrote:

> The original purpose of specific names was because we filtered test
> execution based on the name pattern (then we switched to categories and now
> we use source sets / dirs).
>
> I like the idea of changing *JUnitTest to *Test.  I’m not as excited about
> *IntegrationTest and friends.  But I’m willing to go with group consensus
> on this (aka +0).
>
> Anthony
>
>
> > On Aug 21, 2018, at 10:11 AM, Kirk Lund <kl...@apache.org> wrote:
> >
> > +1 Yes! This naming scheme matches what we already have on the Apache
> Geode
> > Wiki [1] for naming tests.
> >
> > Side note: Looks like we need to update the pages on the Wiki to match
> our
> > recent changes involving JUnit categories.
> >
> > [1] https://cwiki.apache.org/confluence/display/GEODE/Writing+tests
> >
> > On Tue, Aug 21, 2018 at 9:52 AM, Sai Boorlagadda <
> sai_boorlagadda@apache.org
> >> wrote:
> >
> >> Many tests file names are *JUnitTest.java[1] even though it is an
> >> integration test or distributed test. After we segregated into
> respective
> >> folders and removed the test category it is not visible which test it is
> >> unless we look back into the path of the source directory
> (integrationTest
> >> or distributedTest).
> >>
> >> So I wanted to rename tests to reflect test category. Let me know if
> there
> >> is okay and if I do rename are there any downstream impacts (eg:
> metrics,
> >> auto diagnosis etc)
> >>
> >> Any integration test will be renamed as *IntegrationTest.java
> >> Any distributed test will be renamed as *DistributedTest.java
> >> Any unit test will be renamed as *Test.java.
> >>
> >> [1]
> >> https://github.com/apache/geode/blob/develop/geode-core/
> >> src/integrationTest/java/org/apache/geode/internal/cache/
> >> ComplexDiskRegionJUnitTest.java
> >>
>
>

Re: no test category, rename tests?

Posted by Anthony Baker <ab...@pivotal.io>.
The original purpose of specific names was because we filtered test execution based on the name pattern (then we switched to categories and now we use source sets / dirs).

I like the idea of changing *JUnitTest to *Test.  I’m not as excited about *IntegrationTest and friends.  But I’m willing to go with group consensus on this (aka +0).

Anthony


> On Aug 21, 2018, at 10:11 AM, Kirk Lund <kl...@apache.org> wrote:
> 
> +1 Yes! This naming scheme matches what we already have on the Apache Geode
> Wiki [1] for naming tests.
> 
> Side note: Looks like we need to update the pages on the Wiki to match our
> recent changes involving JUnit categories.
> 
> [1] https://cwiki.apache.org/confluence/display/GEODE/Writing+tests
> 
> On Tue, Aug 21, 2018 at 9:52 AM, Sai Boorlagadda <sai_boorlagadda@apache.org
>> wrote:
> 
>> Many tests file names are *JUnitTest.java[1] even though it is an
>> integration test or distributed test. After we segregated into respective
>> folders and removed the test category it is not visible which test it is
>> unless we look back into the path of the source directory (integrationTest
>> or distributedTest).
>> 
>> So I wanted to rename tests to reflect test category. Let me know if there
>> is okay and if I do rename are there any downstream impacts (eg: metrics,
>> auto diagnosis etc)
>> 
>> Any integration test will be renamed as *IntegrationTest.java
>> Any distributed test will be renamed as *DistributedTest.java
>> Any unit test will be renamed as *Test.java.
>> 
>> [1]
>> https://github.com/apache/geode/blob/develop/geode-core/
>> src/integrationTest/java/org/apache/geode/internal/cache/
>> ComplexDiskRegionJUnitTest.java
>> 


Re: no test category, rename tests?

Posted by Kirk Lund <kl...@apache.org>.
+1 Yes! This naming scheme matches what we already have on the Apache Geode
Wiki [1] for naming tests.

Side note: Looks like we need to update the pages on the Wiki to match our
recent changes involving JUnit categories.

[1] https://cwiki.apache.org/confluence/display/GEODE/Writing+tests

On Tue, Aug 21, 2018 at 9:52 AM, Sai Boorlagadda <sai_boorlagadda@apache.org
> wrote:

> Many tests file names are *JUnitTest.java[1] even though it is an
> integration test or distributed test. After we segregated into respective
> folders and removed the test category it is not visible which test it is
> unless we look back into the path of the source directory (integrationTest
> or distributedTest).
>
> So I wanted to rename tests to reflect test category. Let me know if there
> is okay and if I do rename are there any downstream impacts (eg: metrics,
> auto diagnosis etc)
>
> Any integration test will be renamed as *IntegrationTest.java
> Any distributed test will be renamed as *DistributedTest.java
> Any unit test will be renamed as *Test.java.
>
> [1]
> https://github.com/apache/geode/blob/develop/geode-core/
> src/integrationTest/java/org/apache/geode/internal/cache/
> ComplexDiskRegionJUnitTest.java
>