You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2015/06/18 18:21:28 UTC

controlling surefire execution just with a set of runners

Hi

I use more and more arquillian and applicationcomposer (from tomee project)
to rwite my tests. Issue is you can't use both in the same JVM is test
ordering is random (ie 1 arquillian, 1 appcomposer, 1 appcomposer, 1
arquillian, ...).

Of course I could use a custom sorter but I think surefire could also
support to define by execution a set of runner, ie run in bulk all tests
using the same runner. It would avoid the need to define a custom category.

Config could look like:

<configuration>
   <executions> <!-- TreeMap -->
       <arquillian>org.jboss.arquillian.junit.Arquillian,
cucumber.runtime.arquillian.ArquillianCucumber,
cucumber.runtime.arquillian.CukeSpace   </arquillian>
      <others />
   </executions>
</configuration>

Meaning first execution will be arquillian (and I listed all runners I want
to take into account) and second one will be all tests not matching
previous executions.

In a more hardcoded way (ie only for arquillian and other) I wrote this
surefire child mojo:
https://gist.github.com/rmannibucau/cd6afae1d8a100067981

It uses asm to detect the runner.

Code could for sure be enhanced and simplified hacking in surefire itself
but it is functional.

wdyt?

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

Re: controlling surefire execution just with a set of runners

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Surely groovy is the way to go, i agree
Le 18 juin 2015 21:42, "Tibor Digana" <ti...@apache.org> a écrit :

> There are plenty of requests like
> streaming classes from socket into the plugin and executing
> system properties in execution like you proposed
> different test set or using class loader per test or TestNG groups per
> exeution, but not the Maven execution
>
> So I committed a proposal in a branch and we want to release experimental
> version, but there's so much to do. Maybe using Rhino or Groovy or SPI to
> hack the plugin.
> And there are two sides to hack the plugin. One in in plugin's ClassLoader
> and another is the forked process.
>
> The problem is that when we use your configuration proposal, then it's used
> but you and others will report millions of JIRA bug to extend it and I may
> really kill myself then.
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/controlling-surefire-execution-just-with-a-set-of-runners-tp5837884p5837909.html
> Sent from the Maven Developers mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: controlling surefire execution just with a set of runners

Posted by Tibor Digana <ti...@apache.org>.
There are plenty of requests like
streaming classes from socket into the plugin and executing
system properties in execution like you proposed
different test set or using class loader per test or TestNG groups per
exeution, but not the Maven execution

So I committed a proposal in a branch and we want to release experimental
version, but there's so much to do. Maybe using Rhino or Groovy or SPI to
hack the plugin.
And there are two sides to hack the plugin. One in in plugin's ClassLoader
and another is the forked process.

The problem is that when we use your configuration proposal, then it's used
but you and others will report millions of JIRA bug to extend it and I may
really kill myself then.



--
View this message in context: http://maven.40175.n5.nabble.com/controlling-surefire-execution-just-with-a-set-of-runners-tp5837884p5837909.html
Sent from the Maven Developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: controlling surefire execution just with a set of runners

Posted by Romain Manni-Bucau <rm...@gmail.com>.
That is the point. If not built in it has almost no value compared to
groups since i doubt you ll write a plugin to a mvn plugin in your project
- needs to be seriously generic for your business to do it IMO.

That said there are open doors for tests filtering for surefire without
relying on the backing testing impl - ie aligning junit and testng with
fancy features.

Not adding it is not a blocker but would have been a nice feature to have.
Le 18 juin 2015 19:49, "Tibor Digana" <ti...@apache.org> a écrit :

> I think it would not be difficult to dictate the SurefireProvider to use
> specific JUnit runner or implement SurefireProvider by yourself and specify
> then SPI class for it and list plugin dependency with the provider.
> You can of course use Maven executions or just repeat the invoke().
>
> We want to provide surefire extension API, but this is quite a lot of to do
> in order to have such functionality generic and pluginable.
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/controlling-surefire-execution-just-with-a-set-of-runners-tp5837884p5837897.html
> Sent from the Maven Developers mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: controlling surefire execution just with a set of runners

Posted by Tibor Digana <ti...@apache.org>.
I think it would not be difficult to dictate the SurefireProvider to use
specific JUnit runner or implement SurefireProvider by yourself and specify
then SPI class for it and list plugin dependency with the provider.
You can of course use Maven executions or just repeat the invoke().

We want to provide surefire extension API, but this is quite a lot of to do
in order to have such functionality generic and pluginable.



--
View this message in context: http://maven.40175.n5.nabble.com/controlling-surefire-execution-just-with-a-set-of-runners-tp5837884p5837897.html
Sent from the Maven Developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org