Skip to content
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

Add code coverage for flow aggregator #1898

Merged
merged 1 commit into from
Mar 10, 2021

Conversation

srikartati
Copy link
Member

Add code coverage for flow aggregator binary when
running end-to-end tests on different platforms
(kind, jenkins, VMC etc.)

@codecov-io
Copy link

codecov-io commented Feb 23, 2021

Codecov Report

Merging #1898 (abfe254) into main (d1a9fe1) will decrease coverage by 16.29%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1898       +/-   ##
===========================================
- Coverage   62.56%   46.27%   -16.30%     
===========================================
  Files         204      187       -17     
  Lines       17534    16788      -746     
===========================================
- Hits        10970     7768     -3202     
- Misses       5402     8009     +2607     
+ Partials     1162     1011      -151     
Flag Coverage Δ
e2e-tests 46.27% <ø> (?)
kind-e2e-tests ?
unit-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/controller/networkpolicy/crd_utils.go 0.00% <0.00%> (-90.22%) ⬇️
pkg/controller/networkpolicy/status_controller.go 0.00% <0.00%> (-88.82%) ⬇️
...g/controller/networkpolicy/clusternetworkpolicy.go 0.00% <0.00%> (-86.96%) ⬇️
...kg/controller/networkpolicy/antreanetworkpolicy.go 0.00% <0.00%> (-84.70%) ⬇️
pkg/controller/networkpolicy/endpoint_querier.go 2.70% <0.00%> (-83.79%) ⬇️
pkg/ipfix/ipfix_process.go 0.00% <0.00%> (-81.82%) ⬇️
pkg/agent/util/iptables/lock.go 0.00% <0.00%> (-81.82%) ⬇️
pkg/agent/controller/networkpolicy/priority.go 8.49% <0.00%> (-81.70%) ⬇️
pkg/ipfix/ipfix_set.go 20.00% <0.00%> (-80.00%) ⬇️
pkg/apis/controlplane/v1beta1/conversion.go 1.16% <0.00%> (-79.85%) ⬇️
... and 114 more

@srikartati srikartati force-pushed the flow_agg_code_coverage branch 2 times, most recently from 0bdf69f to 43766ca Compare February 23, 2021 22:15
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

I see no logic in the e2e test framework to retrieve the coverage file for the flow aggregator and copy it to the correct directory?

https://github.com/vmware-tanzu/antrea/blob/6485421be9da2e97b1fc3f7a180cccb2dc053a7f/test/e2e/framework.go#L1571-L1643

@srikartati srikartati force-pushed the flow_agg_code_coverage branch 2 times, most recently from 9f8cbee to 34881f3 Compare February 24, 2021 18:20
Copy link
Contributor

@dreamtalen dreamtalen left a comment

Choose a reason for hiding this comment

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

Thanks for your PR.

command:
- flow-aggregator-coverage
name: flow-aggregator
image: antrea/flow-aggregator-coverage:latest
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing a blank new line.

@@ -298,7 +298,11 @@ function deliver_antrea {
VERSION="$CLUSTER" DOCKER_REGISTRY="${DOCKER_REGISTRY}" make && break
fi
done
VERSION="$CLUSTER" DOCKER_REGISTRY="${DOCKER_REGISTRY}" make flow-aggregator-ubuntu
if [[ "$COVERAGE" == true ]]; then
VERSION="$CLUSTER" DOCKER_REGISTRY="${DOCKER_REGISTRY}" make flow-aggregator-ubuntu
Copy link
Contributor

Choose a reason for hiding this comment

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

swap L302 and L304?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, thats right. It was a mistake. Done.

@@ -298,7 +298,11 @@ function deliver_antrea {
VERSION="$CLUSTER" DOCKER_REGISTRY="${DOCKER_REGISTRY}" make && break
fi
done
VERSION="$CLUSTER" DOCKER_REGISTRY="${DOCKER_REGISTRY}" make flow-aggregator-ubuntu
if [[ "$COVERAGE" == true ]]; then
VERSION="$CLUSTER" DOCKER_REGISTRY="${DOCKER_REGISTRY}" make flow-aggregator-ubuntu
Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, thats right. It was a mistake. Done.

test/e2e/framework.go Show resolved Hide resolved
@srikartati
Copy link
Member Author

/test-all

Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

@weiqiangt I believe the codecov token is wrong, or something along these lines. The codecov reports are not being uploaded to the correct place. When I look at some logs for Github workflows running on the main branch, I see:

View reports at https://codecov.io/github/weiqiangt/antrea/commit/c9f526066d20de477ac2126f14090e1f4bfd8d6e

So I think we may be using a token for your personal fork and not for vmware-tanzu/antrea. I don't want to merge this PR before this is fixed, as I want to check that the coverage data for the aggregator is handled correctly.

Maybe I need to update the token myself?

}
pods, err := data.clientset.CoreV1().Pods(flowAggregatorNamespace).List(context.TODO(), listOptions)
if err != nil {
return fmt.Errorf("failed to list Flow Aggregator: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

list Flow Aggregator Pods

@srikartati
Copy link
Member Author

srikartati commented Feb 26, 2021

@weiqiangt I believe the codecov token is wrong, or something along these lines. The codecov reports are not being uploaded to the correct place. When I look at some logs for Github workflows running on the main branch, I see:

View reports at https://codecov.io/github/weiqiangt/antrea/commit/c9f526066d20de477ac2126f14090e1f4bfd8d6e

So I think we may be using a token for your personal fork and not for vmware-tanzu/antrea. I don't want to merge this PR before this is fixed, as I want to check that the coverage data for the aggregator is handled correctly.

Maybe I need to update the token myself?

I checked cov.out files in the kind e2e test artifacts and code coverage output for flow aggregator seemed to have populated there fine. Yes, I tried codecov UI, but could not locate it. I created my PR before the main branch fix went in. Does it have to do something with that?

@srikartati srikartati force-pushed the flow_agg_code_coverage branch 2 times, most recently from 6a03e30 to 7261a51 Compare February 26, 2021 20:08
@antoninbas
Copy link
Contributor

I didn't hear from @weiqiangt about this, so I'll try updating the token myself to see if it resolves the issue

@srikartati
Copy link
Member Author

/test-all

@antoninbas
Copy link
Contributor

@srikartati I think I have fixed the issue by changing the token
Could you rebase your PR on main?

@srikartati
Copy link
Member Author

/test-all

@srikartati srikartati force-pushed the flow_agg_code_coverage branch 5 times, most recently from 88d0cfe to 47335d6 Compare February 27, 2021 06:58
@srikartati
Copy link
Member Author

/test-all

@srikartati
Copy link
Member Author

/test-all

antoninbas
antoninbas previously approved these changes Mar 1, 2021
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

Looks like the coverage data is uploaded correctly now

Add code coverage for flow aggregator binary when
running end-to-end tests on different platforms
(kind, jenkins, VMC etc.)
@srikartati
Copy link
Member Author

/test-all

@srikartati
Copy link
Member Author

/test-conformance

@srikartati srikartati merged commit b36103a into antrea-io:main Mar 10, 2021
@srikartati srikartati deleted the flow_agg_code_coverage branch March 10, 2021 21:38
tnqn pushed a commit to tnqn/antrea that referenced this pull request Mar 17, 2021
Add code coverage for flow aggregator binary when
running end-to-end tests on different platforms
(kind, jenkins, VMC etc.)
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.

5 participants