Skip to content

Commit

Permalink
Merge pull request #104 from controlplaneio-fluxcd/fix-lf-test
Browse files Browse the repository at this point in the history
Check for `OutdatedReason` event in lifecycle test
  • Loading branch information
stefanprodan authored Oct 4, 2024
2 parents eeed6ef + 382b013 commit d640411
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions internal/controller/fluxinstance_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,16 @@ func TestFluxInstanceReconciler_LifeCycle(t *testing.T) {

// Check if events were recorded for each step.
events := getEvents(result.Name)
g.Expect(events).To(HaveLen(4))
g.Expect(events[0].Reason).To(Equal(meta.ProgressingReason))
g.Expect(events[0].Message).To(HavePrefix("Installing"))
g.Expect(events[1].Reason).To(Equal(meta.ReconciliationSucceededReason))
g.Expect(events[1].Message).To(HavePrefix("Reconciliation finished"))
g.Expect(events[2].Reason).To(Equal(meta.ProgressingReason))
g.Expect(events[2].Message).To(HavePrefix("Upgrading"))
g.Expect(events[3].Reason).To(Equal(meta.ReconciliationSucceededReason))
g.Expect(events[3].Annotations).To(HaveKeyWithValue(fluxcdv1.RevisionAnnotation, resultFinal.Status.LastAppliedRevision))
g.Expect(events).To(HaveLen(5))
g.Expect(events[0].Reason).To(Equal(fluxcdv1.OutdatedReason))
g.Expect(events[1].Reason).To(Equal(meta.ProgressingReason))
g.Expect(events[1].Message).To(HavePrefix("Installing"))
g.Expect(events[2].Reason).To(Equal(meta.ReconciliationSucceededReason))
g.Expect(events[2].Message).To(HavePrefix("Reconciliation finished"))
g.Expect(events[3].Reason).To(Equal(meta.ProgressingReason))
g.Expect(events[3].Message).To(HavePrefix("Upgrading"))
g.Expect(events[4].Reason).To(Equal(meta.ReconciliationSucceededReason))
g.Expect(events[4].Annotations).To(HaveKeyWithValue(fluxcdv1.RevisionAnnotation, resultFinal.Status.LastAppliedRevision))

err = testClient.Delete(ctx, obj)
g.Expect(err).ToNot(HaveOccurred())
Expand Down

0 comments on commit d640411

Please sign in to comment.