test: fix GC tests for macOS

This commit is contained in:
stefanprodan 2020-04-30 09:56:46 +03:00
parent c9db552555
commit ca884a9b37
2 changed files with 16 additions and 2 deletions

View File

@ -157,8 +157,15 @@ var _ = Describe("HelmChartReconciler", func() {
return k8sClient.Get(context.Background(), key, c)
}).ShouldNot(Succeed())
exists := func(path string) bool {
// wait for tmp sync on macOS
time.Sleep(time.Second)
_, err := os.Stat(path)
return err == nil
}
By("Expecting GC on delete")
Eventually(storage.ArtifactExist(*got.Status.Artifact), timeout, interval).ShouldNot(BeTrue())
Eventually(exists(got.Status.Artifact.Path), timeout, interval).ShouldNot(BeTrue())
})
It("Filters versions", func() {

View File

@ -139,8 +139,15 @@ var _ = Describe("HelmRepositoryReconciler", func() {
return k8sClient.Get(context.Background(), key, r)
}).ShouldNot(Succeed())
exists := func(path string) bool {
// wait for tmp sync on macOS
time.Sleep(time.Second)
_, err := os.Stat(path)
return err == nil
}
By("Expecting GC after delete")
Eventually(storage.ArtifactExist(*got.Status.Artifact), timeout, interval).ShouldNot(BeTrue())
Eventually(exists(got.Status.Artifact.Path), timeout, interval).ShouldNot(BeTrue())
})
It("Authenticates when basic auth credentials are provided", func() {