Test further commits to push branch
This adds a test to check that should there be a further update to make, another commit is pushed to the "push branch". In this case, the image policy gets a new latest image. The test fails at present because the controller is not watching image policies (and will not run again on the long interval specified). Signed-off-by: Michael Bridgen <michael@weave.works>
This commit is contained in:
parent
89733c608e
commit
cc3bd7e1da
|
|
@ -564,7 +564,6 @@ Images:
|
|||
)
|
||||
|
||||
const latestImage = "helloworld:1.0.1"
|
||||
const evenLatestImage = "helloworld:1.2.0"
|
||||
|
||||
BeforeEach(func() {
|
||||
cloneLocalRepoURL = gitServer.HTTPAddressWithCredentials() + repositoryPath
|
||||
|
|
@ -726,6 +725,22 @@ Images:
|
|||
Expect(commit.Message).To(Equal(commitMessage))
|
||||
})
|
||||
|
||||
It("pushes another commit to the existing push branch", func() {
|
||||
// observe the first commit
|
||||
waitForNewHead(localRepo, pushBranch)
|
||||
head, err := localRepo.Reference(plumbing.NewRemoteReferenceName(originRemote, pushBranch), true)
|
||||
headHash := head.String()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
// update the policy and expect another commit in the push branch
|
||||
policy.Status.LatestImage = "helloworld:v1.3.0"
|
||||
Expect(k8sClient.Status().Update(context.TODO(), policy)).To(Succeed())
|
||||
waitForNewHead(localRepo, pushBranch)
|
||||
head, err = localRepo.Reference(plumbing.NewRemoteReferenceName(originRemote, pushBranch), true)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(head.String()).NotTo(Equal(headHash))
|
||||
})
|
||||
|
||||
AfterEach(func() {
|
||||
Expect(k8sClient.Delete(context.Background(), update)).To(Succeed())
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue