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 unit test for egress group store #4151

Merged
merged 2 commits into from
Aug 29, 2022
Merged

Add unit test for egress group store #4151

merged 2 commits into from
Aug 29, 2022

Conversation

wenqiq
Copy link
Contributor

@wenqiq wenqiq commented Aug 25, 2022

Add unit test for egress group store

For #4142

Signed-off-by: Wenqi Qiu wenqiq@vmware.com

@wenqiq wenqiq requested a review from tnqn August 25, 2022 07:39
@codecov
Copy link

codecov bot commented Aug 25, 2022

Codecov Report

Merging #4151 (7873586) into main (68d274a) will increase coverage by 1.10%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4151      +/-   ##
==========================================
+ Coverage   65.08%   66.19%   +1.10%     
==========================================
  Files         303      304       +1     
  Lines       46561    46625      +64     
==========================================
+ Hits        30304    30862     +558     
+ Misses      13903    13366     -537     
- Partials     2354     2397      +43     
Flag Coverage Δ
integration-tests 34.94% <ø> (+<0.01%) ⬆️
kind-e2e-tests 49.17% <ø> (+0.54%) ⬆️
unit-tests 45.11% <ø> (+0.14%) ⬆️
Impacted Files Coverage Δ
pkg/controller/egress/store/egressgroup.go 87.82% <ø> (+31.79%) ⬆️
pkg/agent/util/net.go 44.19% <0.00%> (-2.25%) ⬇️
pkg/controller/grouping/controller.go 65.13% <0.00%> (-1.98%) ⬇️
.../flowexporter/connections/conntrack_connections.go 79.52% <0.00%> (-1.91%) ⬇️
pkg/controller/externalippool/controller.go 83.03% <0.00%> (-1.79%) ⬇️
...lticluster/commonarea/resourceimport_controller.go 79.55% <0.00%> (-1.49%) ⬇️
pkg/agent/controller/networkpolicy/reconciler.go 70.27% <0.00%> (-1.14%) ⬇️
pkg/agent/proxy/proxier.go 65.51% <0.00%> (-0.60%) ⬇️
pkg/ovs/openflow/ofctrl_bridge.go 75.53% <0.00%> (-0.59%) ⬇️
pkg/agent/util/iptables/iptables.go 45.07% <0.00%> (-0.52%) ⬇️
... and 26 more

pkg/controller/egress/store/egressgroup_test.go Outdated Show resolved Hide resolved
pkg/controller/egress/store/egressgroup_test.go Outdated Show resolved Hide resolved
pkg/controller/egress/store/egressgroup_test.go Outdated Show resolved Hide resolved
w, err := store.Watch(context.Background(), "", labels.Everything(), tc.fieldSelector)
if err != nil {
t.Fatalf("Failed to watch object: %v", err)
}
Copy link
Member

Choose a reason for hiding this comment

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

it should stop the watcher after the test finishes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. BTW. Does it need to change this test function in this PR? same structure as TestWatchNetworkPolicyEvent

Copy link
Member

Choose a reason for hiding this comment

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

I think yes

@tnqn tnqn mentioned this pull request Aug 25, 2022
37 tasks
wenqiq added 2 commits August 26, 2022 10:14
Signed-off-by: Wenqi Qiu <wenqiq@vmware.com>
Signed-off-by: Wenqi Qiu <wenqiq@vmware.com>
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM

@tnqn
Copy link
Member

tnqn commented Aug 29, 2022

/skip-all

@tnqn tnqn merged commit 1bac594 into antrea-io:main Aug 29, 2022
heanlan pushed a commit to heanlan/antrea that referenced this pull request Mar 29, 2023
Signed-off-by: Wenqi Qiu <wenqiq@vmware.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.

2 participants