From f1878aac69c2ef472aa1a760704aa935c450568f Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Thu, 2 Mar 2023 19:19:20 +0100 Subject: [PATCH] tests: WIP sla history trail sync --- tests/object_sync_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/object_sync_test.go b/tests/object_sync_test.go index 27d3c9551..12f88e449 100644 --- a/tests/object_sync_test.go +++ b/tests/object_sync_test.go @@ -310,6 +310,24 @@ func TestObjectSync(t *testing.T) { t.Skip() }) + t.Run("Sla History Trail", func(t *testing.T) { + t.Parallel() + + assert.Eventuallyf(t, func() bool { + var count int + err := db.Get(&count, "SELECT COUNT(*) FROM sla_history_trail WHERE service_id IS NULL") + require.NoError(t, err, "querying hosts sla history trail should not fail") + return count == len(data.Hosts) + }, 20*time.Second, 200*time.Millisecond, "Newly created hosts should exists in database") + + assert.Eventuallyf(t, func() bool { + var count int + err := db.Get(&count, "SELECT COUNT(*) FROM sla_history_trail WHERE service_id IS NOT NULL") + require.NoError(t, err, "querying services sla history trail should not fail") + return count == len(data.Services) + }, 20*time.Second, 200*time.Millisecond, "Newly created services should exists in database") + }) + t.Run("RuntimeUpdates", func(t *testing.T) { t.Parallel()