Elasticsearch single test error


hi there
I want to run a single test case so I read a document about testing
and I found this command.

gradle test -Dtests.class=org.elasticsearch.package.ClassName

I want to test this class NumberFieldMapperTests
so I executed command like this.

gradle test -Dtests.class=org.elasticsearch.index.mapper.NumberFieldMapperTests

But I met an error!
Here is an error message

* What went wrong:
Execution failed for task ':test:framework:test'.
> There were no executed tests: 0 suites, 0 tests

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':test:framework:test'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:98)

Caused by: : There were no executed tests: 0 suites, 0 tests
        at com.carrotsearch.ant.tasks.junit4.JUnit4.execute(JUnit4.java:1093)

please, help me

(Jason Tedor) #2

You have to run gradle :core:test -Dtests.class=org.elasticsearch.index.mapper.NumberField (note test -> :core:test); when you run the top-level test task it will run test for all sub-projects. Since there are no test classes that match org.elasticsearch.index.mapper.NumberFieldMapperTests and we fail tests if no tests are executed, this is why you see the failure that you se.


thanks your reply
i solved this problem!

(Jason Tedor) #4

You're welcome.

(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.