is there an easy way to specify the execution order of child elements of
an XML <suite> element?
There is a "preserve-order" attribute for the <test> tag, can I have a
similar feature for <suite> child elements?
Our use case is as follows: we would like to run all our fast unit tests
at the beginning of the overall test suite in parallel. Then, before
continuing with the more integrational tests, we want to run one
specific single test class, and after that, all our integration tests
(in parallel, again).
Does TestNG already support this use case in tandem with the maven
surefire plugin?
Thanks in advance + best regards
Ansgar
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
<suite suite-preserve-order="true">means that the <test> tags will be run in the order they are found in your testng.xml file
Would this solve your problem?
Hi Cédric,
yes, does make sense. We don't really need the sub-suites.
We could probably even do without the possibility to order <test>s in
the <suite>, but then need a possibility to define dependencies between
test groups in the <suite> xml.
With group dependencies, our approach could look as follows:
- put all tests into their respective groups
- reserve an extra group for the spring beans instantiation test
- specify group dependencies (run this group after groups x, y, z have
completed) in the <suite>
Is it possible to specify group dependencies in the testng.xml? I'm only
aware of the @Test(dependsOnGroups) annotation-style dependency
specification. Searching the testng DTD, i did not find any attribute
named like .*depend.* -- and we certainly don't want to add
dependsOnGroups attributes to each new test method, but define this
dependency in one place (DRY).
Best regards
Ansgar
Hi Cédric,
yes, does make sense. We don't really need the sub-suites.
We could probably even do without the possibility to order <test>s in the <suite>, but then need a possibility to define dependencies between test groups in the <suite> xml.
With group dependencies, our approach could look as follows:
- put all tests into their respective groups
- reserve an extra group for the spring beans instantiation test
- specify group dependencies (run this group after groups x, y, z have completed) in the <suite>
Is it possible to specify group dependencies in the testng.xml? I'm only aware of the @Test(dependsOnGroups) annotation-style dependency specification. Searching the testng DTD, i did not find any attribute named like .*depend.* -- and we certainly don't want to add dependsOnGroups attributes to each new test method, but define this dependency in one place (DRY).
Hi Cedric,
thinking about your comment one more time, I don't quite see where the
*total* ordering is imposed.
So I took my favourite low-tech tools and drew a little sketch to
illustrate what we would like to order, and which parts should still be
subject to TestNGs "unspecified execution order":
http://passion.forco.de/content/ordering-sub-elements-testng-suite
The "sub-suites" are relatively thin, all they contain is a single
<test> element which collects all tests having a certain group from all
java packages beneath a certain root package. Each of these could easily
be inlined into one <test> tag inside the top-level suite.
I just want to make sure we're talking about the same things; besides
that, the solution we already discussed last friday (using testng
groups) would suffice for our use case.
Best regards and thanks in advance.
Ansgar