You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Julien Nicoulaud <ju...@gmail.com> on 2013/02/18 10:52:06 UTC

Surefire - Run tests on remote hosts through SSH

Hi all,

I'm writing a Maven plugin for Vagrant (
http://nicoulaj.github.com/vagrant-maven-plugin), which is a tool for
managing virtual machines. Right now I have goals to start/stop a virtual
machine on pre/post-integration-test phases.

The next step would be to run integration tests directly on the virtual
machine. Vagrant shares the current working directory with the VM, so it
really is just a matter of "piping" the forked test runner process through
SSH.

After taking a quick look at Surefire API, it seems to me this could be
done by implementing a new provider that would just "wrap" the real one to
have it executed over SSH.

Can any Surefire expert provide advice on this ? Is there a cleaner/simpler
way ?

Sorry if I am asking this on the wrong place, but it seems Surefire
mailing-lists do not work anymore.

Cheers,
Julien

Re: Surefire - Run tests on remote hosts through SSH

Posted by Kristian Rosenvold <kr...@gmail.com>.
2013/2/18 Julien Nicoulaud <ju...@gmail.com>

> What extension point did you had in mind ?

It does not exist, this is where you come in ;) Patches can be attached to
jiras or pu

Re: Surefire - Run tests on remote hosts through SSH

Posted by Kristian Rosenvold <kr...@gmail.com>.
We actually still support forking all the way down to 1.3.

The reason we have no issues for this is
A) No-one is using it.
B) it works as advertised.

Take your pick ;)

Kristian


2013/2/19 Stephen Connolly <st...@gmail.com>

