Trying to run tests from the test suite

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.

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.

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"

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