-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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: Split huge monolith mock header to speed up test compilation #11649
Conversation
Signed-off-by: Muge Chen <mugechen@google.com>
Signed-off-by: Muge Chen <mugechen@google.com>
Signed-off-by: Muge Chen <mugechen@google.com>
@asraa FYI |
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.
Congrats on getting your first PR out for review!
Signed-off-by: Muge Chen <mugechen@google.com>
Signed-off-by: Muge Chen <mugechen@google.com>
Signed-off-by: Muge Chen <mugechen@google.com>
Signed-off-by: Muge Chen <mugechen@google.com>
The overall build time for cluster_manager_test has been further improved to 68.689s in my build cluster by removing superfluous includes in divided headers. |
test/mocks/server/admin.h
Outdated
|
||
#include "absl/strings/string_view.h" | ||
#include "config_tracker.h" | ||
#include "gmock/gmock.h" | ||
#include "spdlog/spdlog.h" | ||
|
||
using testing::NiceMock; |
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.
Using-declarations should only be used in .cc files. See https://google.github.io/styleguide/cppguide.html#Namespaces
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.
done
test/mocks/server/config_tracker.cc
Outdated
#include "gmock/gmock.h" | ||
#include "gtest/gtest.h" | ||
|
||
using testing::_; |
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.
These should be moved to inside the innermost namespace, and they should be fully-qualified. See https://abseil.io/tips/119
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.
fixed
Signed-off-by: Muge Chen <mugechen@google.com>
Signed-off-by: Muge Chen <mugechen@google.com>
Just a nit on the PR description, the comment |
@sunjayBhatia Thanks for your advice. Now the PR description has been adjusted to "Related Issues" |
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.
Thanks!
…nvoyproxy#11649) Commit Message: Split huge monolith mock header to speed up test compilation Additional Description: `cluster_manager_test` only used a simple mock class `MockAdmin` from `test/mocks/server/mocks.h`, which is a huge mock library. After splitting, the overall build time for `cluster_manager_test` reduced from 143.481s to 82.443s in my build cluster. Risk Level: low Testing: existing tests Docs Changes: N/A Release Notes: no Related Issues: envoyproxy#10917 Signed-off-by: Muge Chen <mugechen@google.com> Signed-off-by: chaoqinli <chaoqinli@google.com>
…nvoyproxy#11649) Commit Message: Split huge monolith mock header to speed up test compilation Additional Description: `cluster_manager_test` only used a simple mock class `MockAdmin` from `test/mocks/server/mocks.h`, which is a huge mock library. After splitting, the overall build time for `cluster_manager_test` reduced from 143.481s to 82.443s in my build cluster. Risk Level: low Testing: existing tests Docs Changes: N/A Release Notes: no Related Issues: envoyproxy#10917 Signed-off-by: Muge Chen <mugechen@google.com>
…nvoyproxy#11649) Commit Message: Split huge monolith mock header to speed up test compilation Additional Description: `cluster_manager_test` only used a simple mock class `MockAdmin` from `test/mocks/server/mocks.h`, which is a huge mock library. After splitting, the overall build time for `cluster_manager_test` reduced from 143.481s to 82.443s in my build cluster. Risk Level: low Testing: existing tests Docs Changes: N/A Release Notes: no Related Issues: envoyproxy#10917 Signed-off-by: Muge Chen <mugechen@google.com> Signed-off-by: yashwant121 <yadavyashwant36@gmail.com>
Commit Message: Split huge monolith mock header to speed up test compilation
Additional Description:
cluster_manager_test
only used a simple mock classMockAdmin
fromtest/mocks/server/mocks.h
, which is a huge mock library. After splitting, the overall build time forcluster_manager_test
reduced from 143.481s to 82.443s in my build cluster.Risk Level: low
Testing: existing tests
Docs Changes: N/A
Release Notes: no
Related Issues: #10917