You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beam.apache.org by Rui Wang <ru...@google.com> on 2018/10/01 23:32:54 UTC

Move mock classes out of test directory in BeamSQL

Hi Community,

BeamSQL defines some mock classes (see mock
<https://github.com/apache/beam/tree/master/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/mock>)
in a test directory. As there is more than one module under sql
<https://github.com/apache/beam/tree/master/sdks/java/extensions/sql> now,
there is a need to share these mock classes among modules.

So I want to move these mock classes to a separate module under sql
<https://github.com/apache/beam/tree/master/sdks/java/extensions/sql>, so
other modules' tests can depend on this mock module.


What do you think of this idea?


-Rui

Re: Move mock classes out of test directory in BeamSQL

Posted by Rui Wang <ru...@google.com>.
In #6566 <https://github.com/apache/beam/pull/6566>, I moved mock classes
to sdk/extensions/sql/meta/provider/test
<https://github.com/apache/beam/tree/master/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/test>,
which is in BeamSQL's src/main and has already have this test directory to
save test table provider. I marked every mock class @Experimental as well.

Besides the reason that Andrew mentioned, another reason to move mock
classes to BeamSQL src/main is, usually if a module needs to use these
table mock classes, it will also need to depend on BeamSQL core directly.

-Rui



On Wed, Oct 3, 2018 at 10:37 AM Rui Wang <ru...@google.com> wrote:

> Thanks. Looks like at least moving mock is an accepted idea. I will come
> up a moving plan later (either to separate or to src/main, no matter what
> makes sense) and share it with you.
>
>
> -Rui
>
> On Wed, Oct 3, 2018 at 8:15 AM Andrew Pilloud <ap...@google.com> wrote:
>
>> The sql module's tests depend on mocks and mocks depend on sql module, so
>> moving this to a separate module creates a weird dependency graph. I don't
>> think it is strictly circular but it comes close. Can we just move the
>> folder from 'src/test' to 'src/main' and mark everything @Experimental?
>>
>> Andrew
>>
>> On Wed, Oct 3, 2018 at 2:28 AM Kai Jiang <ji...@gmail.com> wrote:
>>
>>> Big +1.
>>>
>>> Best,
>>> Kai
>>> ᐧ
>>>
>>> On Mon, Oct 1, 2018 at 10:42 PM Jean-Baptiste Onofré <jb...@nanthrax.net>
>>> wrote:
>>>
>>>> +1
>>>>
>>>> it makes sense.
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 02/10/2018 01:32, Rui Wang wrote:
>>>> > Hi Community,
>>>> >
>>>> > BeamSQL defines some mock classes (see mock
>>>> > <
>>>> https://github.com/apache/beam/tree/master/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/mock
>>>> >)
>>>> > in a test directory. As there is more than one module under sql
>>>> > <https://github.com/apache/beam/tree/master/sdks/java/extensions/sql
>>>> > now,
>>>> > there is a need to share these mock classes among modules.
>>>> >
>>>> > So I want to move these mock classes to a separate module under sql
>>>> > <https://github.com/apache/beam/tree/master/sdks/java/extensions/sql
>>>> >,
>>>> > so other modules' tests can depend on this mock module.
>>>> >
>>>> >
>>>> > What do you think of this idea?
>>>> >
>>>> >
>>>> > -Rui
>>>> >
>>>> >
>>>>
>>>> --
>>>> Jean-Baptiste Onofré
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>

Re: Move mock classes out of test directory in BeamSQL

Posted by Rui Wang <ru...@google.com>.
Thanks. Looks like at least moving mock is an accepted idea. I will come up
a moving plan later (either to separate or to src/main, no matter what
makes sense) and share it with you.


-Rui

On Wed, Oct 3, 2018 at 8:15 AM Andrew Pilloud <ap...@google.com> wrote:

> The sql module's tests depend on mocks and mocks depend on sql module, so
> moving this to a separate module creates a weird dependency graph. I don't
> think it is strictly circular but it comes close. Can we just move the
> folder from 'src/test' to 'src/main' and mark everything @Experimental?
>
> Andrew
>
> On Wed, Oct 3, 2018 at 2:28 AM Kai Jiang <ji...@gmail.com> wrote:
>
>> Big +1.
>>
>> Best,
>> Kai
>> ᐧ
>>
>> On Mon, Oct 1, 2018 at 10:42 PM Jean-Baptiste Onofré <jb...@nanthrax.net>
>> wrote:
>>
>>> +1
>>>
>>> it makes sense.
>>>
>>> Regards
>>> JB
>>>
>>> On 02/10/2018 01:32, Rui Wang wrote:
>>> > Hi Community,
>>> >
>>> > BeamSQL defines some mock classes (see mock
>>> > <
>>> https://github.com/apache/beam/tree/master/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/mock
>>> >)
>>> > in a test directory. As there is more than one module under sql
>>> > <https://github.com/apache/beam/tree/master/sdks/java/extensions/sql
>>> > now,
>>> > there is a need to share these mock classes among modules.
>>> >
>>> > So I want to move these mock classes to a separate module under sql
>>> > <https://github.com/apache/beam/tree/master/sdks/java/extensions/sql>,
>>> > so other modules' tests can depend on this mock module.
>>> >
>>> >
>>> > What do you think of this idea?
>>> >
>>> >
>>> > -Rui
>>> >
>>> >
>>>
>>> --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>

Re: Move mock classes out of test directory in BeamSQL

Posted by Andrew Pilloud <ap...@google.com>.
The sql module's tests depend on mocks and mocks depend on sql module, so
moving this to a separate module creates a weird dependency graph. I don't
think it is strictly circular but it comes close. Can we just move the
folder from 'src/test' to 'src/main' and mark everything @Experimental?

Andrew

On Wed, Oct 3, 2018 at 2:28 AM Kai Jiang <ji...@gmail.com> wrote:

> Big +1.
>
> Best,
> Kai
> ᐧ
>
> On Mon, Oct 1, 2018 at 10:42 PM Jean-Baptiste Onofré <jb...@nanthrax.net>
> wrote:
>
>> +1
>>
>> it makes sense.
>>
>> Regards
>> JB
>>
>> On 02/10/2018 01:32, Rui Wang wrote:
>> > Hi Community,
>> >
>> > BeamSQL defines some mock classes (see mock
>> > <
>> https://github.com/apache/beam/tree/master/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/mock
>> >)
>> > in a test directory. As there is more than one module under sql
>> > <https://github.com/apache/beam/tree/master/sdks/java/extensions/sql
>> > now,
>> > there is a need to share these mock classes among modules.
>> >
>> > So I want to move these mock classes to a separate module under sql
>> > <https://github.com/apache/beam/tree/master/sdks/java/extensions/sql>,
>> > so other modules' tests can depend on this mock module.
>> >
>> >
>> > What do you think of this idea?
>> >
>> >
>> > -Rui
>> >
>> >
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>

Re: Move mock classes out of test directory in BeamSQL

Posted by Kai Jiang <ji...@gmail.com>.
Big +1.

Best,
Kai
ᐧ

On Mon, Oct 1, 2018 at 10:42 PM Jean-Baptiste Onofré <jb...@nanthrax.net>
wrote:

> +1
>
> it makes sense.
>
> Regards
> JB
>
> On 02/10/2018 01:32, Rui Wang wrote:
> > Hi Community,
> >
> > BeamSQL defines some mock classes (see mock
> > <
> https://github.com/apache/beam/tree/master/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/mock
> >)
> > in a test directory. As there is more than one module under sql
> > <https://github.com/apache/beam/tree/master/sdks/java/extensions/sql
> > now,
> > there is a need to share these mock classes among modules.
> >
> > So I want to move these mock classes to a separate module under sql
> > <https://github.com/apache/beam/tree/master/sdks/java/extensions/sql>,
> > so other modules' tests can depend on this mock module.
> >
> >
> > What do you think of this idea?
> >
> >
> > -Rui
> >
> >
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: Move mock classes out of test directory in BeamSQL

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
+1

it makes sense.

Regards
JB

On 02/10/2018 01:32, Rui Wang wrote:
> Hi Community,
> 
> BeamSQL defines some mock classes (see mock
> <https://github.com/apache/beam/tree/master/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/mock>)
> in a test directory. As there is more than one module under sql
> <https://github.com/apache/beam/tree/master/sdks/java/extensions/sql> now,
> there is a need to share these mock classes among modules.
> 
> So I want to move these mock classes to a separate module under sql
> <https://github.com/apache/beam/tree/master/sdks/java/extensions/sql>,
> so other modules' tests can depend on this mock module.
> 
> 
> What do you think of this idea?
> 
> 
> -Rui
> 
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com