[hibernate-dev] [OGM] Embedded MongoDB for tests

2013-06-27 Thread Gunnar Morling
Hi all,

I just came across across "EmbedMongo" [1] which provides a way to run
MongoDB embedded within an application. This is e.g. convenient for tests
as it doesn't require a separately installed MongoDB instance.

I've tried it out with a single test and it worked as expected.
Unfortunately MongoDB (the server) can't be retrieved as Maven dependency,
EmbedMongo thus retrieves the distribution via HTTP and stores it in
~/.embedmongo/. This only happens once during the first usage.

What do you think, would that be helpful to be used for the OGM MongoDB
tests (it might well be that this or similar options have been discussed
before and I just missed that)?

--Gunnar

[1] https://github.com/flapdoodle-oss/embedmongo.flapdoodle.de
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] [OGM] Embedded MongoDB for tests

2013-06-27 Thread Hardy Ferentschik

On 27 Jan 2013, at 2:20 PM, Gunnar Morling  wrote:

> I just came across across "EmbedMongo" [1] which provides a way to run
> MongoDB embedded within an application. This is e.g. convenient for tests
> as it doesn't require a separately installed MongoDB instance.

Interesting. I think that could be a nice solution. 

> I've tried it out with a single test and it worked as expected.
> Unfortunately MongoDB (the server) can't be retrieved as Maven dependency,
> EmbedMongo thus retrieves the distribution via HTTP and stores it in
> ~/.embedmongo/. This only happens once during the first usage.

Sounds reasonable. 

> What do you think, would that be helpful to be used for the OGM MongoDB
> tests (it might well be that this or similar options have been discussed
> before and I just missed that)?

I like the idea. AFAIK it has not been discussed so far.

--Hardy
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] [OGM] Embedded MongoDB for tests

2013-06-27 Thread Sanne Grinovero
I heard good praises about this project, so it might be good, but I'd
be concerned that we're not testing the real thing.

This could be great to mock the db for some operations, but could it
replace all of them while providing us with the same level of
confidence ?

What will the gap be in release times to adapt to mock newer features?

Considering that installing a MongoDB installation takes seconds, I
don't see a big win in using it, while there is a potential list of
trouble.

Considering H2 has some options to have it mimick Oracle and MySQL,
would you use it to test the ORM dialect for these databases? I don't
think I'd trust that.

This project might be great for simpler cases but I think that
replacing the "real thing" in our case will provide for lower quality
releases; maybe we could have the best of two worlds by using profiles
and providing this as a fallback when MongoDB is not installed, in
which case on CI I would want to verify tests on both.

Sanne


On 27 June 2013 15:24, Hardy Ferentschik  wrote:
>
> On 27 Jan 2013, at 2:20 PM, Gunnar Morling  wrote:
>
>> I just came across across "EmbedMongo" [1] which provides a way to run
>> MongoDB embedded within an application. This is e.g. convenient for tests
>> as it doesn't require a separately installed MongoDB instance.
>
> Interesting. I think that could be a nice solution.
>
>> I've tried it out with a single test and it worked as expected.
>> Unfortunately MongoDB (the server) can't be retrieved as Maven dependency,
>> EmbedMongo thus retrieves the distribution via HTTP and stores it in
>> ~/.embedmongo/. This only happens once during the first usage.
>
> Sounds reasonable.
>
>> What do you think, would that be helpful to be used for the OGM MongoDB
>> tests (it might well be that this or similar options have been discussed
>> before and I just missed that)?
>
> I like the idea. AFAIK it has not been discussed so far.
>
> --Hardy
> ___
> hibernate-dev mailing list
> hibernate-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] [OGM] Embedded MongoDB for tests

2013-06-27 Thread Hardy Ferentschik

On 27 Jan 2013, at 3:23 PM, Sanne Grinovero  wrote:

> I heard good praises about this project, so it might be good, but I'd
> be concerned that we're not testing the real thing.

I thought it is running the real thing. It is not mocking mongo, it is just a 
wrapper to
download/install/start/stop a mongo instance. 

> Considering that installing a MongoDB installation takes seconds, I
> don't see a big win in using it, while there is a potential list of
> trouble.

It is about automation. I guess you might be able to script the mongo install 
as well
w/o EmbedMongo. Really it is not much different to automatically downloading 
your
AS instance for unit testing.

