Skip to content

Commit

Permalink
Enable asan tests for non t unit-tests (#597)
Browse files Browse the repository at this point in the history
* fix asan test to only run non-t tests

* revert nginx.bzl changes

* test t tests

* echo gcc version

* disable jwt_validator_test

* remove t tests
  • Loading branch information
qiwzhang authored May 3, 2019
1 parent 8172d4b commit a658139
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 61 deletions.
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ build:asan --copt -O1
build:asan --copt -fno-omit-frame-pointer
build:asan --copt -Wno-error=maybe-uninitialized
build:asan --linkopt -fsanitize=address
build:asan --test_tag_filters=-no_asan

# Thread sanitizer
build:tsan --strip=never
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ SUPPORTED_STAGES = [
]

// Supported VM Images
SLAVE_IMAGE = 'gcr.io/endpoints-jenkins/debian-9:0.6'
SLAVE_IMAGE = 'gcr.io/endpoints-jenkins/debian-9:0.8'

// Release Qualification end to end tests.
// If RAPTURE_REPO build parameter is set only those test will run.
Expand Down
2 changes: 1 addition & 1 deletion jenkins/slaves/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PROJECT = endpoints-jenkins
VERSION = 0.6
VERSION = 0.8
TOOLS_BUCKET = endpoints-tools

# Note: The build directory is the root of the istio/test-infra repository, not ./
Expand Down
2 changes: 0 additions & 2 deletions script/linux-install-software
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. ${DIR}/tools/linux-install-bazel || error_exit "Cannot load Bazel install script"
. ${DIR}/tools/linux-install-docker || error_exit "Cannot load Docker install script"
. ${DIR}/tools/linux-install-clang || error_exit "Cannot load Clang install script"
. ${DIR}/tools/linux-install-gcc || error_exit "Cannot load gcc install script"
. ${DIR}/tools/linux-install-gcloud || error_exit "Cannot load gcloud install script"
. ${DIR}/tools/linux-install-wrk || error_exit "Cannot load wrk install script"
. ${DIR}/tools/linux-install-nodejs || error_exit "Cannot load nodejs install script"
Expand Down Expand Up @@ -114,7 +113,6 @@ else
mkdir -p "${TOOLS_DIR}" -m 0777
fi
update_clang
install_gcc
update_gcloud
update_bazel
install_docker_for_debian9
Expand Down
13 changes: 12 additions & 1 deletion script/presubmits
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,19 @@ function build_and_test() {
|| { echo "${error}..."; return 1; }
}

# For now, asan doesn't work for "t" tests Nginx has some global memory not freed,
# TODO: find a way to supress these memory leaks from Nginx.
function test_asan() {
local message='Running asan unit-tests, integration tests & NGINX tests'
local error='Asan Unit, Integration, NGINX, start_esp tests failed'
echo "${message}..."
${BAZEL} ${BAZEL_ARGS} test --test_output=errors --config=asan \
//src/api_manager/... //src/grpc/... \
|| { echo "${error}..."; return 1; }
}

function asan() {
build_and_test 'asan' || return 1
test_asan || return 1
}

function tsan() {
Expand Down
3 changes: 3 additions & 0 deletions script/run-presubmit
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ done
LOG_FILE="${LOG_DIR}/${SCENARIO}.log"
JSON_FILE="${LOG_DIR}/${SCENARIO}.json"

echo "gcc version:"
gcc --version

case $SCENARIO in
asan) log_output asan;;
build-and-test) log_output build_and_test;;
Expand Down
56 changes: 0 additions & 56 deletions script/tools/linux-install-gcc

This file was deleted.

3 changes: 3 additions & 0 deletions src/api_manager/auth/lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ cc_test(
"auth_jwt_validator_test.cc",
],
linkstatic = 1,
# With gcc-6.3.0 from debian9, asan test has false alarm
# inside openSSL code.
tags = ["no_asan"],
deps = [
":lib",
"//external:googletest_main",
Expand Down

0 comments on commit a658139

Please sign in to comment.