You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed the Bundle and BundleDeployment provisioners under internal/provisioner don't have unit tests. We should implement some unit tests that are based on running the Reconcile() function for each provisioner. In the unit tests we could easily mock the Unpacker interface with something like:
var_ source.Unpacker=&MockSource{}
// MockSource is a utility for mocking out an Unpacker sourcetypeMockSourcestruct {
// result is the result that should be returned when MockSource.Unpack is calledresult*source.Result// shouldError determines whether or not the MockSource should return an error when MockSource.Unpack is calledshouldErrorbool
}
func (ms*MockSource) Unpack(ctx context.Context, catalog*catalogdv1beta1.Catalog) (*source.Result, error) {
ifms.shouldError {
returnnil, errors.New("mocksource error")
}
returnms.result, nil
}
We should also add unit tests to the plain, helm, and registry provisioners if they don't already have them.
This issue has become stale because it has been open 60 days with no activity. The maintainers of this repo will remove this label during issue triage or it will be removed automatically after an update. Adding the lifecycle/frozen label will cause this issue to ignore lifecycle events.
I noticed the
Bundle
andBundleDeployment
provisioners underinternal/provisioner
don't have unit tests. We should implement some unit tests that are based on running theReconcile()
function for each provisioner. In the unit tests we could easily mock theUnpacker
interface with something like:We should also add unit tests to the plain, helm, and registry provisioners if they don't already have them.
The creation of this issue was inspired by operator-framework/catalogd#65 (comment)
The text was updated successfully, but these errors were encountered: