Running TestNG suite from Gradle using preserve-order='true' or group-by-instances='true'

420 views
Skip to first unread message

Tobias Riemenschneider

unread,
Apr 1, 2015, 12:50:55 PM4/1/15
to gradl...@googlegroups.com

Hi,

is there any way to run a TestNG suite from Gradle using preserve-order='true' or group-by-instances='true' without using suiteXmlFiles or suiteXmlBuilder?

I want to use the test source set for configuring the contents of the TestNG suite, i.e., I do not want to explicitly enumerate all test classes in an XML file or for suiteXmlBuilder. Unfortunately I have to set preserve-order='true' or group-by-instances='true' in order to enforce that tests are run completely before the next test is processed. (Otherwise you might end up with 'execution plans' like (Test1.@BeforeClass, Test2.@BeforeClass, Test1.@Test, Test2.@Test) which causes problems if both @BeforeClass methods try to allocate the same unique resource.)

Any help would b greatly appreciated.

Regards, Toby

Tobias Riemenschneider

unread,
Apr 1, 2015, 12:56:25 PM4/1/15
to gradl...@googlegroups.com
I already had a look at the source code and found no workaround.

From my point of view it should be no big deal to add preserveOrder and groupByInstances fields to TestNGOptions and TestNGSpec and handle them in TestNGTestClassProcessor by forwarding them to the TestNG object.

What do you think about supporting these options from Gradle? (I could prepare an according pull request.)

Regards, Toby


Maksym Stavytskyi

unread,
Apr 1, 2015, 4:52:17 PM4/1/15
to gradl...@googlegroups.com
I think it is good idea and opportunity.

1 апр. 2015, в 19:56, Tobias Riemenschneider <tobias.riem...@softwareag.com> написал(а):

--
You received this message because you are subscribed to the Google Groups "gradle-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gradle-dev+...@googlegroups.com.
To post to this group, send email to gradl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gradle-dev/1fb1ac37-db08-48ff-b2ba-3c0b356ae5b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tobias Riemenschneider

unread,
Apr 22, 2015, 8:34:40 AM4/22/15
to gradl...@googlegroups.com
Since I heared no arguments against supporting these options I have created the pull request https://github.com/gradle/gradle/pull/439.

Tobias Riemenschneider

unread,
Aug 4, 2015, 4:27:42 AM8/4/15
to gradle-dev
Since the pull request https://github.com/gradle/gradle/pull/439 (including integration tests) is available for quite a while and nothing happened until now, I want to use also this channel for asking if there is something missing for a merge.

Daz DeBoer

unread,
Aug 5, 2015, 12:39:23 PM8/5/15
to gradle-dev
Hi Tobias
Currently we are pretty swamped with stuff to work on, and we are constantly having to ignore/defer work that doesn't reach the top of the priority list. Our main focus in the new software and configuration model, which will provide revolutionary changes to performance and usability in Gradle.

We're actively hiring developers to try to overcome this constraint, but it's likely to be the reality for a while.
Daz


On Tue, Aug 4, 2015 at 2:27 AM Tobias Riemenschneider <tobias.riem...@softwareag.com> wrote:
Since the pull request https://github.com/gradle/gradle/pull/439 (including integration tests) is available for quite a while and nothing happened until now, I want to use also this channel for asking if there is something missing for a merge.

--
You received this message because you are subscribed to the Google Groups "gradle-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gradle-dev+...@googlegroups.com.
To post to this group, send email to gradl...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages