Skip to content

Commit

Permalink
use optional desscription instead of comments to describe tests
Browse files Browse the repository at this point in the history
  • Loading branch information
David Jumani authored and David Jumani committed Jun 26, 2023
1 parent fc679df commit 59c2010
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions projects/gloo/pkg/xds/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@ var _ = Describe("Cache", func() {
It("NodeRoleHasher generates the correct ID", func() {
nodeRoleHasher := xds.NewNodeRoleHasher()
node := &envoy_config_core_v3.Node{}
// Ensure it returns the fallback key if the role field in the node metadata is not present
Expect(nodeRoleHasher.ID(node)).To(Equal(xds.FallbackNodeCacheKey))
Expect(nodeRoleHasher.ID(node)).To(Equal(xds.FallbackNodeCacheKey),
fmt.Sprintf("Should return %s if the role field in the node metadata is not present", xds.FallbackNodeCacheKey))

role := "role"
node.Metadata = &structpb.Struct{
Fields: map[string]*structpb.Value{
role: structpb.NewStringValue(role),
},
}
// Ensure it returns the role field in the node metadata
Expect(nodeRoleHasher.ID(node)).To(Equal(role))
Expect(nodeRoleHasher.ID(node)).To(Equal(role), "Should return the role field in the node metadata")
})

It("SnapshotCacheKeys returns the keys formatted correctly", func() {
Expand Down

0 comments on commit 59c2010

Please sign in to comment.