2022-04-25 15:32:46 +00:00
|
|
|
package beaconclient_test
|
2022-04-25 14:41:50 +00:00
|
|
|
|
|
|
|
import (
|
2022-04-26 17:57:01 +00:00
|
|
|
"context"
|
|
|
|
|
2022-04-25 14:41:50 +00:00
|
|
|
. "github.com/onsi/ginkgo/v2"
|
|
|
|
. "github.com/onsi/gomega"
|
2022-04-25 15:32:46 +00:00
|
|
|
beaconclient "github.com/vulcanize/ipld-ethcl-indexer/pkg/beaconclient"
|
2022-04-25 14:41:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var _ = Describe("Healthcheck", func() {
|
|
|
|
var (
|
2022-04-26 17:57:01 +00:00
|
|
|
BC = beaconclient.CreateBeaconClient(context.Background(), "localhost", 5052)
|
|
|
|
errBc = beaconclient.CreateBeaconClient(context.Background(), "blah-blah", 1010)
|
2022-04-25 14:41:50 +00:00
|
|
|
)
|
|
|
|
Describe("Connecting to the lighthouse client", Label("integration"), func() {
|
|
|
|
Context("When the client is running", func() {
|
|
|
|
It("We should connect successfully", func() {
|
2022-04-25 15:32:46 +00:00
|
|
|
err := BC.CheckBeaconClient()
|
2022-04-25 14:41:50 +00:00
|
|
|
Expect(err).To(BeNil())
|
|
|
|
})
|
|
|
|
})
|
2022-04-26 17:57:01 +00:00
|
|
|
Context("When the client is not running", func() {
|
|
|
|
It("We not should connect successfully", func() {
|
2022-04-25 15:32:46 +00:00
|
|
|
err := errBc.CheckBeaconClient()
|
2022-04-25 14:41:50 +00:00
|
|
|
Expect(err).ToNot(BeNil())
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|