I'm invoking TestNG from the command-line like this:
java org.testng.TestNG -groups "foo" testng.xml
...with the intention of only running tests annotated with:
@Test(groups = { "foo" })
...but it's running all my tests. Do I need to change my testng.xml file?
<suite name="BarSuite" verbose="1">
<test name="AllInPackage">
<packages>
<package name="com.example.bar"/>
</packages>
</test>
</suite>
Is TestNG ignoring the -groups command-line argument because testng.xml says to run all the tests in the package? If so, how should I change my testng.xml file?