Heron uses Bazel for building and running unit tests. Before running tests, first set up your build environment as described in Compiling Heron.
Running Unit Tests
The following command will run all tests:
$ bazel test --config=darwin heron/...
To run a specific test target, pass the test target name.
$ bazel test --config=darwin heron/statemgrs/tests/java:localfs-statemgr_unittest
Discovering Unit Test Targets
To see a full listing of all Bazel test targets:
$ bazel query 'kind(".*_test rule", ...)'
For Java targets only:
$ bazel query 'kind("java_test rule", ...)'
For C++ targets:
$ bazel query 'kind("cc_test rule", ...)'
For Python targets:
$ bazel query 'kind("pex_test rule", ...)'
Running Integration Tests
Integration tests are divided into two categories
- Functional integration tests
- Failure integration tests
To run the failure integration tests on your Mac OS X, do the following:
bazel run --config=darwin -- scripts/packages:heron-client-install.sh --user
bazel build --config=dawrin integration-test/src/...
python integration-test/src/python/local_test_runner/main.py