Skip to content
Snippets Groups Projects
Commit d6b751a0 authored by Francisco Borges Aurindo Barros's avatar Francisco Borges Aurindo Barros
Browse files

Added empty unit tests TODO, renamed func

parent 954c1fa3
Branches
No related tags found
1 merge request!142Add backup policy with DrupalProjectConfig
Pipeline #3460137 passed
......@@ -339,8 +339,8 @@ func (r *DrupalSiteReconciler) Reconcile(ctx context.Context, req ctrl.Request)
setErrorCondition(drupalSite, reconcileErr)
return r.updateCRStatusOrFailReconcile(ctx, log, drupalSite)
case updateNeeded:
log.Info("Updating DrupalProjectConfig " + drupalProjectConfig.Namespace)
r.updateDrupalProjectConfigCRorFailReconcile(ctx, log, drupalProjectConfig)
log.Info("Updating DrupalProjectConfig ")
r.updateDrupalProjectConfigCR(ctx, log, drupalProjectConfig)
}
// Check if current instance is the Primary Drupalsite
updateNeeded, reconcileErr = r.checkIfPrimaryDrupalsite(ctx, drupalSite, drupalProjectConfig)
......
......@@ -1918,7 +1918,21 @@ var _ = Describe("DrupalSite controller", func() {
})
})
})
Describe("TODO Using DrupalProjectConfig", func() {
Context("", func() {
It("", func() {
// Tests that should be done
// Create a new project without any DrupalProjectConfig, operator logs Warning: Project $PROJECT does not contain any DrupalProjectConfig!
// Createda DrupalProjectConfig with one website and saw spec getting automatically filled, $PROJECT only 1 drupalsite\"$DRUPALSITE\", which is considered the primary production site
// Creation of a second website does not affect DrupalProjectConfig
// Creation of DrupalProjectConfig with 2 DrupalSites in place will not automatically fill spec.primarySiteName
// Deletion of 2 instances to 1, and spec.primarySiteName=="", will auto-fill
// If spec.primarySiteName!="", it is never auto-filled, not even with just one instance being created
// By default DrupalSite.status.isPrimary is false
// Editing DrupalProjectConfig will reflect changes on DrupalSite.status.isPrimary
})
})
})
Describe("Deleting the drupalsite object", func() {
Context("With critical QoS", func() {
It("Should be deleted successfully", func() {
......
......@@ -121,7 +121,7 @@ func setDBUpdatesPending(drp *webservicesv1a1.DrupalSite) (update bool) {
}
// updateCRorFailReconcile tries to update the Custom Resource and logs any error
func (r *DrupalSiteReconciler) updateDrupalProjectConfigCRorFailReconcile(ctx context.Context, log logr.Logger, dpc *webservicesv1a1.DrupalProjectConfig) {
func (r *DrupalSiteReconciler) updateDrupalProjectConfigCR(ctx context.Context, log logr.Logger, dpc *webservicesv1a1.DrupalProjectConfig) {
if err := r.Update(ctx, dpc); err != nil {
if k8sapierrors.IsConflict(err) {
log.V(4).Info("Object changed while reconciling. Requeuing.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment