-
Notifications
You must be signed in to change notification settings - Fork 277
injector: Adding unit tests for the injector package #1772
Conversation
5348e6a
to
5fbe76c
Compare
98b9c36
to
f656d18
Compare
This isn't incorrect but rather as expected. The way the function works prior to this change is that if |
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.
Thanks for adding the tests, some comments regarding the existing functionality.
8400633
to
d45cb71
Compare
Codecov Report
@@ Coverage Diff @@
## main #1772 +/- ##
==========================================
+ Coverage 55.51% 59.21% +3.70%
==========================================
Files 125 125
Lines 5163 5171 +8
==========================================
+ Hits 2866 3062 +196
+ Misses 2295 2106 -189
- Partials 2 3 +1
Continue to review full report at Codecov.
|
d45cb71
to
d017712
Compare
d017712
to
e643727
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.
Looks correct overall, few comments and some linting issues to resolve.
da4ec7b
to
1809bd1
Compare
1809bd1
to
49ecf3d
Compare
kubeClient: client, | ||
kubeController: mockNsController, | ||
certManager: tresor.NewFakeCertManager(&cache, mockConfigurator), | ||
meshCatalog: catalog.NewFakeMeshCatalog(client), |
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.
You know we have a mock for catalog too right? >:)
This PR adds more unit test coverage for the
pkg/injector
This PR also includes a rewrite of the
updateAnnotation()
function - to simplify and correct.Previous iteration of this function returned
add
JSONPatchOperation
withValue
being sometimesstring
and other timesmap[string]string
. The most recent iteration always createsadd
JSONPatchOperation
withValue
ofmap[string]string
.Before
$ go test -cover ./pkg/injector/... ok github.com/openservicemesh/osm/pkg/injector 0.058s coverage: 27.6% of statements
After
$ go test -cover ./pkg/injector/... ok github.com/openservicemesh/osm/pkg/injector 6.821s coverage: 75.7% of statements
Please mark with X for applicable areas.
Please answer the following questions with yes/no.
no