-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace bincover with built-in Go coverage profiling tool (#6090)
We replace the deprecated bincover package with the built-in Golang coverage profiling tool. Some notable changes: * we introduce the run_cov_binary.sh script to serve as the entrypoint for the coverage-enabled Docker images. The script wraps the Antrea processes such as antrea-agent. * we are skipping e2e test `TestConnectivity/testOVSRestartSameNode` for now. It started failing in CI after this change but it doesn't seem like this change is directly responsible for this failure, as we can reproduce it locally with ToT Antrea when disabling coverage support. This needs to be investigated separately. Fixes #4962 Signed-off-by: Shikhar Soni <[email protected]>
- Loading branch information
1 parent
9d7f086
commit 8d9c455
Showing
31 changed files
with
252 additions
and
282 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
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,52 @@ | ||
# Copyright 2022 Antrea Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
ARG GO_VERSION | ||
ARG BUILD_TAG | ||
FROM golang:${GO_VERSION} as antrea-build | ||
|
||
WORKDIR /antrea | ||
|
||
COPY go.mod /antrea/go.mod | ||
|
||
RUN go mod download | ||
|
||
COPY . /antrea | ||
|
||
# Build antctl first in order to share an extra layer with | ||
# build/images/Dockerfile.build.agent.coverage and build/images/Dockerfile.build.controller.coverage. | ||
RUN make antctl-linux antctl-instr-binary && mv bin/antctl-linux bin/antctl | ||
|
||
# Then build antrea-agent and antrea-cni, in order to share an extra layer with | ||
# build/images/Dockerfile.build.agent.coverage. | ||
RUN make antrea-agent antrea-cni antrea-agent-instr-binary | ||
|
||
RUN make antrea-controller antrea-controller-instr-binary | ||
|
||
FROM antrea/base-ubuntu:${BUILD_TAG} | ||
|
||
LABEL maintainer="Antrea <[email protected]>" | ||
LABEL description="The Docker image to deploy the Antrea CNI with code coverage measurement enabled (used for testing)." | ||
|
||
USER root | ||
|
||
COPY build/images/scripts/* /usr/local/bin/ | ||
COPY --from=antrea-build /antrea/bin/* /usr/local/bin/ | ||
COPY --from=antrea-build /antrea/test/e2e/utils/run_cov_binary.sh / | ||
|
||
# This environment variable will persist when running the container, but can also be overwritten if needed | ||
ENV GOCOVERDIR=/tmp/coverage | ||
RUN mkdir -p $GOCOVERDIR | ||
|
||
ENTRYPOINT [ "/run_cov_binary.sh" ] |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.