New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for single test method execution (GRADLE-2865) #193
Conversation
Add support to specify list of test method names using `test.single` property, with the (optional) format: `-Dtest.single=TestClassName#method1,method2`.
Haven't seen any responses yet... Is this a suitable implementation? |
Started to look at this a week or two ago. I actually didn't find much guidance in that doc at all in terms of how these options would be passed via command line. If the internal implementation is agreeable, then I would request the change be merged as is since it provides the functionality that is missing now without adding any new -D style options, but simply adds on the use of a current existing option. It seems that this does not make the issue any worse than it is today. Also, I would say that the way the settings get propagated internally is not the most important part of this feature, and it would be good to have the basic capability merged now, and deal later with the interface change of how to configure it when that change actually begins to take place. |
Thanks for feedback. There's a value in pushing back on improving features that are based on legacy APIs. This is our way to force ourselves and the community to keep on improving the quality. Even if it means longer wait times for improvements, in the long term it pays off. Nevertheless, I'm really tempted to get some traction on this feature. I also completely respect your opinion that you'd rather have the feature in place and the API sorted out later. I should have some time this week to get started on this. Not sure what comes out it, at least we should get the spec detailed properly. I ask you for a little bit of more patience. I'll be back :) |
Hey Matt, I've started working on this. Take a look at the spec: https://github.com/gradle/gradle/blob/master/design-docs/test-selection.md#single-test-method-execution I will definitely inspire on your implementation |
Glad to hear this got into 1.10! Hope my initial work on it was somewhat helpful. I'm trying this on 1.10 and running into a bit of an issue. It's including more test classes than I want it to. If I do Also, this pull request and issue gradle-2865 should probably be closed, no? |
Other people have reported similar issues. Looks like it isn't working as it should. |
Thanks again for the pull request. |
doh. looks like it doesn't work on 1.11 either. any chance to see this fixed soon? |
@matthauck can you please raise this problem on the forum with details. It could get lost here. |
@matthauck we don't really know about a problem with test filtering. It works for our codebase and for our integration tests. If you provide enough details we will be able to reproduce and fix the problem. Does the BetterFileUtilsTests test is peculiar in any way? Does it use a custom runner? It would be ideal if you posted the details of the problem to the forums. |
ok. posted. http://forums.gradle.org/gradle/topics/test_selection_with_tests_argument_does_not_appear_to_work Matt Hauck On Wednesday, February 19, 2014 at 11:50 PM, Szczepan Faber wrote:
|
Seems like ability to run a single test method is still relevant today. Any progress on this issue? |
I am trying to run a single test method with *gradlew test --tests TestName.testMethod, but I have this error:
Can someone tell me what am I doing wrong? |
Please post this kind of questions in the Gradle discussion forum: Anyhow, the test section you described above should work with the current Gradle release (3.1). |
Add support to specify list of test method names using
test.single
property, with the (optional) format:-Dtest.single=TestClassName#method1,method2
.I show all tests passing on
subprojects/plugins
. Played around with some real testng and junit test code and was able to successfully run only the method(s) specified. Also tested to make sure not specifying any test method names still does indeed run all test methods in the class.