<package name=".*"> in testng.xml causes all tests to be skipped

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

<package name=".*"> in testng.xml causes all tests to be skipped

Ganime Betül AKIN
Hi All,

I am new to the group. I searched extensively and tried a number of things but could not solve my problem.

I would like to create a suite file to exclude some packages. I first tried including everything with ".*". 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="false" configfailurepolicy="continue">
  <test name="Test" preserve-order="false">
                <packages>
            <package name=".*">
            </package>
        </packages>
  </test>
</suite>


But this  causes tests to be skipped with the message: 

runTests:
Skipped because property 'skipTests' set.

I am sure skipTests are set to false and if I remove the testng.xml, tests will be executed.

What I want to do is actually exclude some packages. But it seems to do this, I have to first give the name of the package like the following example:

<packages>
      <package name="com.example.functional.*">
            <exclude name="com.example.functional.services.courier"></exclude>
            <exclude name="com.example.functional.optimization"></exclude>
            <exclude name="com.example.functional.initialization"></exclude>
            <exclude name="com.example.functional.tasks"></exclude>
      </package>
    </packages>
Whatever I try :  .*, com.*,  com.example.*, the packages I want to exclude are excluded  but everything else is also skipped.  How can I specify the package to run with subpackages to exclude? Also, why is everything skipped with ".*"?

I am using testng 6.7 (I know fairly old) and surefire to run the tests.

Thanks
Betul


--
You received this message because you are subscribed to the Google Groups "testng-users" 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 https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: <package name=".*"> in testng.xml causes all tests to be skipped

⇜Krishnan Mahadevan⇝

Yes you are on a very very old version of TestNG.

 

As a first step can you please retry your scenario using the latest TestNG version (6.14.3 as of today) and post your results ?

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <[hidden email]> on behalf of Ganime Betül AKIN <[hidden email]>
Reply-To: <[hidden email]>
Date: Wednesday, August 8, 2018 at 11:50 PM
To: testng-users <[hidden email]>
Subject: [testng-users] <package name=".*"> in testng.xml causes all tests to be skipped

 

Hi All,

 

I am new to the group. I searched extensively and tried a number of things but could not solve my problem.

 

I would like to create a suite file to exclude some packages. I first tried including everything with ".*". 

 

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

<suite name="Suite" parallel="false" configfailurepolicy="continue">

  <test name="Test" preserve-order="false">

                <packages>

            <package name=".*">

            </package>

        </packages>

  </test>

</suite>

 

 

But this  causes tests to be skipped with the message: 

 

runTests:

Skipped because property 'skipTests' set.

 

I am sure skipTests are set to false and if I remove the testng.xml, tests will be executed.

 

What I want to do is actually exclude some packages. But it seems to do this, I have to first give the name of the package like the following example:

 

<packages>
      <package name="com.example.functional.*">
            <exclude name="com.example.functional.services.courier"></exclude>
            <exclude name="com.example.functional.optimization"></exclude>
            <exclude name="com.example.functional.initialization"></exclude>
            <exclude name="com.example.functional.tasks"></exclude>
      </package>
    </packages>

Whatever I try :  .*, com.*,  com.example.*, the packages I want to exclude are excluded  but everything else is also skipped.  How can I specify the package to run with subpackages to exclude? Also, why is everything skipped with ".*"?

 

I am using testng 6.7 (I know fairly old) and surefire to run the tests.

 

Thanks

Betul

 

 

--
You received this message because you are subscribed to the Google Groups "testng-users" 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 https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "testng-users" 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 https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.