-
Notifications
You must be signed in to change notification settings - Fork 376
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
Adds unit test for fqdn.go #4582
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4582 +/- ##
==========================================
- Coverage 69.58% 69.50% -0.08%
==========================================
Files 400 400
Lines 59122 59122
==========================================
- Hits 41141 41095 -46
- Misses 15175 15219 +44
- Partials 2806 2808 +2
*This pull request uses carry forward flags. Click here to find out more.
|
@urharshitha Unit test failed, please check. |
85b6c83
to
3f04497
Compare
3f04497
to
8dc583b
Compare
existingDNSCache: map[string]dnsMeta{ | ||
"test.antrea.io": { | ||
responseIPs: map[string]net.IP{ | ||
"IP": net.ParseIP("127.0.0.1"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The key doesn't match the data in real world. It should be the string format of the IP.
And please use more than one IP to cover multiple response IPs case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
8dc583b
to
c19dc77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
f.dnsEntryCache = tc.existingDNSCache | ||
} | ||
gotOutput := f.getIPsForFQDNSelectors(tc.fqdns) | ||
assert.Equal(t, tc.expectedMatchedIPs, gotOutput) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ElementsMatch to avoid order mismatch.
The unit test failed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Harshitha U R <harshithaur1611@gmail.com>
c19dc77
to
e6bf9f7
Compare
/skip-all |
Adds the unit test for pkg/agent/controller/networkpolicy/fqdn.go
for #4142
Signed-off-by: Harshitha U R harshithaur1611@gmail.com