# Elasticsearch single test error

**URL:** <https://discuss.elastic.co/t/elasticsearch-single-test-error/103233>\
**Category:** Elasticsearch\
**Created:** [October 9, 2017, 1:18pm UTC](https://discuss.elastic.co/t/elasticsearch-single-test-error/103233 "2017-10-09T13:18:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![8a98bb2968a03fe24acf](https://avatars.discourse-cdn.com/v4/letter/8/e8c25b/32.png) [@8a98bb2968a03fe24acf](https://discuss.elastic.co/u/8a98bb2968a03fe24acf)\
**Post date:** [October 9, 2017, 1:18pm UTC](https://discuss.elastic.co/t/elasticsearch-single-test-error/103233/1 "2017-10-09T13:18:51Z")

</div>

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

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

```

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

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

```

But I met an error!  
Here is an error message

```auto
* 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

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [October 9, 2017, 9:09pm UTC](https://discuss.elastic.co/t/elasticsearch-single-test-error/103233/2 "2017-10-09T21:09:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![8a98bb2968a03fe24acf](https://avatars.discourse-cdn.com/v4/letter/8/e8c25b/32.png) [@8a98bb2968a03fe24acf](https://discuss.elastic.co/u/8a98bb2968a03fe24acf)\
**Post date:** [October 10, 2017, 8:39am UTC](https://discuss.elastic.co/t/elasticsearch-single-test-error/103233/3 "2017-10-10T08:39:28Z")

</div>

thanks your reply  
i solved this problem!

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [October 10, 2017, 9:39am UTC](https://discuss.elastic.co/t/elasticsearch-single-test-error/103233/4 "2017-10-10T09:39:44Z")

</div>

You're welcome.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 7, 2017, 9:40am UTC](https://discuss.elastic.co/t/elasticsearch-single-test-error/103233/5 "2017-11-07T09:40:11Z")

</div>

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