-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Break down huge monolith mock header to improve test compilatio…
…n performance (#11797) Commit Message: breakdown `test/mocks/server/mocks.h` into different mock classes Additional Description: `test/mocks/server/mocks.h` is a wide-used mock header included by various test files. However it's very huge and most test files only used a small portion of it. Splitting it up into different mock classes will be helpful to reduce compilation time. Risk Level: low Testing: existing tests Docs Changes: N/A Release Notes: no Related Issues: #10917 Signed-off-by: Muge Chen <mugechen@google.com>
- Loading branch information
1 parent
12c8c79
commit 7d5e12c
Showing
50 changed files
with
1,763 additions
and
975 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "admin_stream.h" | ||
|
||
#include <string> | ||
|
||
#include "gmock/gmock.h" | ||
#include "gtest/gtest.h" | ||
|
||
namespace Envoy { | ||
namespace Server { | ||
MockAdminStream::MockAdminStream() = default; | ||
|
||
MockAdminStream::~MockAdminStream() = default; | ||
|
||
} // namespace Server | ||
} // namespace Envoy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
|
||
#include "envoy/server/admin.h" | ||
|
||
#include "test/mocks/http/mocks.h" | ||
|
||
#include "gmock/gmock.h" | ||
|
||
namespace Envoy { | ||
namespace Server { | ||
class MockAdminStream : public AdminStream { | ||
public: | ||
MockAdminStream(); | ||
~MockAdminStream() override; | ||
|
||
MOCK_METHOD(void, setEndStreamOnComplete, (bool)); | ||
MOCK_METHOD(void, addOnDestroyCallback, (std::function<void()>)); | ||
MOCK_METHOD(const Buffer::Instance*, getRequestBody, (), (const)); | ||
MOCK_METHOD(Http::RequestHeaderMap&, getRequestHeaders, (), (const)); | ||
MOCK_METHOD(NiceMock<Http::MockStreamDecoderFilterCallbacks>&, getDecoderFilterCallbacks, (), | ||
(const)); | ||
MOCK_METHOD(Http::Http1StreamEncoderOptionsOptRef, http1StreamEncoderOptions, ()); | ||
}; | ||
} // namespace Server | ||
} // namespace Envoy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "bootstrap_extension_factory.h" | ||
|
||
namespace Envoy { | ||
namespace Server { | ||
namespace Configuration { | ||
MockBootstrapExtensionFactory::MockBootstrapExtensionFactory() = default; | ||
|
||
MockBootstrapExtensionFactory::~MockBootstrapExtensionFactory() = default; | ||
|
||
} // namespace Configuration | ||
} // namespace Server | ||
} // namespace Envoy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#include "envoy/server/bootstrap_extension_config.h" | ||
|
||
#include "gmock/gmock.h" | ||
|
||
namespace Envoy { | ||
namespace Server { | ||
namespace Configuration { | ||
class MockBootstrapExtensionFactory : public BootstrapExtensionFactory { | ||
public: | ||
MockBootstrapExtensionFactory(); | ||
~MockBootstrapExtensionFactory() override; | ||
|
||
MOCK_METHOD(BootstrapExtensionPtr, createBootstrapExtension, | ||
(const Protobuf::Message&, Configuration::ServerFactoryContext&), (override)); | ||
MOCK_METHOD(ProtobufTypes::MessagePtr, createEmptyConfigProto, (), (override)); | ||
MOCK_METHOD(std::string, name, (), (const, override)); | ||
}; | ||
} // namespace Configuration | ||
} // namespace Server | ||
} // namespace Envoy |
Oops, something went wrong.