Parallel execution - surefire and maven.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Parallel execution - surefire and maven.

Mohammad Shamsi
Hi All,

Has anyone parallel execution of spock (v1.0) with surefire and maven? 

The following sample configuration works perfectly for JUnit tests but not for Spock tests. Is there any additional configuration that I am missing? 

<plugin>
 
<groupId>org.apache.maven.plugins</groupId>
 
<artifactId>maven-surefire-plugin</artifactId>
 
<version>2.18.1</version>
 
<configuration>
   
<includes>
     
<include>**/*Spec.*</include>
   
</includes>
   
<parallel>classes</parallel>
   
<threadCount>3</threadCount>
 
</configuration>
</plugin>


Cheers,
M. Sarbandian

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Parallel execution - surefire and maven.

Peter Niederwieser
Administrator
I tried this some years ago but didn’t get it to work. My best guess is that Surefire doesn’t support parallel execution for custom JUnit runners. Works fine in Gradle.

Peter

On 18 May 2015, at 22:56, Mohammad Shamsi <[hidden email]> wrote:

Hi All,

Has anyone parallel execution of spock (v1.0) with surefire and maven? 

The following sample configuration works perfectly for JUnit tests but not for Spock tests. Is there any additional configuration that I am missing? 

<plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-surefire-plugin</artifactId>
 <version>2.18.1</version>
 <configuration>
   <includes>
      <include>**/*Spec.*</include>
   </includes>
   <parallel>classes</parallel>
   <threadCount>3</threadCount>
 </configuration>
</plugin>


Cheers,
M. Sarbandian


--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.

signature.asc (859 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Parallel execution - surefire and maven.

Leonard Brünings
There is a pending pull request that should support this https://github.com/spockframework/spock/pull/67

On Tuesday, May 19, 2015 at 3:38:52 AM UTC+2, Peter Niederwieser wrote:
I tried this some years ago but didn’t get it to work. My best guess is that Surefire doesn’t support parallel execution for custom JUnit runners. Works fine in Gradle.

Peter

On 18 May 2015, at 22:56, Mohammad Shamsi <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="hzBx534THsEJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">m.h....@...> wrote:

Hi All,

Has anyone parallel execution of spock (v1.0) with surefire and maven? 

The following sample configuration works perfectly for JUnit tests but not for Spock tests. Is there any additional configuration that I am missing? 

<plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-surefire-plugin</artifactId>
 <version>2.18.1</version>
 <configuration>
   <includes>
      <include>**/*Spec.*</include>
   </includes>
   <parallel>classes</parallel>
   <threadCount>3</threadCount>
 </configuration>
</plugin>


Cheers,
M. Sarbandian


--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="hzBx534THsEJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">spockframewor...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="hzBx534THsEJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">spockfr...@googlegroups.com.
Visit this group at <a href="http://groups.google.com/group/spockframework" target="_blank" rel="nofollow" onmousedown="this.href='http://groups.google.com/group/spockframework';return true;" onclick="this.href='http://groups.google.com/group/spockframework';return true;">http://groups.google.com/group/spockframework.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Parallel execution - surefire and maven.

Mohammad Shamsi
In reply to this post by Peter Niederwieser
Hi Patter, 

According to surefire documents (here) custom JUnit Runners must extend from ParentRunner 

As a prerequisite in JUnit tests, the JUnit runner should extend org.junit.runners.ParentRunner.

Looking at spock junit runner (Sputnik), it is extending directly from Runner, not the ParentRunner. That might explain why surefire is not able to execute spock tests in parallel. 

Cheers,

On Tuesday, 19 May 2015 03:38:52 UTC+2, Peter Niederwieser wrote:
I tried this some years ago but didn’t get it to work. My best guess is that Surefire doesn’t support parallel execution for custom JUnit runners. Works fine in Gradle.

Peter

On 18 May 2015, at 22:56, Mohammad Shamsi <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="hzBx534THsEJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">m.h....@...> wrote:

Hi All,

Has anyone parallel execution of spock (v1.0) with surefire and maven? 

The following sample configuration works perfectly for JUnit tests but not for Spock tests. Is there any additional configuration that I am missing? 

<plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-surefire-plugin</artifactId>
 <version>2.18.1</version>
 <configuration>
   <includes>
      <include>**/*Spec.*</include>
   </includes>
   <parallel>classes</parallel>
   <threadCount>3</threadCount>
 </configuration>
</plugin>


Cheers,
M. Sarbandian


--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="hzBx534THsEJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">spockframewor...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="hzBx534THsEJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">spockfr...@googlegroups.com.
Visit this group at <a href="http://groups.google.com/group/spockframework" target="_blank" rel="nofollow" onmousedown="this.href='http://groups.google.com/group/spockframework';return true;" onclick="this.href='http://groups.google.com/group/spockframework';return true;">http://groups.google.com/group/spockframework.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.