[ https://issues.apache.org/jira/browse/KAFKA-1885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
jaikiran pai updated KAFKA-1885: -------------------------------- Status: Patch Available (was: Open) > Allow test methods in "core" to be individually run from outside of the IDE > --------------------------------------------------------------------------- > > Key: KAFKA-1885 > URL: https://issues.apache.org/jira/browse/KAFKA-1885 > Project: Kafka > Issue Type: Improvement > Components: system tests > Reporter: jaikiran pai > Assignee: jaikiran pai > Attachments: KAFKA-1885.patch > > > Gradle in combination with Java plugin allows test "filtering" which lets > users run select test classes or even select test methods from the command > line. See "Test filtering" section here > http://www.gradle.org/docs/2.0/userguide/java_plugin.html#sec:java_test which > has examples of the commands. Currently we have this working in the "clients" > and I can run something like: > {code} > ./gradlew clients:test --tests > org.apache.kafka.clients.producer.MetadataTest.testMetadataUpdateWaitTime > {code} > and that command then only runs that specific test method > (testMetadataUpdateWaitTime) from the MetadataTest class. > {code} > To honour the JVM settings for this build a new JVM will be forked. Please > consider using the daemon: > http://gradle.org/docs/2.0/userguide/gradle_daemon.html. > Building project 'core' with Scala version 2.10.4 > :clients:compileJava UP-TO-DATE > :clients:processResources UP-TO-DATE > :clients:classes UP-TO-DATE > :clients:compileTestJava UP-TO-DATE > :clients:processTestResources UP-TO-DATE > :clients:testClasses UP-TO-DATE > :clients:test > org.apache.kafka.clients.producer.MetadataTest > testMetadataUpdateWaitTime > PASSED > BUILD SUCCESSFUL > Total time: 12.714 secs > {code} > I've found this useful when I need to do some quick tests and also reproduce > issues that aren't noticed sometimes if the whole test class is run. > This currently only works for the "clients" and not for "core" --because the > "core" doesn't have the Java plugin applied to it in the gradle build--. I've > a patch which does that (and one other related thing) which then allowed me > to run individual test methods even for the core tests. I will create a > review request for it. > Edit: I was wrong about the java plugin not being applied to "core". It is > indeed already applied but my attempt to get test methods running > individually for "core" were failing for a different reason related to JUnit > version dependency. I'll be addressing that in the patch and uploading for > review. -- This message was sent by Atlassian JIRA (v6.3.4#6332)