Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit e4c2e55

Browse files
authored
Merge pull request #53 from pusher/fix-tests
Wait for reconcile before fetching files
2 parents e2a99ad + d7a8aaf commit e4c2e55

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

Gopkg.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ required = [
2222

2323
[[constraint]]
2424
name="github.com/pusher/git-store"
25-
version="v0.4.1"
25+
version="v0.4.3"
2626

2727
[[override]]
2828
name = "github.com/Azure/go-autorest"

pkg/controller/gittrack/gittrack_controller_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -683,11 +683,8 @@ var _ = Describe("GitTrack Suite", func() {
683683
})
684684

685685
It("updates the time to deploy metric", func() {
686-
// Reset the time to deploy metric
687-
metrics.TimeToDeploy = prometheus.NewHistogramVec(prometheus.HistogramOpts{
688-
Name: "faros_gittrack_time_to_deploy_seconds",
689-
Help: "Counts the time from commit to deploy of a child resource",
690-
}, []string{"name", "namespace", "repository"})
686+
// Reset the metric before testing
687+
metrics.TimeToDeploy.Reset()
691688

692689
Eventually(func() error { return c.Get(context.TODO(), key, instance) }, timeout).Should(Succeed())
693690
Expect(instance.Spec.Reference).To(Equal("a14443638218c782b84cae56a14f1090ee9e5c9c"))
@@ -1073,6 +1070,13 @@ var getsFilesFromRepo = func(path string, count int) {
10731070
}
10741071

10751072
Expect(c.Create(context.TODO(), gt)).NotTo(HaveOccurred())
1073+
req := reconcile.Request{
1074+
NamespacedName: types.NamespacedName{
1075+
Name: "test",
1076+
Namespace: "default",
1077+
},
1078+
}
1079+
Eventually(requests, timeout).Should(Receive(Equal(req)))
10761080

10771081
files, err = reconciler.getFiles(gt)
10781082
Expect(err).ToNot(HaveOccurred())

0 commit comments

Comments
 (0)