1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-20 11:00:25 +00:00

Keep track of events for SQL cache watches (#661)

* Keep track of past events

* Clarify RV acronym

* Fix comment typo

* Rename listEvents variables

* Improve filter readability

* Move defer
This commit is contained in:
Tom Lebreux
2025-06-05 16:40:19 -06:00
committed by GitHub
parent b0aa90cd22
commit b695567794
10 changed files with 377 additions and 39 deletions

View File

@@ -51,16 +51,18 @@ func TestList(t *testing.T) {
Schema: &schemas.Schema{},
}
partitions := make([]partition.Partition, 0)
uListToReturn := []unstructured.Unstructured{
{
Object: map[string]interface{}{
"kind": "apple",
"metadata": map[string]interface{}{
"name": "fuji",
"namespace": "fruitsnamespace",
},
"data": map[string]interface{}{
"color": "pink",
uListToReturn := &unstructured.UnstructuredList{
Items: []unstructured.Unstructured{
{
Object: map[string]interface{}{
"kind": "apple",
"metadata": map[string]interface{}{
"name": "fuji",
"namespace": "fruitsnamespace",
},
"data": map[string]interface{}{
"color": "pink",
},
},
},
},
@@ -88,7 +90,7 @@ func TestList(t *testing.T) {
}
p.EXPECT().All(req, schema, "list", "").Return(partitions, nil)
p.EXPECT().Store().Return(us)
us.EXPECT().ListByPartitions(req, schema, partitions).Return(uListToReturn, len(uListToReturn), "", nil)
us.EXPECT().ListByPartitions(req, schema, partitions).Return(uListToReturn, len(uListToReturn.Items), "", nil)
l, err := s.List(req, schema)
assert.Nil(t, err)
assert.Equal(t, expectedAPIObjList, l)