From e00ef0ac393d6feccc8504608c7bb6f489a1f0fc Mon Sep 17 00:00:00 2001 From: Edoardo Tenani Date: Thu, 9 Jan 2025 17:02:12 +0100 Subject: [PATCH] add debugging info to assertDatastreams --- functionaltests/main_test.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/functionaltests/main_test.go b/functionaltests/main_test.go index 250d6de3a0..27f71b30b6 100644 --- a/functionaltests/main_test.go +++ b/functionaltests/main_test.go @@ -90,15 +90,22 @@ func assertDatastreams(t *testing.T, expected checkDatastreamWant, actual []type require.Len(t, actual, expected.Quantity, "number of APM datastream differs from expectations") for _, v := range actual { if expected.PreferIlm { - assert.True(t, v.PreferIlm) + assert.True(t, v.PreferIlm, "datastream %s should prefer ILM", v.Name) } else { - assert.False(t, v.PreferIlm) + assert.False(t, v.PreferIlm, "datastream %s should not prefer ILM", v.Name) } - assert.Equal(t, expected.DSManagedBy, v.NextGenerationManagedBy.Name) - assert.Len(t, v.Indices, expected.IndicesPerDs) + assert.Equal(t, expected.DSManagedBy, v.NextGenerationManagedBy.Name, + `datastream %s should be managed by "%s"`, v.Name, expected.DSManagedBy, + ) + assert.Len(t, v.Indices, expected.IndicesPerDs, + "datastream %s should have %d indices", v.Name, expected.IndicesPerDs, + ) for i, index := range v.Indices { - assert.Equal(t, expected.IndicesManagedBy[i], index.ManagedBy.Name) + assert.Equal(t, expected.IndicesManagedBy[i], index.ManagedBy.Name, + `index %s should be managed by "%s"`, index.IndexName, + expected.IndicesManagedBy[i], + ) } }