--Hardy


___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


[hibernate-dev] IRC Developer Meeting - 6/27

2013-06-27 Thread Steve Ebersole
Today was mostly discussion about the Maven and Gradle plugin development

[11:04]  Meeting ended Thu Jun 27 16:00:00 2013 UTC. Information 
about MeetBot at http://wiki.debian.org/MeetBot . (v 0.1.4)
[11:04]  Minutes: 
http://transcripts.jboss.org/meeting/irc.freenode.org/hibernate-dev/2013/hibernate-dev.2013-06-27-15.08.html
[11:04]  Minutes (text): 
http://transcripts.jboss.org/meeting/irc.freenode.org/hibernate-dev/2013/hibernate-dev.2013-06-27-15.08.txt
[11:04]  Log: 
http://transcripts.jboss.org/meeting/irc.freenode.org/hibernate-dev/2013/hibernate-dev.2013-06-27-15.08.log.html
 

___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] [OGM] Embedded MongoDB for tests

2013-06-27 Thread Gunnar Morling
2013/6/27 Sanne Grinovero 

> I heard good praises about this project, so it might be good, but I'd
> be concerned that we're not testing the real thing.
>
> This could be great to mock the db for some operations, but could it
> replace all of them while providing us with the same level of
> confidence ?
>
> What will the gap be in release times to adapt to mock newer features?
>

AFAICS there is no mocking involved, this is the actual MongoDB. It get's
the distribution from mongodb.org, unpacks and starts it. I think the term
"embedded" is a bit misleading, because really it starts a separate process
for mongod. The client then opens a TCP connection to the DB just as if it
was installed, so I don't think there is really any difference.

Considering that installing a MongoDB installation takes seconds, I
> don't see a big win in using it, while there is a potential list of
> trouble.
>

I think the win is increased ease of use, in particular for new developers.
E.g. I first wasn't aware that the mongo module isn't built by default when
doing "mvn install" on the root level unlike ehcache etc. (I know, I should
have read the readme ;)). It also makes it very easy to test against
different Mongo versions if required, also updating to a new version is
just a matter of changing the test configuration.


> Considering H2 has some options to have it mimick Oracle and MySQL,
> would you use it to test the ORM dialect for these databases? I don't
> think I'd trust that.
>

I think a more suitable comparison would be if there was an embedded
version of Oracle or MySQL, which I personally definitely would consider
for tests (when I installed Oracle last time on Ubuntu it really was a
pain, maybe it's easier nowadays).


> This project might be great for simpler cases but I think that
> replacing the "real thing" in our case will provide for lower quality
> releases; maybe we could have the best of two worlds by using profiles
> and providing this as a fallback when MongoDB is not installed, in
> which case on CI I would want to verify tests on both.
>

This might be an interesting option, too.

That said, I noticed one downside. EmbedMongo stores the distribution file
locally after it has downloaded it once, but it unpacks this archive each
time when starting the DB. That's not so bad when doing it once for the
entire test suite, but it is more significant when doing it for single
tests e.g. run from within the IDE.

Sanne
>

--Gunnar


>
>
> On 27 June 2013 15:24, Hardy Ferentschik  wrote:
> >
> > On 27 Jan 2013, at 2:20 PM, Gunnar Morling  wrote:
> >
> >> I just came across across "EmbedMongo" [1] which provides a way to run
> >> MongoDB embedded within an application. This is e.g. convenient for
> tests
> >> as it doesn't require a separately installed MongoDB instance.
> >
> > Interesting. I think that could be a nice solution.
> >
> >> I've tried it out with a single test and it worked as expected.
> >> Unfortunately MongoDB (the server) can't be retrieved as Maven
> dependency,
> >> EmbedMongo thus retrieves the distribution via HTTP and stores it in
> >> ~/.embedmongo/. This only happens once during the first usage.
> >
> > Sounds reasonable.
> >
> >> What do you think, would that be helpful to be used for the OGM MongoDB
> >> tests (it might well be that this or similar options have been discussed
> >> before and I just missed that)?
> >
> > I like the idea. AFAIK it has not been discussed so far.
> >
> > --Hardy
> > ___
> > hibernate-dev mailing list
> > hibernate-dev@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/hibernate-dev
>
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev