You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Danny Thomas <Da...@blackboard.com> on 2012/01/25 14:44:41 UTC

Surefire TestNG Group Exclusions not working

Hi,

I was trying to configure a TestNG group exclusion based on profile and finding the tests weren't being excluded. After checking everything I could think of and getting nowhere, I checked out the Surefire code and attached a debugger.

I found this must have been broken since TestNG 5.13.0.3 (I'm using TestNG latest, 6.3.1). AbstractSurefireMojo.convertGroupParameters() uses "excludedgroups"  for the property key:

        if ( this.getExcludedGroups() != null )
        {
            getProperties().setProperty( "excludedgroups", this.getExcludedGroups() );
        }

However, since 5.13.0.3, org.testng.CommandLineArgs has changed to "excludegroups" (the hyphen is added later during options conversion):

  public static final String EXCLUDED_GROUPS = "-excludegroups";
  @Parameter(names = EXCLUDED_GROUPS, description ="Comma-separated list of group names to "
      + " exclude")
  public String excludedGroups;

See "Replaced Constants", August 03, 2010, Commit 55cd8fe791efec01c80a0199de9d187d2c836801

https://github.com/cbeust/testng/commit/55cd8fe791efec01c80a0199de9d187d2c836801#src/main/java/org/testng/CommandLineArgs.java

Has this been reported before? I can't find any issues or discussion of this anywhere, but I can't believe it's been broken for 18 months without anyone noticing - what am I missing?

In any case, I'd consider this a TestNG bug anyway, I'll email testng-dev@googlegroups.com<ma...@googlegroups.com> requesting that both forms are recognised to ensure backwards compatibility once I get confirmation I'm not going bonkers.

Cheers,
Danny

This email and any attachments may contain confidential and proprietary information of Blackboard that is for the sole use of the intended recipient. If you are not the intended recipient, disclosure, copying, re-distribution or other use of any of this information is strictly prohibited. Please immediately notify the sender and delete this transmission if you received this email in error.

RE: Surefire TestNG Group Exclusions not working

Posted by Danny Thomas <Da...@blackboard.com>.
Thanks, this fix will definitely cover it, it uses the correct argument:

http://maven.40175.n5.nabble.com/svn-commit-r1210583-in-maven-surefire-trunk-maven-surefire-common-src-main-java-org-apache-maven-plu-td5049823.html

Danny

-----Original Message-----
From: kristian.rosenvold@zenior.no [mailto:kristian.rosenvold@zenior.no] On Behalf Of Kristian Rosenvold
Sent: 25 January 2012 14:11
To: Maven Users List
Subject: Re: Surefire TestNG Group Exclusions not working

this is a bug and it /may/ not have been reported before. We had a regression in 2.11 (http://jira.codehaus.org/browse/SUREFIRE-805)
which actually broke the feature for TestNG (only in 2.11=. You may want to test surefire 2.10 while we're releasing 2.12, which should be pretty soon.

If it does not work with 2.10, you should file a bug towards surefire.

Kristian




2012/1/25 Danny Thomas <Da...@blackboard.com>:
> Hi,
>
> I was trying to configure a TestNG group exclusion based on profile and finding the tests weren't being excluded. After checking everything I could think of and getting nowhere, I checked out the Surefire code and attached a debugger.
>
> I found this must have been broken since TestNG 5.13.0.3 (I'm using TestNG latest, 6.3.1). AbstractSurefireMojo.convertGroupParameters() uses "excludedgroups"  for the property key:
>
>        if ( this.getExcludedGroups() != null )
>        {
>            getProperties().setProperty( "excludedgroups",
> this.getExcludedGroups() );
>        }
>
> However, since 5.13.0.3, org.testng.CommandLineArgs has changed to "excludegroups" (the hyphen is added later during options conversion):
>
>  public static final String EXCLUDED_GROUPS = "-excludegroups";
>  @Parameter(names = EXCLUDED_GROUPS, description ="Comma-separated list of group names to "
>      + " exclude")
>  public String excludedGroups;
>
> See "Replaced Constants", August 03, 2010, Commit
> 55cd8fe791efec01c80a0199de9d187d2c836801
>
> https://github.com/cbeust/testng/commit/55cd8fe791efec01c80a0199de9d18
> 7d2c836801#src/main/java/org/testng/CommandLineArgs.java
>
> Has this been reported before? I can't find any issues or discussion of this anywhere, but I can't believe it's been broken for 18 months without anyone noticing - what am I missing?
>
> In any case, I'd consider this a TestNG bug anyway, I'll email testng-dev@googlegroups.com<ma...@googlegroups.com> requesting that both forms are recognised to ensure backwards compatibility once I get confirmation I'm not going bonkers.
>
> Cheers,
> Danny
>
> This email and any attachments may contain confidential and proprietary information of Blackboard that is for the sole use of the intended recipient. If you are not the intended recipient, disclosure, copying, re-distribution or other use of any of this information is strictly prohibited. Please immediately notify the sender and delete this transmission if you received this email in error.

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


This email and any attachments may contain confidential and proprietary information of Blackboard that is for the sole use of the intended recipient. If you are not the intended recipient, disclosure, copying, re-distribution or other use of any of this information is strictly prohibited. Please immediately notify the sender and delete this transmission if you received this email in error.

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


Re: Surefire TestNG Group Exclusions not working

Posted by Kristian Rosenvold <kr...@gmail.com>.
this is a bug and it /may/ not have been reported before. We had a
regression in 2.11 (http://jira.codehaus.org/browse/SUREFIRE-805)
which actually broke the feature for TestNG (only in 2.11=. You may
want to test surefire 2.10 while we're releasing 2.12, which should
be pretty soon.

If it does not work with 2.10, you should file a bug towards surefire.

Kristian




2012/1/25 Danny Thomas <Da...@blackboard.com>:
> Hi,
>
> I was trying to configure a TestNG group exclusion based on profile and finding the tests weren't being excluded. After checking everything I could think of and getting nowhere, I checked out the Surefire code and attached a debugger.
>
> I found this must have been broken since TestNG 5.13.0.3 (I'm using TestNG latest, 6.3.1). AbstractSurefireMojo.convertGroupParameters() uses "excludedgroups"  for the property key:
>
>        if ( this.getExcludedGroups() != null )
>        {
>            getProperties().setProperty( "excludedgroups", this.getExcludedGroups() );
>        }
>
> However, since 5.13.0.3, org.testng.CommandLineArgs has changed to "excludegroups" (the hyphen is added later during options conversion):
>
>  public static final String EXCLUDED_GROUPS = "-excludegroups";
>  @Parameter(names = EXCLUDED_GROUPS, description ="Comma-separated list of group names to "
>      + " exclude")
>  public String excludedGroups;
>
> See "Replaced Constants", August 03, 2010, Commit 55cd8fe791efec01c80a0199de9d187d2c836801
>
> https://github.com/cbeust/testng/commit/55cd8fe791efec01c80a0199de9d187d2c836801#src/main/java/org/testng/CommandLineArgs.java
>
> Has this been reported before? I can't find any issues or discussion of this anywhere, but I can't believe it's been broken for 18 months without anyone noticing - what am I missing?
>
> In any case, I'd consider this a TestNG bug anyway, I'll email testng-dev@googlegroups.com<ma...@googlegroups.com> requesting that both forms are recognised to ensure backwards compatibility once I get confirmation I'm not going bonkers.
>
> Cheers,
> Danny
>
> This email and any attachments may contain confidential and proprietary information of Blackboard that is for the sole use of the intended recipient. If you are not the intended recipient, disclosure, copying, re-distribution or other use of any of this information is strictly prohibited. Please immediately notify the sender and delete this transmission if you received this email in error.

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