Skip to content

test: refactor header inclusion to speed up building (for test/integration/...)#12053

Merged
lizan merged 3 commits intoenvoyproxy:masterfrom
foreseeable:re_test/integration
Jul 14, 2020
Merged

test: refactor header inclusion to speed up building (for test/integration/...)#12053
lizan merged 3 commits intoenvoyproxy:masterfrom
foreseeable:re_test/integration

Conversation

@foreseeable
Copy link
Copy Markdown
Contributor

Signed-off-by: Muge Chen mugechen@google.com

Refactor mock class include directive after dividing test/server/mocks.h (#11649)

Since the refactoring affects ~100 files so I split it up to several pull requests (previous one #11952)

Building time comparison for affected tests: see spreadsheet at #10917 comment

Commit Message: refactor header inclusion to speed up building
Additional Description:
Risk Level: low
Testing: exsiting tests
Docs Changes: N/A
Release Notes: no
Related Issues: #10917

\cc @ahedberg @bbarenblat

Signed-off-by: Muge Chen <mugechen@google.com>
@junr03
Copy link
Copy Markdown
Member

junr03 commented Jul 13, 2020

hi @foreseeable do you mind updating your PR titles to reflect the content more specifically. It is hard to track all of them if they have the same title.

Copy link
Copy Markdown
Contributor

@ahedberg ahedberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@foreseeable foreseeable changed the title test: refactor header inclusion to speed up building test: refactor header inclusion to speed up building (for test/integration/...) Jul 14, 2020
Signed-off-by: Muge Chen <mugechen@google.com>
@foreseeable foreseeable requested a review from htuch as a code owner July 14, 2020 02:09
Signed-off-by: Muge Chen <mugechen@google.com>
@foreseeable
Copy link
Copy Markdown
Contributor Author

hi @foreseeable do you mind updating your PR titles to reflect the content more specifically. It is hard to track all of them if they have the same title.

Now the titles has been updated, thank you for your advice!

@foreseeable
Copy link
Copy Markdown
Contributor Author

Looks like alts_integration_test might still be using the monolithic header? https://dev.azure.com/cncf/envoy/_build/results?buildId=44763&view=logs&j=8d802004-fbbb-5f17-b73e-f23de0c1dec8&t=86512d3a-caa5-5e3f-9bce-4070faa3b830&l=6683

alts_integration_test is updated in another pull request. The build fails because originally integration.h includes test/server/mocks.h and alts_integration_test depends on integration.h, so it can include the header test/server/mocks.h without specific bazel deps rule. After refactoring the later one can not compile because integration.h don't depend on server/mocks.h anymore. It's just yet another include-what-you-use violations in envoy.

I fixed the BUILD file, now it should work.

@junr03 junr03 self-assigned this Jul 14, 2020
@lizan lizan merged commit 964da24 into envoyproxy:master Jul 14, 2020
scheler pushed a commit to scheler/envoy that referenced this pull request Aug 4, 2020
…ation/...) (envoyproxy#12053)

Commit Message: refactor header inclusion to speed up building
Additional Description:
Risk Level: low
Testing: exsiting tests
Docs Changes: N/A
Release Notes: no
Related Issues: envoyproxy#10917

Signed-off-by: Muge Chen <mugechen@google.com>
Signed-off-by: scheler <santosh.cheler@appdynamics.com>
htuch pushed a commit that referenced this pull request Aug 28, 2020
We need to reduce resource consumption of test compilation by simplifying mock library inclusions. #10917
One way to do that is to break the monolithic mock headers into different mock classes and then refactor the code base (like #12053 #12051 #11797)
It's hard to refactor them manually. So I wrote headersplit, a tool based on libclang and python to help me divide the monolithic mock header and replace includes after dividing automatically. This tool can also generate building time comparison between before/after refactoring.

Risk level: low
Testing: Build succeeds.

Signed-off-by: Muge Chen <mugechen@google.com>
clarakosi pushed a commit to clarakosi/envoy that referenced this pull request Sep 3, 2020
)

We need to reduce resource consumption of test compilation by simplifying mock library inclusions. envoyproxy#10917
One way to do that is to break the monolithic mock headers into different mock classes and then refactor the code base (like envoyproxy#12053 envoyproxy#12051 envoyproxy#11797)
It's hard to refactor them manually. So I wrote headersplit, a tool based on libclang and python to help me divide the monolithic mock header and replace includes after dividing automatically. This tool can also generate building time comparison between before/after refactoring.

Risk level: low
Testing: Build succeeds.

Signed-off-by: Muge Chen <mugechen@google.com>
Signed-off-by: Clara Andrew-Wani <candrewwani@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants