Skip to content

Commit

Permalink
test: fix GC tests for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprodan committed Apr 30, 2020
1 parent c9db552 commit ca884a9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion controllers/helmchart_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
9 changes: 8 additions & 1 deletion controllers/helmrepository_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit ca884a9

Please sign in to comment.