-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add code coverage for flow aggregator
Add code coverage for flow aggregator binary when running end-to-end tests on different platforms (kind, jenkins, VMC etc.)
- Loading branch information
1 parent
ad3a9c9
commit 47335d6
Showing
11 changed files
with
170 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM golang:1.15 as flow-aggregator-build | ||
|
||
WORKDIR /antrea | ||
|
||
COPY . /antrea | ||
|
||
RUN make flow-aggregator flow-aggregator-instr-binary | ||
|
||
FROM antrea/base-ubuntu:2.14.0 | ||
|
||
LABEL maintainer="Antrea <projectantrea-dev@googlegroups.com>" | ||
LABEL description="The docker image for the flow aggregator with code coverage measurement enabled for testing purposes." | ||
|
||
USER root | ||
|
||
COPY --from=flow-aggregator-build /antrea/bin/flow-aggregator* /usr/local/bin/ | ||
COPY --from=flow-aggregator-build /antrea/test/e2e/coverage/flow-aggregator-arg-file / |
13 changes: 13 additions & 0 deletions
13
build/yamls/flow-aggregator/patches/coverage/startFlowAggCov.yml
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,13 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: flow-aggregator | ||
namespace: flow-aggregator | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: flow-aggregator | ||
image: antrea/flow-aggregator-coverage:latest | ||
command: [ "/bin/sh" ] | ||
args: [ "-c", "sleep 2; flow-aggregator-coverage -test.run=TestBincoverRunMain -test.coverprofile=flow-aggregator.cov.out -args-file=/flow-aggregator-arg-file; while true; do sleep 5 & wait $!; done" ] |
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,13 @@ | ||
// +build testbincover | ||
|
||
package main | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/confluentinc/bincover" | ||
) | ||
|
||
func TestBincoverRunMain(t *testing.T) { | ||
bincover.RunTest(main) | ||
} |
Oops, something went wrong.