Test both endpoints and slices for unit tests#19645
Test both endpoints and slices for unit tests#19645istio-testing merged 2 commits intoistio:masterfrom
Conversation
a7436d5 to
ecbfdf5
Compare
ecbfdf5 to
4a2c06b
Compare
|
@rshriram @hzxuzhonghu please take a look |
| pod2 := generatePod("172.0.1.2", "pod2", "nsA", "", "node2", map[string]string{"app": "prod-app"}, map[string]string{}) | ||
| for mode, name := range EndpointModeNames { | ||
| t.Run(name, func(t *testing.T) { | ||
| controller, fx := newFakeControllerWithOptions(fakeControllerOptions{mode: mode}) |
There was a problem hiding this comment.
I think this is not right, you need to copy the value of mode. otherwise, if the subtests are run in parrallel, when the function is run, the mode may be the last value of EndpointModeNames
There was a problem hiding this comment.
There was a problem hiding this comment.
I think it doesn't apply here since mode isn't a pointer? I'll change it though since I'm not sure
There was a problem hiding this comment.
I put a hold on this to fix it. Once this is in I'll update to beta endpoint slice api
There was a problem hiding this comment.
It doesnot matter whether it is value type or pointer type, as mode is a variable
There was a problem hiding this comment.
I have fixed this, please take a look
|
/retest |
This change makes our controller tests run twice, once with endpoints
and once with endpoint slice. A few tests are not relevant to this, so
they are just using Endpoints as before. Additionally, the probing tests
were combined to use a table driven test to make this change simpler.