From 05c255a46823d772cda93e7019a5c18435397952 Mon Sep 17 00:00:00 2001 From: Anderson Queiroz Date: Thu, 14 Dec 2023 08:42:46 +0100 Subject: [PATCH] test upgrade action load --- internal/pkg/agent/storage/store/state_store_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/pkg/agent/storage/store/state_store_test.go b/internal/pkg/agent/storage/store/state_store_test.go index 0e969a7525..86f58a106c 100644 --- a/internal/pkg/agent/storage/store/state_store_test.go +++ b/internal/pkg/agent/storage/store/state_store_test.go @@ -12,6 +12,7 @@ import ( "time" "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/elastic/elastic-agent/internal/pkg/agent/storage" @@ -178,6 +179,10 @@ func runTestStateStore(t *testing.T, ackToken string) { require.Empty(t, store1.Actions()) require.Len(t, store1.Queue(), 2) + upgradeAction, ok := store1.Queue()[0].(*fleetapi.ActionUpgrade) + require.True(t, ok, "expected to be able to cast Action as upgradeAction") + assert.Equal(t, "1.2.3", upgradeAction.Version) + require.Equal(t, "test", store1.Queue()[0].ID()) scheduledAction, ok := store1.Queue()[0].(fleetapi.ScheduledAction) require.True(t, ok, "expected to be able to cast Action as ScheduledAction") -- 2.34.1