From 6854e1e90d4193e4bdb5ce984c6c39b7e6b6cb26 Mon Sep 17 00:00:00 2001 From: Derek Menteer <105233703+hashi-derek@users.noreply.github.com> Date: Tue, 9 Jan 2024 13:45:29 -0600 Subject: [PATCH] Fix broken tests. (#20130) This fixes some tests that were broken, but not caught, due to the CICD pipeline only running a subset of the overall tests on PRs. --- agent/config_endpoint_test.go | 2 ++ agent/consul/intention_endpoint_test.go | 4 ++-- agent/consul/leader_test.go | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/agent/config_endpoint_test.go b/agent/config_endpoint_test.go index 43a8ec206e..b2db659126 100644 --- a/agent/config_endpoint_test.go +++ b/agent/config_endpoint_test.go @@ -141,6 +141,7 @@ func TestConfig_Get(t *testing.T) { // Set indexes and EnterpriseMeta to expected values for assertions ce.CreateIndex = 12 ce.ModifyIndex = 13 + ce.Hash = 0 ce.EnterpriseMeta = acl.EnterpriseMeta{} out, err := a.srv.marshalJSON(req, obj) @@ -450,6 +451,7 @@ func TestConfig_Apply_IngressGateway(t *testing.T) { // Ignore create and modify indices got.CreateIndex = 0 got.ModifyIndex = 0 + got.Hash = 0 expect := &structs.IngressGatewayConfigEntry{ Name: "ingress", diff --git a/agent/consul/intention_endpoint_test.go b/agent/consul/intention_endpoint_test.go index d7e469b803..fc3edb8a7c 100644 --- a/agent/consul/intention_endpoint_test.go +++ b/agent/consul/intention_endpoint_test.go @@ -551,7 +551,7 @@ func TestIntentionApply_WithoutIDs(t *testing.T) { }, RaftIndex: entry.RaftIndex, } - + entry.Hash = 0 require.Equal(t, expect, entry) } @@ -690,7 +690,7 @@ func TestIntentionApply_WithoutIDs(t *testing.T) { }, RaftIndex: entry.RaftIndex, } - + entry.Hash = 0 require.Equal(t, expect, entry) } diff --git a/agent/consul/leader_test.go b/agent/consul/leader_test.go index 0546b5b4ed..be227ba348 100644 --- a/agent/consul/leader_test.go +++ b/agent/consul/leader_test.go @@ -1281,7 +1281,7 @@ func TestDatacenterSupportsIntentionsAsConfigEntries(t *testing.T) { RaftIndex: got.RaftIndex, } - + got.Hash = 0 require.Equal(t, expect, got) })