-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
test: Break down huge monolith mock header to improve test compilation performance #11797
Merged
Merged
Changes from 7 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2989186
added splitted up mock headers
foreseeable e3c12fa
fix dependency issues
foreseeable ba1be16
fix duplicate symbol error
foreseeable e022b74
fix format
foreseeable f2825fb
move the using into inner namespace and make them fully qualified
foreseeable 38c5e14
remove blank lines between closing namespace brackets
foreseeable af2db9d
remove blank lines between closing namespace bracets
foreseeable f98507e
remove unused std libs
foreseeable 93dadb5
run the formatter and add no lint to mocks.h
foreseeable a7cea47
merge upstream test file to pass ci
foreseeable a1668a3
merge upstream changes to pass ci
foreseeable 3807f54
remove unused using statement
foreseeable 517ab02
resolve conflicts
foreseeable 13084f4
resolve changes
foreseeable f07736f
resolve conflicts
foreseeable e1e8aca
remove unused using statements
foreseeable df9a803
Kick CI
foreseeable File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,4 @@ MockAdmin::MockAdmin() { | |
MockAdmin::~MockAdmin() = 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
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,32 @@ | ||
#pragma once | ||
|
||
#include <chrono> | ||
#include <cstdint> | ||
#include <list> | ||
#include <string> | ||
|
||
#include "envoy/server/admin.h" | ||
|
||
#include "test/mocks/http/mocks.h" | ||
|
||
#include "absl/strings/string_view.h" | ||
#include "gmock/gmock.h" | ||
#include "spdlog/spdlog.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,27 @@ | ||
#pragma once | ||
|
||
#include <chrono> | ||
#include <cstdint> | ||
#include <list> | ||
#include <string> | ||
|
||
#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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we scripting the removal of extra #includes or doing it manually? We don't need most of these system headers in the new headers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remove them manually, just forget to remove them. Thanks for pointing out