Skip to content

Commit

Permalink
Extend unit tests to cover broker SyncCounterOpts
Browse files Browse the repository at this point in the history
...in the broker Syncer.

Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
  • Loading branch information
tpantelis authored and skitt committed Aug 16, 2023
1 parent b38277c commit c1a0e54
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/syncer/broker/syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/prometheus/client_golang/prometheus"
"github.com/submariner-io/admiral/pkg/fake"
sync "github.com/submariner-io/admiral/pkg/syncer"
"github.com/submariner-io/admiral/pkg/syncer/broker"
Expand All @@ -35,6 +36,7 @@ import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
utilrand "k8s.io/apimachinery/pkg/util/rand"
)

var _ = Describe("Broker Syncer", func() {
Expand Down Expand Up @@ -101,6 +103,13 @@ var _ = Describe("Broker Syncer", func() {
})

When("a local resource is created in the local datastore", func() {
BeforeEach(func() {
config.ResourceConfigs[0].SyncCounterOpts = &prometheus.GaugeOpts{
Namespace: "ns",
Name: utilrand.String(5),
}
})

JustBeforeEach(func() {
test.CreateResource(localClient, resource)
test.AwaitResource(brokerClient, resource.GetName())
Expand Down

0 comments on commit c1a0e54

Please sign in to comment.