> On 19 February 2013 09:37, Stephen Connolly <
> stephen.alan.connolly@gmail.com
> > wrote:
>
> >
> >
> >
> > On 18 February 2013 21:55, Julien ll Nicoulaud <
> julien.nicoulaud@gmail.com>wrote:
> >
> >> Thanks for the heads up.
> >>
> >> I took a deeper look at Surefire code, and it seems to me this could be
> >> done directly on the client side by just wrapping
> >> CommandLineUtils.executeCommandLine() in ForkStarter (
> >>
> >>
> https://github.com/apache/maven-surefire/blob/master/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java#L440
> >> ).
> >> This could be abstracted with a notion of "CommandLineExecutor". But may
> >> be
> >> it's less generic than just allowing to replace ForkedBooter with
> another
> >> implementation, and do it on the server side. What extension point did
> you
> >> had in mind ?
> >>
> >> Looks interesting but sharing the current work dir is not enough:
> >> > - what about dependencies (in local repo or in reactor)
> >>
> >> - what about multi modules project
> >> >
> >> I agree this will be problematic. In first version, user would have to
> >> make
> >> sure shares are properly setup. We can think about automatically setting
> >> up
> >> shares for known things like local repo, but I'd like to wait for
> Vagrant
> >> 1.1 to be out before starting investigating such things.
> >>
> >
> > A more interesting option would be to do something like KK's remote class
> > loader so that the classpath can be loaded across the SSH tunnel.
> >
> > https://github.com/jenkinsci/remoting
> >
>
> Though it might not be possible to support all the way down to JVM 1.3 with
> such a thing... (Given that surefire is supposed to support running the
> tests (via toolchains) all the way down to 1.3 (or did you drop that far
> Kristian?)
>
>
> >
> > -Stephen
> >
> >
> >>
> >> Julien
> >>
> >
> >
>

Re: Surefire - Run tests on remote hosts through SSH

Posted by Stephen Connolly <st...@gmail.com>.
On 19 February 2013 09:37, Stephen Connolly <stephen.alan.connolly@gmail.com
> wrote:

>
>
>
> On 18 February 2013 21:55, Julien Nicoulaud <ju...@gmail.com>wrote:
>
>> Thanks for the heads up.
>>
>> I took a deeper look at Surefire code, and it seems to me this could be
>> done directly on the client side by just wrapping
>> CommandLineUtils.executeCommandLine() in ForkStarter (
>>
>> https://github.com/apache/maven-surefire/blob/master/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java#L440
>> ).
>> This could be abstracted with a notion of "CommandLineExecutor". But may
>> be
>> it's less generic than just allowing to replace ForkedBooter with another
>> implementation, and do it on the server side. What extension point did you
>> had in mind ?
>>
>> Looks interesting but sharing the current work dir is not enough:
>> > - what about dependencies (in local repo or in reactor)
>>
>> - what about multi modules project
>> >
>> I agree this will be problematic. In first version, user would have to
>> make
>> sure shares are properly setup. We can think about automatically setting
>> up
>> shares for known things like local repo, but I'd like to wait for Vagrant
>> 1.1 to be out before starting investigating such things.
>>
>
> A more interesting option would be to do something like KK's remote class
> loader so that the classpath can be loaded across the SSH tunnel.
>
> https://github.com/jenkinsci/remoting
>

Though it might not be possible to support all the way down to JVM 1.3 with
such a thing... (Given that surefire is supposed to support running the
tests (via toolchains) all the way down to 1.3 (or did you drop that far
Kristian?)


>
> -Stephen
>
>
>>
>> Julien
>>
>
>

Re: Surefire - Run tests on remote hosts through SSH

Posted by Stephen Connolly <st...@gmail.com>.
On 18 February 2013 21:55, Julien Nicoulaud <ju...@gmail.com>wrote:

> Thanks for the heads up.
>
> I took a deeper look at Surefire code, and it seems to me this could be
> done directly on the client side by just wrapping
> CommandLineUtils.executeCommandLine() in ForkStarter (
>
> https://github.com/apache/maven-surefire/blob/master/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java#L440
> ).
> This could be abstracted with a notion of "CommandLineExecutor". But may be
> it's less generic than just allowing to replace ForkedBooter with another
> implementation, and do it on the server side. What extension point did you
> had in mind ?
>
> Looks interesting but sharing the current work dir is not enough:
> > - what about dependencies (in local repo or in reactor)
>
> - what about multi modules project
> >
> I agree this will be problematic. In first version, user would have to make
> sure shares are properly setup. We can think about automatically setting up
> shares for known things like local repo, but I'd like to wait for Vagrant
> 1.1 to be out before starting investigating such things.
>

A more interesting option would be to do something like KK's remote class
loader so that the classpath can be loaded across the SSH tunnel.

https://github.com/jenkinsci/remoting

-Stephen


>
> Julien
>

Re: Surefire - Run tests on remote hosts through SSH

Posted by Julien Nicoulaud <ju...@gmail.com>.
Thanks for the heads up.

I took a deeper look at Surefire code, and it seems to me this could be
done directly on the client side by just wrapping
CommandLineUtils.executeCommandLine() in ForkStarter (
https://github.com/apache/maven-surefire/blob/master/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java#L440).
This could be abstracted with a notion of "CommandLineExecutor". But may be
it's less generic than just allowing to replace ForkedBooter with another
implementation, and do it on the server side. What extension point did you
had in mind ?

Looks interesting but sharing the current work dir is not enough:
> - what about dependencies (in local repo or in reactor)

- what about multi modules project
>
I agree this will be problematic. In first version, user would have to make
sure shares are properly setup. We can think about automatically setting up
shares for known things like local repo, but I'd like to wait for Vagrant
1.1 to be out before starting investigating such things.

Julien

Re: Surefire - Run tests on remote hosts through SSH

Posted by Jeff MAURY <je...@gmail.com>.
Looks interesting but sharing the current work dir is not enough:
- what about dependencies (in local repo or in reactor)
- what about multi modules project

Jeff
Le 18 févr. 2013 10:52, "Julien Nicoulaud" <ju...@gmail.com> a
écrit :

> Hi all,
>
> I'm writing a Maven plugin for Vagrant (
> http://nicoulaj.github.com/vagrant-maven-plugin), which is a tool for
> managing virtual machines. Right now I have goals to start/stop a virtual
> machine on pre/post-integration-test phases.
>
> The next step would be to run integration tests directly on the virtual
> machine. Vagrant shares the current working directory with the VM, so it
> really is just a matter of "piping" the forked test runner process through
> SSH.
>
> After taking a quick look at Surefire API, it seems to me this could be
> done by implementing a new provider that would just "wrap" the real one to
> have it executed over SSH.
>
> Can any Surefire expert provide advice on this ? Is there a cleaner/simpler
> way ?
>
> Sorry if I am asking this on the wrong place, but it seems Surefire
> mailing-lists do not work anymore.
>
> Cheers,
> Julien
>

Re: Surefire - Run tests on remote hosts through SSH

Posted by Kristian Rosenvold <kr...@gmail.com>.
The surefire mailing list has been shut down. I see the pom still points to
the old lists, so I'll remove that.

As for your main issue, this has been discussed somewhat back and forth in
http://jira.codehaus.org/browse/SUREFIRE-811, you may want to take a look
at that. The extension points you wish are not available by default, but it
should be possible to expose them.

Kristian






2013/2/18 Julien Nicoulaud <ju...@gmail.com>

> Hi all,
>
> I'm writing a Maven plugin for Vagrant (
> http://nicoulaj.github.com/vagrant-maven-plugin), which is a tool for
> managing virtual machines. Right now I have goals to start/stop a virtual
> machine on pre/post-integration-test phases.
>
> The next step would be to run integration tests directly on the virtual
> machine. Vagrant shares the current working directory with the VM, so it
> really is just a matter of "piping" the forked test runner process through
> SSH.
>
> After taking a quick look at Surefire API, it seems to me this could be
> done by implementing a new provider that would just "wrap" the real one to
> have it executed over SSH.
>
> Can any Surefire expert provide advice on this ? Is there a cleaner/simpler
> way ?
>
> Sorry if I am asking this on the wrong place, but it seems Surefire
> mailing-lists do not work anymore.
>
> Cheers,
> Julien
>