Run the tests

Running the C++ tests

Run all tests

To run all the C++ tests you can use following command:

  1. ./yb_build.sh release --ctest

If you omit release argument, it will run java tests against debug YugabyteDB build.

Run specific tests

To run a specific test, for example the util_monotime-test test, you can run the following command:

  1. ./yb_build.sh release --cxx-test util_monotime-test

To run a specific sub-test, for example the TestMonoTime.TestCondition sub-test in util_monotime-test, you can run the following command:

  1. ./yb_build.sh release --cxx-test util_monotime-test --gtest_filter TestMonoTime.TestCondition

Running the Java tests

Run all tests

Given that you’ve already built C++ and Java code you can run Java tests using following command:

  1. ./yb_build.sh release --scb --sj --java-tests

If you omit release argument, it will run java tests against debug YugabyteDB build, so you should then either build debug binaries with ./yb_build.sh or omit —scb and then it will build debug binaries automatically.

Run specific tests

To run specific test:

  1. ./yb_build.sh release --scb --sj --java-test org.yb.client.TestYBClient

To run a specific Java sub-test within a test file use the # syntax, for example:

  1. ./yb_build.sh release --scb --sj --java-test org.yb.client.TestYBClient#testClientCreateDestroy

Viewing log outputs

You can find Java tests output in corresponding directory (you might need to change yb-client to respective Java tests module):

  1. $ ls -1 java/yb-client/target/surefire-reports/
  2. TEST-org.yb.client.TestYBClient.xml
  3. org.yb.client.TestYBClient-output.txt
  4. org.yb.client.TestYBClient.testAffinitizedLeaders.stderr.txt
  5. org.yb.client.TestYBClient.testAffinitizedLeaders.stdout.txt
  6. org.yb.client.TestYBClient.testWaitForLoadBalance.stderr.txt
  7. org.yb.client.TestYBClient.testWaitForLoadBalance.stdout.txt
  8. org.yb.client.TestYBClient.txt

NoteThe YB logs are contained in the output file now.