Run the tests
Running the C++ tests
Run all tests
To run all the C++ tests you can use following command:
./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:
./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:
./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:
./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:
./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:
./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):
$ ls -1 java/yb-client/target/surefire-reports/
TEST-org.yb.client.TestYBClient.xml
org.yb.client.TestYBClient-output.txt
org.yb.client.TestYBClient.testAffinitizedLeaders.stderr.txt
org.yb.client.TestYBClient.testAffinitizedLeaders.stdout.txt
…
org.yb.client.TestYBClient.testWaitForLoadBalance.stderr.txt
org.yb.client.TestYBClient.testWaitForLoadBalance.stdout.txt
org.yb.client.TestYBClient.txt
NoteThe YB logs are contained in the output file now.