Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

atlas-integration-test - how to exclude tests from running

Manuel Kummerländer January 12, 2014

I would like to exclude some tests by their package- or classnames from being executed by atlas-integration-test. I tried this to do so:

Maven Failsafe Plugin and Profiles + Exclusions

<profiles>
   <profile>
      <id>skipSelenium</id>
      <activation>
         <activeByDefault>true</activeByDefault>
      </activation>
      <build>
         <plugins>
            <plugin>
               <artifactId>maven-failsafe-plugin</artifactId>
               <version>2.14</version>
               <configuration>
                  <includes>
                     <include>it/**</include>
                  </includes>
                  <excludes>
                     <exclude>it/selenium/**</exclude>
                  </excludes>
               </configuration>
               <executions>
                  <execution>
                     <goals>
                        <goal>integration-test</goal>
                        <goal>verify</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>
         </plugins>
      </build>
   </profile>
</profiles>
atlas-integration-test -PskipSelenium

But it doesn't work. atlas-integration-test still executes every test located inside the it.*-Package. Does it has to do with atlas-integration-test? Do I miss something here? I tried as well to exclude by specific (and working) classpath (<exclude>**/*SeleniumIntegrationTest.java</exclude>) just to be sure it has nothing to do with some buggy notation. But no, the exclusion doesn't work.

I tried to categorize my tests as written e.g. here: https://weblogs.java.net/blog/johnsmart/archive/2010/04/25/grouping-tests-using-junit-categories-0. Same result, doesn't work :(
Why?

Thanks for your help!
Kind regards

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Adrien Ragot 2
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2014

You should amend the plugin maven-amps-plugin (or amps-maven-plugin or maven-confluence-plugin, depending on which one is defined in your pom.xml) and define skipTests to true.

Actually, here is the doc, there is probably a variable which suits your needs, you will poke in the dark and it will be hard, but you're a brave man aren't you?

Manuel Kummerländer January 19, 2014

Thanks!

After some tries finally <testGroups> meet my requirements:

&lt;testGroups&gt;
      &lt;testGroup&gt;
         &lt;id&gt;no-selenium&lt;/id&gt;
         &lt;productIds&gt;
            &lt;productId&gt;confluence&lt;/productId&gt;
         &lt;/productIds&gt;
         &lt;includes&gt;
            &lt;include&gt;it/net/**/*Test.java&lt;/include&gt;
         &lt;/includes&gt;
      &lt;/testGroup&gt;
   &lt;/testGroups&gt;
   &lt;testGroups&gt;
      &lt;testGroup&gt;
         &lt;id&gt;selenium&lt;/id&gt;
         &lt;productIds&gt;
            &lt;productId&gt;confluence&lt;/productId&gt;
         &lt;/productIds&gt;
         &lt;includes&gt;
            &lt;include&gt;it/selenium/**/*Test.java&lt;/include&gt;
         &lt;/includes&gt;
      &lt;/testGroup&gt;
   &lt;/testGroups&gt;

I don't really understand why I have to define the element <testGroups> 2 times to get this groups work. If I have only one element the grouping itself doesn't work. Seems strange for me but maybe I missed something. But I am pleased, I got what I wanted :)

TAGS
AUG Leaders

Atlassian Community Events