Plugins: Separate manager read/write components (#50313)

* separate manager read/write

* guarantee consistency in test
This commit is contained in:
Will Browne
2022-06-07 17:51:00 +02:00
committed by GitHub
parent aa74371008
commit f7cce28cdf
5 changed files with 15 additions and 3 deletions
@@ -3,6 +3,7 @@ package registry
import (
"context"
"fmt"
"sort"
"testing"
"github.com/stretchr/testify/require"
@@ -213,6 +214,11 @@ func TestInMemory_Plugins(t *testing.T) {
store: tt.mocks.store,
}
result := i.Plugins(context.Background())
// to ensure we can compare with expected
sort.SliceStable(result, func(i, j int) bool {
return result[i].ID < result[j].ID
})
require.Equal(t, tt.expected, result)
})
}