Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: turn on sanitizers #607

Merged
merged 5 commits into from
Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,35 @@ jobs:
run: ./ci/mac_ci_setup.sh
- name: 'Run tests'
run: bazel test //test/common/...
tsan:
name: tsan
runs-on: ubuntu-18.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: 'Install dependencies'
run: ./ci/linux_ci_setup.sh
- name: 'Run tests'
run: |
export PATH=/usr/lib/llvm-8/bin:$PATH
export CC=clang
export CXX=clang++
bazel test --config=clang-tsan //test/common/...
asan:
name: asan
runs-on: ubuntu-18.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: 'Install dependencies'
run: ./ci/linux_ci_setup.sh
- name: 'Run tests'
run: |
export PATH=/usr/lib/llvm-8/bin:$PATH
export CC=clang
export CXX=clang++
bazel test --config=clang-asan //test/common/...
2 changes: 1 addition & 1 deletion envoy
Submodule envoy updated 369 files
1 change: 1 addition & 0 deletions test/common/buffer/bridge_fragment_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ TEST(BridgeFragmentTest, Basic) {
ASSERT_EQ(*sentinel, 0);
buffer_wrapper.drain(buffer_wrapper.length());
ASSERT_EQ(*sentinel, 1);
delete sentinel;
}

} // namespace Buffer
Expand Down
2 changes: 2 additions & 0 deletions test/common/buffer/utility_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ TEST(DataConstructorTest, FromCppToCEmpty) {
envoy_data c_data = Utility::toBridgeData(empty_data);

ASSERT_EQ(c_data.length, 0);
c_data.release(c_data.context);
}

TEST(DataConstructorTest, FromCppToC) {
Expand All @@ -43,6 +44,7 @@ TEST(DataConstructorTest, FromCppToC) {

ASSERT_EQ(c_data.length, s.size());
ASSERT_EQ(Http::Utility::convertToString(c_data), s);
c_data.release(c_data.context);
}

} // namespace Buffer
Expand Down
4 changes: 3 additions & 1 deletion test/common/http/dispatcher_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ TEST_F(DispatcherTest, BasicStream) {
ASSERT_EQ(Http::Utility::convertToString(c_data), "response body");
callbacks_called* cc = static_cast<callbacks_called*>(context);
cc->on_data_calls++;
c_data.release(c_data.context);
};
bridge_callbacks.on_complete = [](void* context) -> void {
callbacks_called* cc = static_cast<callbacks_called*>(context);
Expand Down Expand Up @@ -752,10 +753,11 @@ TEST_F(DispatcherTest, MultipleDataStream) {
callbacks_called* cc = static_cast<callbacks_called*>(context);
cc->on_headers_calls++;
};
bridge_callbacks.on_data = [](envoy_data, bool, void* context) -> void {
bridge_callbacks.on_data = [](envoy_data data, bool, void* context) -> void {
// TODO: assert end_stream and contents of c_data for multiple calls of on_data.
callbacks_called* cc = static_cast<callbacks_called*>(context);
cc->on_data_calls++;
data.release(data.context);
};
bridge_callbacks.on_complete = [](void* context) -> void {
callbacks_called* cc = static_cast<callbacks_called*>(context);
Expand Down
6 changes: 4 additions & 2 deletions test/common/http/header_utility_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ TEST(HeaderDataConstructorTest, FromCToCpp) {
// Value for the key is the same.
EXPECT_EQ(cpp_headers->get(expected_key)->value().getStringView(), expected_value);
}
release_envoy_headers(c_headers_copy);
delete sentinel;
}

TEST(HeaderDataConstructorTest, FromCppToCEmpty) {
HeaderMapImpl empty_headers;
envoy_headers c_headers = Utility::toBridgeHeaders(std::move(empty_headers));
ASSERT_EQ(0, c_headers.length);
delete[] c_headers.headers;
release_envoy_headers(c_headers);
}

TEST(HeaderDataConstructorTest, FromCppToC) {
Expand All @@ -92,7 +94,7 @@ TEST(HeaderDataConstructorTest, FromCppToC) {
EXPECT_EQ(actual_value, cpp_headers.get(actual_key)->value().getStringView());
}

delete c_headers.headers;
release_envoy_headers(c_headers);
}

} // namespace Http
Expand Down