Skip to content

Latest commit

 

History

History
62 lines (39 loc) · 1.85 KB

testing.md

File metadata and controls

62 lines (39 loc) · 1.85 KB

Testing ESP with Bazel

ESP is built using Bazel build tool. Install Bazel version 0.21.0, following the Bazel documentation.

Building ESP

Clone the ESP GitHub repository, initialize Git submodules, and build ESP using Bazel:

# Clone the ESP repository
git clone https://github.com/cloudendpoints/esp

cd esp

# Initialize Git submodules
git submodule update --init --recursive

# Build ESP binary
bazel build //src/nginx/main:nginx-esp

Note: If bazel build ... fails due to an expected identifier related to DEBUG, you may need to use bazel build -c opt ... as explained here.

The ESP binary location is:

./bazel-bin/src/nginx/main/nginx-esp

Running unit and integration tests

libio-socket-ssl-perl is needed to run ESP tests:

sudo apt-get install libio-socket-ssl-perl

Run ESP unit and integration tests:

bazel test //src/... //third_party:all

Running tests to check that the ESP configuration files are as expected

Before starting ESP, start_esp executable generates the ESP configuration files based on its input arguments. To test that the generated ESP configuration files are as expected:

bazel test //start_esp/test:start_esp_test

Running ASAN and TSAN tests

ASAN works on both Linux and Mac, but TSAN only works on Linux.

# Run ASAN
bazel test --config=asan --test_tag_filters=-no_asan \
  //src/... //third_party:all

# Run TSAN
bazel test --config=tsan --test_tag_filters=-no_tsan \
  //src/... //third_party:all

If you know a test is not going to work under TSAN or ASAN, please add the no_tsan or no_asan flags to your test targets as well as a reference to the existing bug.