# Trying to run tests from the test suite

**URL:** <https://discuss.elastic.co/t/trying-to-run-tests-from-the-test-suite/131579>\
**Category:** Elasticsearch\
**Created:** [May 12, 2018, 3:16pm UTC](https://discuss.elastic.co/t/trying-to-run-tests-from-the-test-suite/131579 "2018-05-12T15:16:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![matth](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@matth](https://discuss.elastic.co/u/matth)\
**Post date:** [May 12, 2018, 3:16pm UTC](https://discuss.elastic.co/t/trying-to-run-tests-from-the-test-suite/131579/1 "2018-05-12T15:16:05Z")

</div>

I'm just getting into the source code from elastic search. However, I can not seem to be able to run the test suite. This is one example of the command I ran. I tried some different classes or methods but all of them gave the same result.

```
./gradlew test "-Dtests.class=org.elasticsearch.index.query.MultiMatchQueryBuilderTests"

```

This is a typical result

```
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/4.7/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing

> Configure project :benchmarks
=======================================
Elasticsearch Build Hamster says Hello!
=======================================
  Gradle Version : 4.7
  OS Info : Windows 10 10.0 (amd64)
  JDK Version : Oracle Corporation 10.0.1 [Java HotSpot(TM) 64-Bit Server VM 10.0.1+10]
  JAVA_HOME : C:\Program Files\Java\jdk-10.0.1
  Random Testing Seed : CEC0F2CB90B7E210

> Configure project :modules:reindex
Disabling reindex-from-old tests because we can't get the pid file on windows

> Configure project :plugins:repository-hdfs
hdfsFixture unsupported, please set HADOOP_HOME and put HADOOP_HOME\bin in PATH

> Task :test:framework:test FAILED
   [junit4] <JUnit4> says ???! Master seed: D26631D85A81271E
==> Test Summary: 0 suites, 0 tests
   [junit4] Tests summary: 0 suites, 0 tests

FAILURE: Build failed with an exception.

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

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.7/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 25s

```

I'm probably missing something obvious, but I've been trying to get the project up and running for quite some time now.

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [May 12, 2018, 7:48pm UTC](https://discuss.elastic.co/t/trying-to-run-tests-from-the-test-suite/131579/2 "2018-05-12T19:48:43Z")

</div>

By running `test` from the root directory, you are telling gradle to run all test tasks, yet you want to run a single suite that is run in a single test task. You either need to cd into the subproject where the test exists, or use the explicit gradle task like `:server:test`.

---

<div class="post-metadata">

**Author:** ![matth](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@matth](https://discuss.elastic.co/u/matth)\
**Post date:** [May 12, 2018, 8:13pm UTC](https://discuss.elastic.co/t/trying-to-run-tests-from-the-test-suite/131579/3 "2018-05-12T20:13:02Z")

</div>

Thank you! Just as you explained

```
./gradlew :server:test "-Dtests.class=org.elasticsearch.index.query.MultiMatchQueryBuilderTests"

```

gave the expected output, as did

```
cd server
../gradlew test "-Dtests.class=org.elasticsearch.index.query.MultiMatchQueryBuilderTests"
```

---

<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:** [June 9, 2018, 8:13pm UTC](https://discuss.elastic.co/t/trying-to-run-tests-from-the-test-suite/131579/4 "2018-06-09T20:13:11Z")

</div>

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