diff --git a/internal/db/backup_test.go b/internal/db/backup_test.go index 0d84a394d1..033f95bcd7 100644 --- a/internal/db/backup_test.go +++ b/internal/db/backup_test.go @@ -287,7 +287,7 @@ func TestBasicExport_WithMultipleCollectionsAndUpdate_NoError(t *testing.T) { require.NoError(t, err) expectedMap := map[string]any{} - data := []byte(`{"Book":[{"_docID":"bae-45c92e9c-4d31-5e96-8bd7-3d532734e117", "_docIDNew":"bae-3ca9a4c3-6240-5e86-a00f-9590d2f2ecf3", "author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f", "name":"John and the sourcerers' stone"}, {"_docID":"bae-8fc3d148-869b-5629-ae22-5423c73f709b", "_docIDNew":"bae-33c136bd-4375-54a0-81ff-54ca560c7bb8", "author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f", "name":"Game of chains"}], "User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d", "_docIDNew":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f", "age":31, "name":"John"}, {"_docID":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f", "_docIDNew":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f", "age":31, "name":"Bob"}]}`) + data := []byte(`{"Book":[{"_docID":"bae-4a28c746-ccbf-5511-91a9-391036f42f80", "_docIDNew":"bae-d821f684-47de-5b63-b9c7-6eccec368e52", "author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f", "name":"Game of chains"}, {"_docID":"bae-8c8be5c6-d26b-50d4-9378-2acd5fe6959d", "_docIDNew":"bae-c94e52f8-6e91-522c-b6a6-38346a06b3d2", "author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f", "name":"John and the sourcerers' stone"}], "User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d", "_docIDNew":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f", "age":31, "name":"John"}, {"_docID":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f", "_docIDNew":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f", "age":31, "name":"Bob"}]}`) err = json.Unmarshal(data, &expectedMap) require.NoError(t, err) require.EqualValues(t, expectedMap, fileMap) diff --git a/tests/integration/backup/one_to_many/export_test.go b/tests/integration/backup/one_to_many/export_test.go index 9126456149..ae81942b77 100644 --- a/tests/integration/backup/one_to_many/export_test.go +++ b/tests/integration/backup/one_to_many/export_test.go @@ -60,7 +60,7 @@ func TestBackupExport_AllCollectionsMultipleDocsAndDocUpdate_NoError(t *testing. Doc: `{"age": 31}`, }, testUtils.BackupExport{ - ExpectedContent: `{"User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","age":31,"name":"John"},{"_docID":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","_docIDNew":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","age":31,"name":"Bob"}],"Book":[{"_docID":"bae-45c92e9c-4d31-5e96-8bd7-3d532734e117","_docIDNew":"bae-3ca9a4c3-6240-5e86-a00f-9590d2f2ecf3","author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","name":"John and the sourcerers' stone"}]}`, + ExpectedContent: `{"User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","age":31,"name":"John"},{"_docID":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","_docIDNew":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","age":31,"name":"Bob"}],"Book":[{"_docID":"bae-8c8be5c6-d26b-50d4-9378-2acd5fe6959d","_docIDNew":"bae-c94e52f8-6e91-522c-b6a6-38346a06b3d2","author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","name":"John and the sourcerers' stone"}]}`, }, }, } @@ -99,7 +99,7 @@ func TestBackupExport_AllCollectionsMultipleDocsAndMultipleDocUpdate_NoError(t * Doc: `{"age": 31}`, }, testUtils.BackupExport{ - ExpectedContent: `{"User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","age":31,"name":"John"},{"_docID":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","_docIDNew":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","age":31,"name":"Bob"}],"Book":[{"_docID":"bae-45c92e9c-4d31-5e96-8bd7-3d532734e117","_docIDNew":"bae-3ca9a4c3-6240-5e86-a00f-9590d2f2ecf3","author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","name":"John and the sourcerers' stone"},{"_docID":"bae-8fc3d148-869b-5629-ae22-5423c73f709b","_docIDNew":"bae-33c136bd-4375-54a0-81ff-54ca560c7bb8","author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","name":"Game of chains"}]}`, + ExpectedContent: `{"User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","age":31,"name":"John"},{"_docID":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","_docIDNew":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","age":31,"name":"Bob"}],"Book":[{"_docID":"bae-4a28c746-ccbf-5511-91a9-391036f42f80","_docIDNew":"bae-d821f684-47de-5b63-b9c7-6eccec368e52","author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","name":"Game of chains"},{"_docID":"bae-8c8be5c6-d26b-50d4-9378-2acd5fe6959d","_docIDNew":"bae-c94e52f8-6e91-522c-b6a6-38346a06b3d2","author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","name":"John and the sourcerers' stone"}]}`, }, }, } diff --git a/tests/integration/backup/one_to_many/import_test.go b/tests/integration/backup/one_to_many/import_test.go index 2a48fb878f..39458f9869 100644 --- a/tests/integration/backup/one_to_many/import_test.go +++ b/tests/integration/backup/one_to_many/import_test.go @@ -88,14 +88,14 @@ func TestBackupImport_WithMultipleNoKeyAndMultipleCollectionsAndUpdatedDocs_NoEr ImportContent: `{ "Book":[ { - "_docID":"bae-8fc3d148-869b-5629-ae22-5423c73f709b", - "_docIDNew":"bae-33c136bd-4375-54a0-81ff-54ca560c7bb8", + "_docID":"bae-4a28c746-ccbf-5511-91a9-391036f42f80", + "_docIDNew":"bae-d821f684-47de-5b63-b9c7-6eccec368e52", "author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f", "name":"Game of chains" }, { - "_docID":"bae-45c92e9c-4d31-5e96-8bd7-3d532734e117", - "_docIDNew":"bae-3ca9a4c3-6240-5e86-a00f-9590d2f2ecf3", + "_docID":"bae-8c8be5c6-d26b-50d4-9378-2acd5fe6959d", + "_docIDNew":"bae-c94e52f8-6e91-522c-b6a6-38346a06b3d2", "author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f", "name":"John and the sourcerers' stone" } @@ -150,13 +150,13 @@ func TestBackupImport_WithMultipleNoKeyAndMultipleCollectionsAndUpdatedDocs_NoEr Results: map[string]any{ "Book": []map[string]any{ { - "name": "Game of chains", + "name": "John and the sourcerers' stone", "author": map[string]any{ "_docID": "bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f", }, }, { - "name": "John and the sourcerers' stone", + "name": "Game of chains", "author": map[string]any{ "_docID": "bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f", }, diff --git a/tests/integration/backup/one_to_one/export_test.go b/tests/integration/backup/one_to_one/export_test.go index fb63d52208..f765d634a9 100644 --- a/tests/integration/backup/one_to_one/export_test.go +++ b/tests/integration/backup/one_to_one/export_test.go @@ -60,7 +60,7 @@ func TestBackupExport_AllCollectionsMultipleDocsAndDocUpdate_NoError(t *testing. Doc: `{"age": 31}`, }, testUtils.BackupExport{ - ExpectedContent: `{"User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","age":31,"name":"John"},{"_docID":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","_docIDNew":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","age":31,"name":"Bob"}],"Book":[{"_docID":"bae-f33a7110-fb6f-57aa-9501-df0111427315","_docIDNew":"bae-c9c1a385-afce-5ef7-8b98-9369b157fd97","author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","name":"John and the sourcerers' stone"}]}`, + ExpectedContent: `{"User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","age":31,"name":"John"},{"_docID":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","_docIDNew":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","age":31,"name":"Bob"}],"Book":[{"_docID":"bae-af59fdc4-e495-5fd3-a9a6-386249aafdbb","_docIDNew":"bae-d374c406-c6ea-51cd-9e9b-dd44a97b499c","author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","name":"John and the sourcerers' stone"}]}`, }, }, } @@ -108,7 +108,7 @@ func TestBackupExport_DoubleReletionship_NoError(t *testing.T) { Doc: `{"age": 31}`, }, testUtils.BackupExport{ - ExpectedContent: `{"User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","age":31,"name":"John"},{"_docID":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","_docIDNew":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","age":31,"name":"Bob"}],"Book":[{"_docID":"bae-ccf9da82-8ed6-5133-b64f-558c21bc8dfd","_docIDNew":"bae-27ae099a-fa7d-5a66-a919-6c3b0322d17c","author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","favourite_id":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","name":"John and the sourcerers' stone"}]}`, + ExpectedContent: `{"User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","age":31,"name":"John"},{"_docID":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","_docIDNew":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","age":31,"name":"Bob"}],"Book":[{"_docID":"bae-bddb7139-7035-5fff-a118-3fc2033723b3","_docIDNew":"bae-6972e51f-a8cd-59eb-9a34-8a37058ddf4e","author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","favourite_id":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","name":"John and the sourcerers' stone"}]}`, }, }, } @@ -160,7 +160,7 @@ func TestBackupExport_DoubleReletionshipWithUpdate_NoError(t *testing.T) { Doc: `{"age": 31}`, }, testUtils.BackupExport{ - ExpectedContent: `{"User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","age":31,"name":"John"},{"_docID":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","_docIDNew":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","age":31,"name":"Bob"}],"Book":[{"_docID":"bae-ccf9da82-8ed6-5133-b64f-558c21bc8dfd","_docIDNew":"bae-27ae099a-fa7d-5a66-a919-6c3b0322d17c","author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","favourite_id":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","name":"John and the sourcerers' stone"},{"_docID":"bae-ffba7007-d4d4-5630-be53-d66f56da57fd","_docIDNew":"bae-ffba7007-d4d4-5630-be53-d66f56da57fd","name":"Game of chains"}]}`, + ExpectedContent: `{"User":[{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","age":31,"name":"John"},{"_docID":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","_docIDNew":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","age":31,"name":"Bob"}],"Book":[{"_docID":"bae-0aa10275-4f6e-5b38-9915-5664dd4c7802","_docIDNew":"bae-0aa10275-4f6e-5b38-9915-5664dd4c7802","name":"Game of chains"},{"_docID":"bae-bddb7139-7035-5fff-a118-3fc2033723b3","_docIDNew":"bae-6972e51f-a8cd-59eb-9a34-8a37058ddf4e","author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","favourite_id":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","name":"John and the sourcerers' stone"}]}`, }, }, } diff --git a/tests/integration/backup/one_to_one/import_test.go b/tests/integration/backup/one_to_one/import_test.go index 15bdad354b..41f1f4d47d 100644 --- a/tests/integration/backup/one_to_one/import_test.go +++ b/tests/integration/backup/one_to_one/import_test.go @@ -67,10 +67,10 @@ func TestBackupImport_WithMultipleNoKeyAndMultipleCollections_NoError(t *testing Results: map[string]any{ "Book": []map[string]any{ { - "name": "Game of chains", + "name": "John and the sourcerers' stone", }, { - "name": "John and the sourcerers' stone", + "name": "Game of chains", }, }, }, @@ -88,8 +88,8 @@ func TestBackupImport_WithMultipleNoKeyAndMultipleCollectionsAndUpdatedDocs_NoEr ImportContent: `{ "Book":[ { - "_docID":"bae-f33a7110-fb6f-57aa-9501-df0111427315", - "_docIDNew":"bae-c9c1a385-afce-5ef7-8b98-9369b157fd97", + "_docID":"bae-af59fdc4-e495-5fd3-a9a6-386249aafdbb", + "_docIDNew":"bae-d374c406-c6ea-51cd-9e9b-dd44a97b499c", "author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f", "name":"John and the sourcerers' stone" } @@ -171,8 +171,8 @@ func TestBackupImport_WithMultipleNoKeyAndMultipleCollectionsAndMultipleUpdatedD "name":"Game of chains" }, { - "_docID":"bae-f33a7110-fb6f-57aa-9501-df0111427315", - "_docIDNew":"bae-c9c1a385-afce-5ef7-8b98-9369b157fd97", + "_docID":"bae-af59fdc4-e495-5fd3-a9a6-386249aafdbb", + "_docIDNew":"bae-d374c406-c6ea-51cd-9e9b-dd44a97b499c", "author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f", "name":"John and the sourcerers' stone" } @@ -219,7 +219,7 @@ func TestBackupImport_DoubleRelationshipWithUpdate_NoError(t *testing.T) { `, }, testUtils.BackupImport{ - ImportContent: `{"Book":[{"_docID":"bae-236c14bd-4621-5d43-bc03-4442f3b8719e","_docIDNew":"bae-6dbb3738-d3db-5121-acee-6fbdd97ff7a8","author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","favourite_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","name":"John and the sourcerers' stone"},{"_docID":"bae-ffba7007-d4d4-5630-be53-d66f56da57fd","_docIDNew":"bae-ffba7007-d4d4-5630-be53-d66f56da57fd","name":"Game of chains"}],"User":[{"_docID":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","_docIDNew":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","age":31,"name":"Bob"},{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","age":31,"name":"John"}]}`, + ImportContent: `{"Book":[{"_docID":"bae-236c14bd-4621-5d43-bc03-4442f3b8719e","_docIDNew":"bae-6dbb3738-d3db-5121-acee-6fbdd97ff7a8","author_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","favourite_id":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","name":"John and the sourcerers' stone"},{"_docID":"bae-0aa10275-4f6e-5b38-9915-5664dd4c7802","_docIDNew":"bae-0aa10275-4f6e-5b38-9915-5664dd4c7802","name":"Game of chains"}],"User":[{"_docID":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","_docIDNew":"bae-ebfe11e2-045d-525d-9fb7-2abb961dc84f","age":31,"name":"Bob"},{"_docID":"bae-7fca96a2-5f01-5558-a81f-09b47587f26d","_docIDNew":"bae-9918e1ec-c62b-5de2-8fbf-c82795b8ac7f","age":31,"name":"John"}]}`, }, testUtils.Request{ Request: ` @@ -236,6 +236,10 @@ func TestBackupImport_DoubleRelationshipWithUpdate_NoError(t *testing.T) { }`, Results: map[string]any{ "Book": []map[string]any{ + { + "name": "Game of chains", + "author": nil, + }, { "name": "John and the sourcerers' stone", "author": map[string]any{ @@ -245,10 +249,6 @@ func TestBackupImport_DoubleRelationshipWithUpdate_NoError(t *testing.T) { }, }, }, - { - "name": "Game of chains", - "author": nil, - }, }, }, }, diff --git a/tests/integration/backup/self_reference/export_test.go b/tests/integration/backup/self_reference/export_test.go index b31216a1ad..8736c73660 100644 --- a/tests/integration/backup/self_reference/export_test.go +++ b/tests/integration/backup/self_reference/export_test.go @@ -26,13 +26,13 @@ func TestBackupExport_Simple_NoError(t *testing.T) { }, testUtils.CreateDoc{ CollectionID: 0, - Doc: `{"name": "Bob", "age": 31, "boss": "bae-a2162ff0-3257-50f1-ba2f-39c299921220"}`, + Doc: `{"name": "Bob", "age": 31, "boss": "bae-8096e3d7-41ab-5afe-ad88-481150483db1"}`, }, testUtils.BackupExport{ Config: client.BackupConfig{ Collections: []string{"User"}, }, - ExpectedContent: `{"User":[{"_docID":"bae-a2162ff0-3257-50f1-ba2f-39c299921220","_docIDNew":"bae-a2162ff0-3257-50f1-ba2f-39c299921220","age":30,"name":"John"},{"_docID":"bae-f4def2b3-2fe8-5e3b-838e-b9d9f8aca102","_docIDNew":"bae-f4def2b3-2fe8-5e3b-838e-b9d9f8aca102","age":31,"boss_id":"bae-a2162ff0-3257-50f1-ba2f-39c299921220","name":"Bob"}]}`, + ExpectedContent: `{"User":[{"_docID":"bae-0dfbaf9f-3c58-5133-aa07-a9f25d792f4e","_docIDNew":"bae-0dfbaf9f-3c58-5133-aa07-a9f25d792f4e","age":31,"boss_id":"bae-8096e3d7-41ab-5afe-ad88-481150483db1","name":"Bob"},{"_docID":"bae-8096e3d7-41ab-5afe-ad88-481150483db1","_docIDNew":"bae-8096e3d7-41ab-5afe-ad88-481150483db1","age":30,"name":"John"}]}`, }, }, } @@ -49,7 +49,7 @@ func TestBackupExport_MultipleDocsAndDocUpdate_NoError(t *testing.T) { }, testUtils.CreateDoc{ CollectionID: 0, - Doc: `{"name": "Bob", "age": 31, "boss": "bae-a2162ff0-3257-50f1-ba2f-39c299921220"}`, + Doc: `{"name": "Bob", "age": 31, "boss": "bae-8096e3d7-41ab-5afe-ad88-481150483db1"}`, }, testUtils.UpdateDoc{ CollectionID: 0, @@ -57,7 +57,7 @@ func TestBackupExport_MultipleDocsAndDocUpdate_NoError(t *testing.T) { Doc: `{"age": 31}`, }, testUtils.BackupExport{ - ExpectedContent: `{"User":[{"_docID":"bae-a2162ff0-3257-50f1-ba2f-39c299921220","_docIDNew":"bae-99fbc678-167f-5325-bdf1-79fa76039125","age":31,"name":"John"},{"_docID":"bae-f4def2b3-2fe8-5e3b-838e-b9d9f8aca102","_docIDNew":"bae-98531af8-dda5-5993-b140-1495fa8f1576","age":31,"boss_id":"bae-99fbc678-167f-5325-bdf1-79fa76039125","name":"Bob"}]}`, + ExpectedContent: `{"User":[{"_docID":"bae-0dfbaf9f-3c58-5133-aa07-a9f25d792f4e","_docIDNew":"bae-f3c5fc81-300f-5dd7-aeb3-20dd15883930","age":31,"boss_id":"bae-e4423c73-b867-511b-a5f1-565bd87d9c53","name":"Bob"},{"_docID":"bae-8096e3d7-41ab-5afe-ad88-481150483db1","_docIDNew":"bae-e4423c73-b867-511b-a5f1-565bd87d9c53","age":31,"name":"John"}]}`, }, }, } diff --git a/tests/integration/backup/self_reference/import_test.go b/tests/integration/backup/self_reference/import_test.go index 1d0b39d2e7..712b191b00 100644 --- a/tests/integration/backup/self_reference/import_test.go +++ b/tests/integration/backup/self_reference/import_test.go @@ -25,13 +25,13 @@ func TestBackupSelfRefImport_Simple_NoError(t *testing.T) { ImportContent: `{ "User":[ { - "_docID":"bae-f4def2b3-2fe8-5e3b-838e-b9d9f8aca102", + "_docID":"bae-0dfbaf9f-3c58-5133-aa07-a9f25d792f4e", "age":31, - "boss_id":"bae-a2162ff0-3257-50f1-ba2f-39c299921220", + "boss_id":"bae-8096e3d7-41ab-5afe-ad88-481150483db1", "name":"Bob" }, { - "_docID":"bae-a2162ff0-3257-50f1-ba2f-39c299921220", + "_docID":"bae-8096e3d7-41ab-5afe-ad88-481150483db1", "age":30, "name":"John" } @@ -50,16 +50,16 @@ func TestBackupSelfRefImport_Simple_NoError(t *testing.T) { }`, Results: map[string]any{ "User": []map[string]any{ - { - "name": "John", - "boss": nil, - }, { "name": "Bob", "boss": map[string]any{ "name": "John", }, }, + { + "name": "John", + "boss": nil, + }, }, }, }, @@ -73,10 +73,10 @@ func TestBackupSelfRefImport_SelfRef_NoError(t *testing.T) { expectedExportData := `{` + `"User":[` + `{` + - `"_docID":"bae-20631b3d-1498-51f1-be29-5c0effbfa646",` + - `"_docIDNew":"bae-20631b3d-1498-51f1-be29-5c0effbfa646",` + + `"_docID":"bae-b9449db8-3894-5701-84ce-ee96a3eafc9c",` + + `"_docIDNew":"bae-b9449db8-3894-5701-84ce-ee96a3eafc9c",` + `"age":31,` + - `"boss_id":"bae-20631b3d-1498-51f1-be29-5c0effbfa646",` + + `"boss_id":"bae-b9449db8-3894-5701-84ce-ee96a3eafc9c",` + `"name":"Bob"` + `}` + `]` + @@ -100,7 +100,7 @@ func TestBackupSelfRefImport_SelfRef_NoError(t *testing.T) { testUtils.UpdateDoc{ NodeID: immutable.Some(0), Doc: `{ - "boss_id": "bae-20631b3d-1498-51f1-be29-5c0effbfa646" + "boss_id": "bae-b9449db8-3894-5701-84ce-ee96a3eafc9c" }`, }, testUtils.BackupExport{ @@ -277,18 +277,18 @@ func TestBackupSelfRefImport_SplitPrimaryRelationWithSecondCollection_NoError(t expectedExportData := `{` + `"Author":[` + `{` + - `"_docID":"bae-069af8c0-9728-5dde-84ff-ab2dd836f165",` + - `"_docIDNew":"bae-f2e84aeb-decc-5e40-94ff-e365f0ed0f4b",` + - `"book_id":"bae-006376a9-5ceb-5bd0-bfed-6ff5afd3eb93",` + + `"_docID":"bae-bf1f16db-3c02-5759-8127-7d73346442cc",` + + `"_docIDNew":"bae-bf1f16db-3c02-5759-8127-7d73346442cc",` + + `"book_id":"bae-89136f56-3779-5656-b8a6-f76a1c262f37",` + `"name":"John"` + `}` + `],` + `"Book":[` + `{` + - `"_docID":"bae-2b931633-22bf-576f-b788-d8098b213e5a",` + - `"_docIDNew":"bae-c821a0a9-7afc-583b-accb-dc99a09c1ff8",` + + `"_docID":"bae-89136f56-3779-5656-b8a6-f76a1c262f37",` + + `"_docIDNew":"bae-66b0f769-c743-5a50-ae6d-1dcd978e2404",` + `"name":"John and the sourcerers' stone",` + - `"reviewedBy_id":"bae-069af8c0-9728-5dde-84ff-ab2dd836f165"` + + `"reviewedBy_id":"bae-bf1f16db-3c02-5759-8127-7d73346442cc"` + `}` + `]` + `}` @@ -316,7 +316,7 @@ func TestBackupSelfRefImport_SplitPrimaryRelationWithSecondCollection_NoError(t testUtils.CreateDoc{ NodeID: immutable.Some(0), CollectionID: 1, - // bae-2b931633-22bf-576f-b788-d8098b213e5a + // bae-89136f56-3779-5656-b8a6-f76a1c262f37 Doc: `{ "name": "John and the sourcerers' stone" }`, @@ -326,7 +326,7 @@ func TestBackupSelfRefImport_SplitPrimaryRelationWithSecondCollection_NoError(t CollectionID: 0, Doc: `{ "name": "John", - "book": "bae-2b931633-22bf-576f-b788-d8098b213e5a" + "book": "bae-89136f56-3779-5656-b8a6-f76a1c262f37" }`, }, testUtils.UpdateDoc{ @@ -334,7 +334,7 @@ func TestBackupSelfRefImport_SplitPrimaryRelationWithSecondCollection_NoError(t CollectionID: 1, DocID: 0, Doc: `{ - "reviewedBy_id": "bae-069af8c0-9728-5dde-84ff-ab2dd836f165" + "reviewedBy_id": "bae-bf1f16db-3c02-5759-8127-7d73346442cc" }`, }, /* @@ -366,11 +366,8 @@ func TestBackupSelfRefImport_SplitPrimaryRelationWithSecondCollection_NoError(t Results: map[string]any{ "Book": []map[string]any{ { - "name": "John and the sourcerers' stone", - "author": map[string]any{ - "name": "John", - "reviewed": nil, - }, + "name": "John and the sourcerers' stone", + "author": nil, }, }, }, diff --git a/tests/integration/encryption/commit_relation_test.go b/tests/integration/encryption/commit_relation_test.go index 7097c0fb56..b75d42580e 100644 --- a/tests/integration/encryption/commit_relation_test.go +++ b/tests/integration/encryption/commit_relation_test.go @@ -18,7 +18,7 @@ import ( func TestDocEncryption_WithEncryptionSecondaryRelations_ShouldStoreEncryptedCommit(t *testing.T) { const userDocID = "bae-4d563681-e131-5e01-8ab4-6c65ac0d0478" - const deviceDocID = "bae-50211587-fde7-5d75-8034-e7040dfba203" + const deviceDocID = "bae-29ab9ee8-80cb-53eb-a467-f96a170f4cb7" test := testUtils.TestCase{ Actions: []any{ @@ -64,16 +64,6 @@ func TestDocEncryption_WithEncryptionSecondaryRelations_ShouldStoreEncryptedComm `, Results: map[string]any{ "commits": []map[string]any{ - { - "delta": encrypt(testUtils.CBORValue("Chris"), userDocID, ""), - "docID": userDocID, - "fieldName": "name", - }, - { - "delta": nil, - "docID": userDocID, - "fieldName": nil, - }, { "delta": encrypt(testUtils.CBORValue("Sony"), deviceDocID, ""), "docID": deviceDocID, @@ -94,6 +84,16 @@ func TestDocEncryption_WithEncryptionSecondaryRelations_ShouldStoreEncryptedComm "docID": deviceDocID, "fieldName": nil, }, + { + "delta": encrypt(testUtils.CBORValue("Chris"), userDocID, ""), + "docID": userDocID, + "fieldName": "name", + }, + { + "delta": nil, + "docID": userDocID, + "fieldName": nil, + }, }, }, }, diff --git a/tests/integration/explain/execute/dagscan_test.go b/tests/integration/explain/execute/dagscan_test.go index 8093accba4..4860051439 100644 --- a/tests/integration/explain/execute/dagscan_test.go +++ b/tests/integration/explain/execute/dagscan_test.go @@ -25,12 +25,13 @@ func TestExecuteExplainCommitsDagScan(t *testing.T) { Actions: []any{ explainUtils.SchemaForExplainTests, - // Authors + create2AddressDocuments(), + create2AuthorContactDocuments(), create2AuthorDocuments(), testUtils.ExplainRequest{ Request: `query @explain(type: execute) { - commits (docID: "bae-dcdbc1dc-8428-592d-ad9d-ca0f1430e1bf") { + commits (docID: "bae-333455ca-1563-54c3-85a4-1db7ea4e9c59") { links { cid } @@ -72,12 +73,13 @@ func TestExecuteExplainLatestCommitsDagScan(t *testing.T) { Actions: []any{ explainUtils.SchemaForExplainTests, - // Author + create2AddressDocuments(), + create2AuthorContactDocuments(), create2AuthorDocuments(), testUtils.ExplainRequest{ Request: `query @explain(type: execute) { - latestCommits(docID: "bae-dcdbc1dc-8428-592d-ad9d-ca0f1430e1bf") { + latestCommits(docID: "bae-333455ca-1563-54c3-85a4-1db7ea4e9c59") { cid links { cid diff --git a/tests/integration/explain/execute/delete_test.go b/tests/integration/explain/execute/delete_test.go index 2d29f3a276..e80189fd8a 100644 --- a/tests/integration/explain/execute/delete_test.go +++ b/tests/integration/explain/execute/delete_test.go @@ -76,7 +76,8 @@ func TestExecuteExplainMutationRequestWithDeleteUsingFilter(t *testing.T) { Actions: []any{ explainUtils.SchemaForExplainTests, - // Author + create2AddressDocuments(), + create2AuthorContactDocuments(), create2AuthorDocuments(), testUtils.ExplainRequest{ diff --git a/tests/integration/explain/execute/fixture.go b/tests/integration/explain/execute/fixture.go index 17a172552f..0592352de0 100644 --- a/tests/integration/explain/execute/fixture.go +++ b/tests/integration/explain/execute/fixture.go @@ -80,23 +80,21 @@ func create2AuthorDocuments() []testUtils.CreateDoc { return []testUtils.CreateDoc{ { CollectionID: 2, - // _docID: "bae-7f54d9e0-cbde-5320-aa6c-5c8895a89138" - Doc: `{ - "name": "John Grisham", - "age": 65, - "verified": true, - "contact_id": "bae-819c9c03-9d49-5fd5-aaee-0dc5a70bbe44" - }`, + DocMap: map[string]any{ + "name": "John Grisham", + "age": 65, + "verified": true, + "contact_id": testUtils.NewDocIndex(3, 0), + }, }, { CollectionID: 2, - // _docID: "bae-68cb395d-df73-5bcb-b623-615a140dee12" - Doc: `{ - "name": "Cornelia Funke", - "age": 62, - "verified": false, - "contact_id": "bae-9bf0272a-c521-5bef-a7ba-642e8be6e433" - }`, + DocMap: map[string]any{ + "name": "Cornelia Funke", + "age": 62, + "verified": false, + "contact_id": testUtils.NewDocIndex(3, 1), + }, }, } } @@ -105,23 +103,19 @@ func create2AuthorContactDocuments() []testUtils.CreateDoc { return []testUtils.CreateDoc{ { CollectionID: 3, - // "author_id": "bae-7f54d9e0-cbde-5320-aa6c-5c8895a89138" - // _docID: "bae-819c9c03-9d49-5fd5-aaee-0dc5a70bbe44" - Doc: `{ - "cell": "5197212301", - "email": "john_grisham@example.com", - "address_id": "bae-14f20db7-3654-58de-9156-596ef2cfd790" - }`, + DocMap: map[string]any{ + "cell": "5197212301", + "email": "john_grisham@example.com", + "address_id": testUtils.NewDocIndex(4, 0), + }, }, { CollectionID: 3, - // "author_id": "bae-68cb395d-df73-5bcb-b623-615a140dee12", - // _docID: "bae-9bf0272a-c521-5bef-a7ba-642e8be6e433" - Doc: `{ - "cell": "5197212302", - "email": "cornelia_funke@example.com", - "address_id": "bae-49f715e7-7f01-5509-a213-ed98cb81583f" - }`, + DocMap: map[string]any{ + "cell": "5197212302", + "email": "cornelia_funke@example.com", + "address_id": testUtils.NewDocIndex(4, 1), + }, }, } } diff --git a/tests/integration/explain/execute/type_join_test.go b/tests/integration/explain/execute/type_join_test.go index 60f717a84f..511c3498a9 100644 --- a/tests/integration/explain/execute/type_join_test.go +++ b/tests/integration/explain/execute/type_join_test.go @@ -25,11 +25,9 @@ func TestExecuteExplainRequestWithAOneToOneJoin(t *testing.T) { Actions: []any{ explainUtils.SchemaForExplainTests, - // Authors - create2AuthorDocuments(), - - // Contacts + create2AddressDocuments(), create2AuthorContactDocuments(), + create2AuthorDocuments(), testUtils.ExplainRequest{ Request: `query @explain(type: execute) { @@ -87,11 +85,9 @@ func TestExecuteExplainWithMultipleOneToOneJoins(t *testing.T) { Actions: []any{ explainUtils.SchemaForExplainTests, - // Authors - create2AuthorDocuments(), - - // Contacts + create2AddressDocuments(), create2AuthorContactDocuments(), + create2AuthorDocuments(), testUtils.ExplainRequest{ Request: `query @explain(type: execute) { diff --git a/tests/integration/explain/execute/with_average_test.go b/tests/integration/explain/execute/with_average_test.go index 1c81ce5021..fdadf6fcaa 100644 --- a/tests/integration/explain/execute/with_average_test.go +++ b/tests/integration/explain/execute/with_average_test.go @@ -24,6 +24,9 @@ func TestExecuteExplainAverageRequestOnArrayField(t *testing.T) { Actions: []any{ explainUtils.SchemaForExplainTests, + + create2AddressDocuments(), + create2AuthorContactDocuments(), create2AuthorDocuments(), create3BookDocuments(), @@ -81,6 +84,9 @@ func TestExplainExplainAverageRequestOnJoinedField(t *testing.T) { Actions: []any{ explainUtils.SchemaForExplainTests, + + create2AddressDocuments(), + create2AuthorContactDocuments(), create2AuthorDocuments(), create3BookDocuments(), diff --git a/tests/integration/explain/execute/with_count_test.go b/tests/integration/explain/execute/with_count_test.go index 81dafce0d9..190a685592 100644 --- a/tests/integration/explain/execute/with_count_test.go +++ b/tests/integration/explain/execute/with_count_test.go @@ -25,6 +25,8 @@ func TestExecuteExplainRequestWithCountOnOneToManyRelation(t *testing.T) { Actions: []any{ explainUtils.SchemaForExplainTests, + create2AddressDocuments(), + create2AuthorContactDocuments(), create2AuthorDocuments(), create3BookDocuments(), diff --git a/tests/integration/explain/execute/with_limit_test.go b/tests/integration/explain/execute/with_limit_test.go index 1f40902525..6a930067df 100644 --- a/tests/integration/explain/execute/with_limit_test.go +++ b/tests/integration/explain/execute/with_limit_test.go @@ -24,6 +24,9 @@ func TestExecuteExplainRequestWithBothLimitAndOffsetOnParent(t *testing.T) { Actions: []any{ explainUtils.SchemaForExplainTests, + + create2AddressDocuments(), + create2AuthorContactDocuments(), create2AuthorDocuments(), create3BookDocuments(), @@ -75,6 +78,8 @@ func TestExecuteExplainRequestWithBothLimitAndOffsetOnParentAndLimitOnChild(t *t Actions: []any{ explainUtils.SchemaForExplainTests, + create2AddressDocuments(), + create2AuthorContactDocuments(), create2AuthorDocuments(), create3ArticleDocuments(), diff --git a/tests/integration/explain/execute/with_order_test.go b/tests/integration/explain/execute/with_order_test.go index 8b27cdbf04..55f0745928 100644 --- a/tests/integration/explain/execute/with_order_test.go +++ b/tests/integration/explain/execute/with_order_test.go @@ -25,7 +25,8 @@ func TestExecuteExplainRequestWithOrderFieldOnParent(t *testing.T) { Actions: []any{ explainUtils.SchemaForExplainTests, - // Authors + create2AddressDocuments(), + create2AuthorContactDocuments(), create2AuthorDocuments(), testUtils.ExplainRequest{ @@ -163,6 +164,8 @@ func TestExecuteExplainRequestWithOrderFieldOnChild(t *testing.T) { Actions: []any{ explainUtils.SchemaForExplainTests, + create2AddressDocuments(), + create2AuthorContactDocuments(), create2AuthorDocuments(), create3ArticleDocuments(), @@ -223,6 +226,8 @@ func TestExecuteExplainRequestWithOrderFieldOnBothParentAndChild(t *testing.T) { Actions: []any{ explainUtils.SchemaForExplainTests, + create2AddressDocuments(), + create2AuthorContactDocuments(), create2AuthorDocuments(), create3ArticleDocuments(), @@ -287,6 +292,8 @@ func TestExecuteExplainRequestWhereParentFieldIsOrderedByChildField(t *testing.T Actions: []any{ explainUtils.SchemaForExplainTests, + create2AddressDocuments(), + create2AuthorContactDocuments(), create2AuthorDocuments(), create3ArticleDocuments(), diff --git a/tests/integration/explain/execute/with_sum_test.go b/tests/integration/explain/execute/with_sum_test.go index dbc6b3761f..23dc85ce38 100644 --- a/tests/integration/explain/execute/with_sum_test.go +++ b/tests/integration/explain/execute/with_sum_test.go @@ -24,6 +24,9 @@ func TestExecuteExplainRequestWithSumOfInlineArrayField(t *testing.T) { Actions: []any{ explainUtils.SchemaForExplainTests, + + create2AddressDocuments(), + create2AuthorContactDocuments(), create2AuthorDocuments(), create3BookDocuments(), @@ -75,6 +78,8 @@ func TestExecuteExplainRequestSumOfRelatedOneToManyField(t *testing.T) { Actions: []any{ explainUtils.SchemaForExplainTests, + create2AddressDocuments(), + create2AuthorContactDocuments(), create2AuthorDocuments(), create3ArticleDocuments(), diff --git a/tests/integration/index/query_with_compound_filter_relation_test.go b/tests/integration/index/query_with_compound_filter_relation_test.go index 4708bb2c2a..98a57b6889 100644 --- a/tests/integration/index/query_with_compound_filter_relation_test.go +++ b/tests/integration/index/query_with_compound_filter_relation_test.go @@ -196,10 +196,10 @@ func TestIndex_QueryWithIndexOnOneToManyRelationAndFilter_Data(t *testing.T) { Results: map[string]any{ "Program": []map[string]any{ { - "name": "LensVM", + "name": "DefraDB", }, { - "name": "DefraDB", + "name": "LensVM", }, }, }, @@ -280,13 +280,13 @@ func TestIndex_QueryWithIndexOnOneToManyRelationOrFilter_Data(t *testing.T) { Results: map[string]any{ "Program": []map[string]any{ { - "name": "Zanzi", + "name": "DefraDB", }, { "name": "LensVM", }, { - "name": "DefraDB", + "name": "Zanzi", }, }, }, diff --git a/tests/integration/index/query_with_relation_filter_test.go b/tests/integration/index/query_with_relation_filter_test.go index c9798903b3..9428626810 100644 --- a/tests/integration/index/query_with_relation_filter_test.go +++ b/tests/integration/index/query_with_relation_filter_test.go @@ -56,8 +56,8 @@ func TestQueryWithIndexOnOneToManyRelation_IfFilterOnIndexedRelation_ShouldFilte Request: req1, Results: map[string]any{ "User": []map[string]any{ - {"name": "Islam"}, {"name": "Shahzad"}, + {"name": "Islam"}, {"name": "Keenan"}, }, }, @@ -124,8 +124,8 @@ func TestQueryWithIndexOnOneToManyRelation_IfFilterOnIndexedRelation_ShouldFilte Request: req1, Results: map[string]any{ "User": []map[string]any{ - {"name": "Islam"}, {"name": "Shahzad"}, + {"name": "Islam"}, {"name": "Keenan"}, }, }, @@ -204,8 +204,8 @@ func TestQueryWithIndexOnOneToOnesSecondaryRelation_IfFilterOnIndexedRelation_Sh Request: req2, Results: map[string]any{ "User": []map[string]any{ - {"name": "Shahzad"}, {"name": "John"}, + {"name": "Shahzad"}, {"name": "Fred"}, }, }, @@ -490,11 +490,11 @@ func TestQueryWithIndexOnOneToMany_IfFilterOnIndexedRelation_ShouldFilter(t *tes "devices": []map[string]any{ { "model": "Walkman", - "manufacturer": "The Proclaimers", + "manufacturer": "Sony", }, { "model": "Walkman", - "manufacturer": "Sony", + "manufacturer": "The Proclaimers", }, // The filter is on User, so all devices belonging to it will be returned { @@ -580,11 +580,11 @@ func TestQueryWithIndexOnOneToMany_IfFilterOnIndexedRelation_ShouldFilterWithExp "devices": []map[string]any{ { "model": "Walkman", - "manufacturer": "The Proclaimers", + "manufacturer": "Sony", }, { "model": "Walkman", - "manufacturer": "Sony", + "manufacturer": "The Proclaimers", }, { "model": "Running Man", diff --git a/tests/integration/mutation/create/field_kinds/one_to_many/with_alias_test.go b/tests/integration/mutation/create/field_kinds/one_to_many/with_alias_test.go index 6fedc0c8c2..fe66f58d98 100644 --- a/tests/integration/mutation/create/field_kinds/one_to_many/with_alias_test.go +++ b/tests/integration/mutation/create/field_kinds/one_to_many/with_alias_test.go @@ -191,7 +191,7 @@ func TestMutationCreateOneToMany_AliasedRelationNameToLinkFromManySide(t *testin func TestMutationUpdateOneToMany_AliasRelationNameAndInternalIDBothProduceSameDocID(t *testing.T) { // These IDs MUST be shared by both tests below. - bookID := "bae-e4888569-d423-58b7-94c5-5886e3cffe22" + bookID := "bae-1d943ec7-1701-5910-a467-7d863beada5d" nonAliasedTest := testUtils.TestCase{ Description: "One to many update mutation using relation alias name from single side (wrong)", diff --git a/tests/integration/mutation/create/field_kinds/one_to_one_to_one/with_txn_test.go b/tests/integration/mutation/create/field_kinds/one_to_one_to_one/with_txn_test.go index f626483375..dcbee56e37 100644 --- a/tests/integration/mutation/create/field_kinds/one_to_one_to_one/with_txn_test.go +++ b/tests/integration/mutation/create/field_kinds/one_to_one_to_one/with_txn_test.go @@ -49,7 +49,7 @@ func TestTransactionalCreationAndLinkingOfRelationalDocumentsForward(t *testing. Results: map[string]any{ "create_Book": []map[string]any{ { - "_docID": "bae-e7943028-5c74-5fd4-9661-0a233edcd287", + "_docID": "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87", }, }, }, @@ -64,7 +64,7 @@ func TestTransactionalCreationAndLinkingOfRelationalDocumentsForward(t *testing. Results: map[string]any{ "create_Book": []map[string]any{ { - "_docID": "bae-7f6a5a76-b90d-5715-a452-708ded9e7ae7", + "_docID": "bae-787391fb-86f8-5cbe-8fc2-ad59f90e267a", }, }, }, @@ -88,7 +88,7 @@ func TestTransactionalCreationAndLinkingOfRelationalDocumentsForward(t *testing. "_docID": "bae-07fd000a-d023-54b9-b8f3-a4318fac8fed", "name": "Website", "published": map[string]any{ - "_docID": "bae-e7943028-5c74-5fd4-9661-0a233edcd287", + "_docID": "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87", "name": "Book By Website", }, }, @@ -125,7 +125,7 @@ func TestTransactionalCreationAndLinkingOfRelationalDocumentsForward(t *testing. "_docID": "bae-21084f46-b12a-53ab-94dd-04d075b4218c", "name": "Online", "published": map[string]any{ - "_docID": "bae-7f6a5a76-b90d-5715-a452-708ded9e7ae7", + "_docID": "bae-787391fb-86f8-5cbe-8fc2-ad59f90e267a", "name": "Book By Online", }, }, @@ -154,19 +154,19 @@ func TestTransactionalCreationAndLinkingOfRelationalDocumentsForward(t *testing. Results: map[string]any{ "Book": []map[string]any{ { - "_docID": "bae-7f6a5a76-b90d-5715-a452-708ded9e7ae7", - "name": "Book By Online", + "_docID": "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87", + "name": "Book By Website", "publisher": map[string]any{ - "_docID": "bae-21084f46-b12a-53ab-94dd-04d075b4218c", - "name": "Online", + "_docID": "bae-07fd000a-d023-54b9-b8f3-a4318fac8fed", + "name": "Website", }, }, { - "_docID": "bae-e7943028-5c74-5fd4-9661-0a233edcd287", - "name": "Book By Website", + "_docID": "bae-787391fb-86f8-5cbe-8fc2-ad59f90e267a", + "name": "Book By Online", "publisher": map[string]any{ - "_docID": "bae-07fd000a-d023-54b9-b8f3-a4318fac8fed", - "name": "Website", + "_docID": "bae-21084f46-b12a-53ab-94dd-04d075b4218c", + "name": "Online", }, }, }, @@ -209,7 +209,7 @@ func TestTransactionalCreationAndLinkingOfRelationalDocumentsBackward(t *testing Results: map[string]any{ "create_Book": []map[string]any{ { - "_docID": "bae-e7943028-5c74-5fd4-9661-0a233edcd287", + "_docID": "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87", }, }, }, @@ -224,7 +224,7 @@ func TestTransactionalCreationAndLinkingOfRelationalDocumentsBackward(t *testing Results: map[string]any{ "create_Book": []map[string]any{ { - "_docID": "bae-7f6a5a76-b90d-5715-a452-708ded9e7ae7", + "_docID": "bae-787391fb-86f8-5cbe-8fc2-ad59f90e267a", }, }, }, @@ -245,7 +245,7 @@ func TestTransactionalCreationAndLinkingOfRelationalDocumentsBackward(t *testing Results: map[string]any{ "Book": []map[string]any{ { - "_docID": "bae-e7943028-5c74-5fd4-9661-0a233edcd287", + "_docID": "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87", "name": "Book By Website", "publisher": map[string]any{ "_docID": "bae-07fd000a-d023-54b9-b8f3-a4318fac8fed", @@ -271,7 +271,7 @@ func TestTransactionalCreationAndLinkingOfRelationalDocumentsBackward(t *testing Results: map[string]any{ "Book": []map[string]any{ { - "_docID": "bae-7f6a5a76-b90d-5715-a452-708ded9e7ae7", + "_docID": "bae-787391fb-86f8-5cbe-8fc2-ad59f90e267a", "name": "Book By Online", "publisher": map[string]any{ "_docID": "bae-21084f46-b12a-53ab-94dd-04d075b4218c", @@ -306,7 +306,7 @@ func TestTransactionalCreationAndLinkingOfRelationalDocumentsBackward(t *testing "_docID": "bae-07fd000a-d023-54b9-b8f3-a4318fac8fed", "name": "Website", "published": map[string]any{ - "_docID": "bae-e7943028-5c74-5fd4-9661-0a233edcd287", + "_docID": "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87", "name": "Book By Website", }, }, @@ -315,7 +315,7 @@ func TestTransactionalCreationAndLinkingOfRelationalDocumentsBackward(t *testing "_docID": "bae-21084f46-b12a-53ab-94dd-04d075b4218c", "name": "Online", "published": map[string]any{ - "_docID": "bae-7f6a5a76-b90d-5715-a452-708ded9e7ae7", + "_docID": "bae-787391fb-86f8-5cbe-8fc2-ad59f90e267a", "name": "Book By Online", }, }, diff --git a/tests/integration/mutation/delete/field_kinds/one_to_many/with_show_deleted_test.go b/tests/integration/mutation/delete/field_kinds/one_to_many/with_show_deleted_test.go index de72ebf893..0c94141b25 100644 --- a/tests/integration/mutation/delete/field_kinds/one_to_many/with_show_deleted_test.go +++ b/tests/integration/mutation/delete/field_kinds/one_to_many/with_show_deleted_test.go @@ -61,14 +61,14 @@ func TestDeletionOfADocumentUsingSingleDocIDWithShowDeletedDocumentQuery(t *test }, testUtils.Request{ Request: `mutation { - delete_Book(docID: "bae-b5c56d8f-b2f5-57f9-b371-4e9e04903e91") { + delete_Book(docID: "bae-39db1d4b-72c0-5b7b-b6f2-c20870982128") { _docID } }`, Results: map[string]any{ "delete_Book": []map[string]any{ { - "_docID": "bae-b5c56d8f-b2f5-57f9-b371-4e9e04903e91", + "_docID": "bae-39db1d4b-72c0-5b7b-b6f2-c20870982128", }, }, }, @@ -94,13 +94,13 @@ func TestDeletionOfADocumentUsingSingleDocIDWithShowDeletedDocumentQuery(t *test "age": int64(30), "published": []map[string]any{ { - "_deleted": false, - "name": "John has a chamber of secrets", + "_deleted": true, + "name": "John and the philosopher are stoned", "rating": 9.9, }, { - "_deleted": true, - "name": "John and the philosopher are stoned", + "_deleted": false, + "name": "John has a chamber of secrets", "rating": 9.9, }, }, diff --git a/tests/integration/mutation/delete/field_kinds/one_to_one_to_one/with_id_test.go b/tests/integration/mutation/delete/field_kinds/one_to_one_to_one/with_id_test.go index fefcc350af..2f8d5dd9f9 100644 --- a/tests/integration/mutation/delete/field_kinds/one_to_one_to_one/with_id_test.go +++ b/tests/integration/mutation/delete/field_kinds/one_to_one_to_one/with_id_test.go @@ -34,7 +34,7 @@ func TestRelationalDeletionOfADocumentUsingSingleKey_Success(t *testing.T) { testUtils.CreateDoc{ // Authors CollectionID: 1, - // bae-455081f4-b810-5363-ab95-50dbd2ec03d0 + // bae-b4f1fb22-52f2-5e3d-950c-f6a4033d8f48 Doc: `{ "name": "Teiva Harsanyi", "age": 48, @@ -53,14 +53,14 @@ func TestRelationalDeletionOfADocumentUsingSingleKey_Success(t *testing.T) { }, testUtils.Request{ Request: `mutation { - delete_Author(docID: "bae-455081f4-b810-5363-ab95-50dbd2ec03d0") { + delete_Author(docID: "bae-b4f1fb22-52f2-5e3d-950c-f6a4033d8f48") { _docID } }`, Results: map[string]any{ "delete_Author": []map[string]any{ { - "_docID": "bae-455081f4-b810-5363-ab95-50dbd2ec03d0", + "_docID": "bae-b4f1fb22-52f2-5e3d-950c-f6a4033d8f48", }, }, }, @@ -84,7 +84,7 @@ func TestRelationalDeletionOfADocumentUsingSingleKey_Success(t *testing.T) { testUtils.CreateDoc{ // Authors CollectionID: 1, - // bae-455081f4-b810-5363-ab95-50dbd2ec03d0 + // bae-b4f1fb22-52f2-5e3d-950c-f6a4033d8f48 Doc: `{ "name": "Teiva Harsanyi", "age": 48, @@ -103,14 +103,14 @@ func TestRelationalDeletionOfADocumentUsingSingleKey_Success(t *testing.T) { }, testUtils.Request{ Request: `mutation { - delete_Author(docID: "bae-455081f4-b810-5363-ab95-50dbd2ec03d0") { + delete_Author(docID: "bae-b4f1fb22-52f2-5e3d-950c-f6a4033d8f48") { AliasOfKey: _docID } }`, Results: map[string]any{ "delete_Author": []map[string]any{ { - "AliasOfKey": "bae-455081f4-b810-5363-ab95-50dbd2ec03d0", + "AliasOfKey": "bae-b4f1fb22-52f2-5e3d-950c-f6a4033d8f48", }, }, }, @@ -134,7 +134,7 @@ func TestRelationalDeletionOfADocumentUsingSingleKey_Success(t *testing.T) { testUtils.CreateDoc{ // Authors CollectionID: 1, - // bae-455081f4-b810-5363-ab95-50dbd2ec03d0 + // bae-b4f1fb22-52f2-5e3d-950c-f6a4033d8f48 Doc: `{ "name": "Teiva Harsanyi", "age": 48, @@ -170,14 +170,14 @@ func TestRelationalDeletionOfADocumentUsingSingleKey_Success(t *testing.T) { }, testUtils.Request{ Request: `mutation { - delete_Author(docID: "bae-455081f4-b810-5363-ab95-50dbd2ec03d0") { + delete_Author(docID: "bae-b4f1fb22-52f2-5e3d-950c-f6a4033d8f48") { Key: _docID } }`, Results: map[string]any{ "delete_Author": []map[string]any{ { - "Key": "bae-455081f4-b810-5363-ab95-50dbd2ec03d0", + "Key": "bae-b4f1fb22-52f2-5e3d-950c-f6a4033d8f48", }, }, }, diff --git a/tests/integration/mutation/delete/field_kinds/one_to_one_to_one/with_txn_test.go b/tests/integration/mutation/delete/field_kinds/one_to_one_to_one/with_txn_test.go index d7be187d49..6a423255d8 100644 --- a/tests/integration/mutation/delete/field_kinds/one_to_one_to_one/with_txn_test.go +++ b/tests/integration/mutation/delete/field_kinds/one_to_one_to_one/with_txn_test.go @@ -22,16 +22,6 @@ func TestTxnDeletionOfRelatedDocFromPrimarySideForwardDirection(t *testing.T) { test := testUtils.TestCase{ Description: "Delete related doc with transaction from primary side (forward).", Actions: []any{ - testUtils.CreateDoc{ - // books - CollectionID: 0, - // "_docID": "bae-e7943028-5c74-5fd4-9661-0a233edcd287", - Doc: `{ - "name": "Book By Website", - "rating": 4.0, - "publisher_id": "bae-07fd000a-d023-54b9-b8f3-a4318fac8fed" - }`, - }, testUtils.CreateDoc{ // publishers CollectionID: 2, @@ -41,18 +31,28 @@ func TestTxnDeletionOfRelatedDocFromPrimarySideForwardDirection(t *testing.T) { "address": "Manning Publications" }`, }, + testUtils.CreateDoc{ + // books + CollectionID: 0, + // "_docID": "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87", + Doc: `{ + "name": "Book By Website", + "rating": 4.0, + "publisher_id": "bae-07fd000a-d023-54b9-b8f3-a4318fac8fed" + }`, + }, testUtils.Request{ // Delete a linked book that exists. TransactionID: immutable.Some(0), Request: `mutation { - delete_Book(docID: "bae-e7943028-5c74-5fd4-9661-0a233edcd287") { + delete_Book(docID: "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87") { _docID } }`, Results: map[string]any{ "delete_Book": []map[string]any{ { - "_docID": "bae-e7943028-5c74-5fd4-9661-0a233edcd287", + "_docID": "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87", }, }, }, @@ -95,7 +95,7 @@ func TestTxnDeletionOfRelatedDocFromPrimarySideBackwardDirection(t *testing.T) { testUtils.CreateDoc{ // books CollectionID: 0, - // "_docID": "bae-e7943028-5c74-5fd4-9661-0a233edcd287", + // "_docID": "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87", Doc: `{ "name": "Book By Website", "rating": 4.0, @@ -115,14 +115,14 @@ func TestTxnDeletionOfRelatedDocFromPrimarySideBackwardDirection(t *testing.T) { // Delete a linked book that exists. TransactionID: immutable.Some(0), Request: `mutation { - delete_Book(docID: "bae-e7943028-5c74-5fd4-9661-0a233edcd287") { + delete_Book(docID: "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87") { _docID } }`, Results: map[string]any{ "delete_Book": []map[string]any{ { - "_docID": "bae-e7943028-5c74-5fd4-9661-0a233edcd287", + "_docID": "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87", }, }, }, @@ -159,7 +159,7 @@ func TestATxnCanReadARecordThatIsDeletedInANonCommitedTxnForwardDirection(t *tes testUtils.CreateDoc{ // books CollectionID: 0, - // "_docID": "bae-e7943028-5c74-5fd4-9661-0a233edcd287", + // "_docID": "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87", Doc: `{ "name": "Book By Website", "rating": 4.0, @@ -179,14 +179,14 @@ func TestATxnCanReadARecordThatIsDeletedInANonCommitedTxnForwardDirection(t *tes // Delete a linked book that exists. TransactionID: immutable.Some(0), Request: `mutation { - delete_Book(docID: "bae-e7943028-5c74-5fd4-9661-0a233edcd287") { + delete_Book(docID: "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87") { _docID } }`, Results: map[string]any{ "delete_Book": []map[string]any{ { - "_docID": "bae-e7943028-5c74-5fd4-9661-0a233edcd287", + "_docID": "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87", }, }, }, @@ -210,7 +210,7 @@ func TestATxnCanReadARecordThatIsDeletedInANonCommitedTxnForwardDirection(t *tes "_docID": "bae-07fd000a-d023-54b9-b8f3-a4318fac8fed", "name": "Website", "published": map[string]any{ - "_docID": "bae-e7943028-5c74-5fd4-9661-0a233edcd287", + "_docID": "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87", "name": "Book By Website", }, }, @@ -255,7 +255,7 @@ func TestATxnCanReadARecordThatIsDeletedInANonCommitedTxnBackwardDirection(t *te testUtils.CreateDoc{ // books CollectionID: 0, - // "_docID": "bae-e7943028-5c74-5fd4-9661-0a233edcd287", + // "_docID": "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87", Doc: `{ "name": "Book By Website", "rating": 4.0, @@ -275,14 +275,14 @@ func TestATxnCanReadARecordThatIsDeletedInANonCommitedTxnBackwardDirection(t *te // Delete a linked book that exists in transaction 0. TransactionID: immutable.Some(0), Request: `mutation { - delete_Book(docID: "bae-e7943028-5c74-5fd4-9661-0a233edcd287") { + delete_Book(docID: "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87") { _docID } }`, Results: map[string]any{ "delete_Book": []map[string]any{ { - "_docID": "bae-e7943028-5c74-5fd4-9661-0a233edcd287", + "_docID": "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87", }, }, }, @@ -303,7 +303,7 @@ func TestATxnCanReadARecordThatIsDeletedInANonCommitedTxnBackwardDirection(t *te Results: map[string]any{ "Book": []map[string]any{ { - "_docID": "bae-e7943028-5c74-5fd4-9661-0a233edcd287", + "_docID": "bae-5a378128-1b3f-50e7-a5ff-027e707c4b87", "name": "Book By Website", "publisher": map[string]any{ "_docID": "bae-07fd000a-d023-54b9-b8f3-a4318fac8fed", @@ -345,7 +345,7 @@ func TestTxnDeletionOfRelatedDocFromNonPrimarySideForwardDirection(t *testing.T) testUtils.CreateDoc{ // books CollectionID: 0, - // "_docID": "bae-7f6a5a76-b90d-5715-a452-708ded9e7ae7", + // "_docID": "bae-787391fb-86f8-5cbe-8fc2-ad59f90e267a", Doc: `{ "name": "Book By Online", "rating": 4.0, @@ -410,7 +410,7 @@ func TestTxnDeletionOfRelatedDocFromNonPrimarySideBackwardDirection(t *testing.T testUtils.CreateDoc{ // books CollectionID: 0, - // "_docID": "bae-7f6a5a76-b90d-5715-a452-708ded9e7ae7", + // "_docID": "bae-787391fb-86f8-5cbe-8fc2-ad59f90e267a", Doc: `{ "name": "Book By Online", "rating": 4.0, @@ -461,7 +461,7 @@ func TestTxnDeletionOfRelatedDocFromNonPrimarySideBackwardDirection(t *testing.T Results: map[string]any{ "Book": []map[string]any{ { - "_docID": "bae-7f6a5a76-b90d-5715-a452-708ded9e7ae7", + "_docID": "bae-787391fb-86f8-5cbe-8fc2-ad59f90e267a", "name": "Book By Online", "publisher": nil, }, diff --git a/tests/integration/mutation/update/field_kinds/one_to_one/with_alias_test.go b/tests/integration/mutation/update/field_kinds/one_to_one/with_alias_test.go index 5996dde5ea..eda176bbcc 100644 --- a/tests/integration/mutation/update/field_kinds/one_to_one/with_alias_test.go +++ b/tests/integration/mutation/update/field_kinds/one_to_one/with_alias_test.go @@ -20,8 +20,8 @@ import ( ) func TestMutationUpdateOneToOne_AliasRelationNameToLinkFromPrimarySide(t *testing.T) { - author1ID := "bae-42d197b8-d14f-5570-a55d-9e8714b2a82a" - bookID := "bae-dfce6a1a-27fa-5dde-bea7-44df2dffac1a" + author1ID := "bae-53eff350-ad8e-532c-b72d-f95c4f47909c" + bookID := "bae-89d64ba1-44e3-5d75-a610-7226077ece48" test := testUtils.TestCase{ Description: "One to one update mutation using alias relation id from single side", @@ -66,8 +66,8 @@ func TestMutationUpdateOneToOne_AliasRelationNameToLinkFromPrimarySide(t *testin } func TestMutationUpdateOneToOne_AliasRelationNameToLinkFromSecondarySide(t *testing.T) { - author1ID := "bae-42d197b8-d14f-5570-a55d-9e8714b2a82a" - author2ID := "bae-a34d8759-e549-5083-8ba6-e04038c41caa" + author1ID := "bae-53eff350-ad8e-532c-b72d-f95c4f47909c" + author2ID := "bae-c058cfd4-259f-5b08-975d-106f13a143d5" test := testUtils.TestCase{ Description: "One to one update mutation using alias relation id from secondary side", @@ -112,7 +112,7 @@ func TestMutationUpdateOneToOne_AliasRelationNameToLinkFromSecondarySide(t *test } func TestMutationUpdateOneToOne_AliasWithInvalidLengthRelationIDToLink_Error(t *testing.T) { - author1ID := "bae-42d197b8-d14f-5570-a55d-9e8714b2a82a" + author1ID := "bae-53eff350-ad8e-532c-b72d-f95c4f47909c" invalidLenSubID := "35953ca-518d-9e6b-9ce6cd00eff5" invalidAuthorID := "bae-" + invalidLenSubID @@ -153,7 +153,7 @@ func TestMutationUpdateOneToOne_AliasWithInvalidLengthRelationIDToLink_Error(t * } func TestMutationUpdateOneToOne_InvalidAliasRelationNameToLinkFromSecondarySide_Error(t *testing.T) { - author1ID := "bae-42d197b8-d14f-5570-a55d-9e8714b2a82a" + author1ID := "bae-53eff350-ad8e-532c-b72d-f95c4f47909c" invalidAuthorID := "bae-2edb7fdd-cad7-5ad4-9c7d-6920245a96ee" test := testUtils.TestCase{ @@ -193,8 +193,8 @@ func TestMutationUpdateOneToOne_InvalidAliasRelationNameToLinkFromSecondarySide_ } func TestMutationUpdateOneToOne_AliasRelationNameToLinkFromSecondarySideWithWrongField_Error(t *testing.T) { - author1ID := "bae-42d197b8-d14f-5570-a55d-9e8714b2a82a" - author2ID := "bae-a34d8759-e549-5083-8ba6-e04038c41caa" + author1ID := "bae-53eff350-ad8e-532c-b72d-f95c4f47909c" + author2ID := "bae-c058cfd4-259f-5b08-975d-106f13a143d5" test := testUtils.TestCase{ Description: "One to one update mutation using relation alias name from secondary side, with a wrong field.", diff --git a/tests/integration/mutation/update/field_kinds/one_to_one/with_self_ref_test.go b/tests/integration/mutation/update/field_kinds/one_to_one/with_self_ref_test.go index 841d30d80c..dd630c0721 100644 --- a/tests/integration/mutation/update/field_kinds/one_to_one/with_self_ref_test.go +++ b/tests/integration/mutation/update/field_kinds/one_to_one/with_self_ref_test.go @@ -18,7 +18,7 @@ import ( ) func TestMutationUpdateOneToOne_SelfReferencingFromPrimary(t *testing.T) { - user1ID := "bae-ec56fb02-88fb-5113-b4d8-1b9be5f2217b" + user1ID := "bae-93b58e20-b3e1-55b9-b5b8-0617fabe710e" test := testUtils.TestCase{ Description: "One to one update mutation, self referencing from primary", @@ -63,16 +63,16 @@ func TestMutationUpdateOneToOne_SelfReferencingFromPrimary(t *testing.T) { }`, Results: map[string]any{ "User": []map[string]any{ + { + "name": "John", + "boss": nil, + }, { "name": "Fred", "boss": map[string]any{ "name": "John", }, }, - { - "name": "John", - "boss": nil, - }, }, }, }, @@ -88,16 +88,16 @@ func TestMutationUpdateOneToOne_SelfReferencingFromPrimary(t *testing.T) { }`, Results: map[string]any{ "User": []map[string]any{ - { - "name": "Fred", - "underling": nil, - }, { "name": "John", "underling": map[string]any{ "name": "Fred", }, }, + { + "name": "Fred", + "underling": nil, + }, }, }, }, @@ -108,7 +108,7 @@ func TestMutationUpdateOneToOne_SelfReferencingFromPrimary(t *testing.T) { } func TestMutationUpdateOneToOne_SelfReferencingFromSecondary(t *testing.T) { - user1ID := "bae-12a7f594-f02e-53b7-81c4-aba27b2e7ea7" + user1ID := "bae-a86ab69e-a2be-54b9-b66e-4e30d6778ffe" test := testUtils.TestCase{ Description: "One to one update mutation, self referencing from secondary", @@ -154,16 +154,16 @@ func TestMutationUpdateOneToOne_SelfReferencingFromSecondary(t *testing.T) { }`, Results: map[string]any{ "User": []map[string]any{ - { - "name": "John", - "boss": nil, - }, { "name": "Fred", "boss": map[string]any{ "name": "John", }, }, + { + "name": "John", + "boss": nil, + }, }, }, }, @@ -179,16 +179,16 @@ func TestMutationUpdateOneToOne_SelfReferencingFromSecondary(t *testing.T) { }`, Results: map[string]any{ "User": []map[string]any{ + { + "name": "Fred", + "underling": nil, + }, { "name": "John", "underling": map[string]any{ "name": "Fred", }, }, - { - "name": "Fred", - "underling": nil, - }, }, }, }, diff --git a/tests/integration/mutation/update/field_kinds/one_to_one/with_simple_test.go b/tests/integration/mutation/update/field_kinds/one_to_one/with_simple_test.go index 8cbbe963f3..b2b3859d2d 100644 --- a/tests/integration/mutation/update/field_kinds/one_to_one/with_simple_test.go +++ b/tests/integration/mutation/update/field_kinds/one_to_one/with_simple_test.go @@ -139,7 +139,7 @@ func TestMutationUpdateOneToOne(t *testing.T) { } func TestMutationUpdateOneToOneSecondarySide(t *testing.T) { - authorID := "bae-42d197b8-d14f-5570-a55d-9e8714b2a82a" + authorID := "bae-53eff350-ad8e-532c-b72d-f95c4f47909c" test := testUtils.TestCase{ Description: "One to one create mutation, from the secondary side", @@ -214,8 +214,8 @@ func TestMutationUpdateOneToOneSecondarySide(t *testing.T) { } func TestMutationUpdateOneToOne_RelationIDToLinkFromPrimarySide(t *testing.T) { - author1ID := "bae-42d197b8-d14f-5570-a55d-9e8714b2a82a" - bookID := "bae-dfce6a1a-27fa-5dde-bea7-44df2dffac1a" + author1ID := "bae-53eff350-ad8e-532c-b72d-f95c4f47909c" + bookID := "bae-89d64ba1-44e3-5d75-a610-7226077ece48" test := testUtils.TestCase{ Description: "One to one update mutation using relation id from single side (wrong)", @@ -260,8 +260,8 @@ func TestMutationUpdateOneToOne_RelationIDToLinkFromPrimarySide(t *testing.T) { } func TestMutationUpdateOneToOne_RelationIDToLinkFromSecondarySide(t *testing.T) { - author1ID := "bae-42d197b8-d14f-5570-a55d-9e8714b2a82a" - author2ID := "bae-a34d8759-e549-5083-8ba6-e04038c41caa" + author1ID := "bae-53eff350-ad8e-532c-b72d-f95c4f47909c" + author2ID := "bae-c058cfd4-259f-5b08-975d-106f13a143d5" test := testUtils.TestCase{ Description: "One to one update mutation using relation id from secondary side", @@ -306,7 +306,7 @@ func TestMutationUpdateOneToOne_RelationIDToLinkFromSecondarySide(t *testing.T) } func TestMutationUpdateOneToOne_InvalidLengthRelationIDToLink_Error(t *testing.T) { - author1ID := "bae-42d197b8-d14f-5570-a55d-9e8714b2a82a" + author1ID := "bae-53eff350-ad8e-532c-b72d-f95c4f47909c" invalidLenSubID := "35953ca-518d-9e6b-9ce6cd00eff5" invalidAuthorID := "bae-" + invalidLenSubID @@ -347,7 +347,7 @@ func TestMutationUpdateOneToOne_InvalidLengthRelationIDToLink_Error(t *testing.T } func TestMutationUpdateOneToOne_InvalidRelationIDToLinkFromSecondarySide_Error(t *testing.T) { - author1ID := "bae-42d197b8-d14f-5570-a55d-9e8714b2a82a" + author1ID := "bae-53eff350-ad8e-532c-b72d-f95c4f47909c" invalidAuthorID := "bae-2edb7fdd-cad7-5ad4-9c7d-6920245a96ee" test := testUtils.TestCase{ @@ -387,8 +387,8 @@ func TestMutationUpdateOneToOne_InvalidRelationIDToLinkFromSecondarySide_Error(t } func TestMutationUpdateOneToOne_RelationIDToLinkFromSecondarySideWithWrongField_Error(t *testing.T) { - author1ID := "bae-42d197b8-d14f-5570-a55d-9e8714b2a82a" - author2ID := "bae-a34d8759-e549-5083-8ba6-e04038c41caa" + author1ID := "bae-53eff350-ad8e-532c-b72d-f95c4f47909c" + author2ID := "bae-c058cfd4-259f-5b08-975d-106f13a143d5" test := testUtils.TestCase{ Description: "One to one update mutation using relation id from secondary side, with a wrong field.", diff --git a/tests/integration/query/one_to_many/with_cid_doc_id_test.go b/tests/integration/query/one_to_many/with_cid_doc_id_test.go index becc516dbc..9811a4c54a 100644 --- a/tests/integration/query/one_to_many/with_cid_doc_id_test.go +++ b/tests/integration/query/one_to_many/with_cid_doc_id_test.go @@ -104,8 +104,8 @@ func TestQueryOneToManyWithCidAndDocID(t *testing.T) { testUtils.Request{ Request: `query { Book ( - cid: "bafyreicjhmyweoyzopsqf7qc4uqqpq7mwnqlpsfb2rzk3j2jg3a4d6fqy4" - docID: "bae-5366ba09-54e8-5381-8169-a770aa9282ae" + cid: "bafyreieytzivxtdjslivrsim22xkszg7sxy4onmp737u5uxf7v2cxvzikm" + docID: "bae-064f13c1-7726-5d53-8eec-c395d94da4d0" ) { name author { @@ -181,8 +181,8 @@ func TestQueryOneToManyWithChildUpdateAndFirstCidAndDocID(t *testing.T) { testUtils.Request{ Request: `query { Book ( - cid: "bafyreicjhmyweoyzopsqf7qc4uqqpq7mwnqlpsfb2rzk3j2jg3a4d6fqy4", - docID: "bae-5366ba09-54e8-5381-8169-a770aa9282ae" + cid: "bafyreieytzivxtdjslivrsim22xkszg7sxy4onmp737u5uxf7v2cxvzikm", + docID: "bae-064f13c1-7726-5d53-8eec-c395d94da4d0" ) { name author { @@ -256,8 +256,8 @@ func TestQueryOneToManyWithParentUpdateAndFirstCidAndDocID(t *testing.T) { testUtils.Request{ Request: `query { Book ( - cid: "bafyreicjhmyweoyzopsqf7qc4uqqpq7mwnqlpsfb2rzk3j2jg3a4d6fqy4", - docID: "bae-5366ba09-54e8-5381-8169-a770aa9282ae" + cid: "bafyreieytzivxtdjslivrsim22xkszg7sxy4onmp737u5uxf7v2cxvzikm", + docID: "bae-064f13c1-7726-5d53-8eec-c395d94da4d0" ) { name rating @@ -331,8 +331,8 @@ func TestQueryOneToManyWithParentUpdateAndLastCidAndDocID(t *testing.T) { testUtils.Request{ Request: `query { Book ( - cid: "bafyreihylh2iftquu5vukm2myjrfbkjnpr5vonlp5s5oo22bfrhddkju6e", - docID: "bae-5366ba09-54e8-5381-8169-a770aa9282ae" + cid: "bafyreia2sayewutxhcewm2ek2p6nwwg6zzeugrxsnwjyvam4pplydkjmz4", + docID: "bae-064f13c1-7726-5d53-8eec-c395d94da4d0" ) { name rating diff --git a/tests/integration/query/one_to_many/with_count_limit_offset_test.go b/tests/integration/query/one_to_many/with_count_limit_offset_test.go index ee0dc26e61..b4c55ed720 100644 --- a/tests/integration/query/one_to_many/with_count_limit_offset_test.go +++ b/tests/integration/query/one_to_many/with_count_limit_offset_test.go @@ -98,10 +98,10 @@ func TestQueryOneToManyWithCountAndLimitAndOffset(t *testing.T) { "_count": 4, "published": []map[string]any{ { - "name": "Painted House", + "name": "The Pelican Brief", }, { - "name": "The Pelican Brief", + "name": "The Firm", }, }, }, @@ -192,10 +192,10 @@ func TestQueryOneToManyWithCountAndDifferentOffsets(t *testing.T) { "_count": 2, "published": []map[string]any{ { - "name": "The Associate", + "name": "Painted House", }, { - "name": "Painted House", + "name": "The Associate", }, }, }, diff --git a/tests/integration/query/one_to_many/with_count_limit_test.go b/tests/integration/query/one_to_many/with_count_limit_test.go index 0b1cdaae96..0611226cc2 100644 --- a/tests/integration/query/one_to_many/with_count_limit_test.go +++ b/tests/integration/query/one_to_many/with_count_limit_test.go @@ -177,7 +177,7 @@ func TestQueryOneToManyWithCountAndDifferentLimits(t *testing.T) { "_count": 2, "published": []map[string]any{ { - "name": "The Associate", + "name": "Painted House", }, }, }, diff --git a/tests/integration/query/one_to_many/with_doc_id_test.go b/tests/integration/query/one_to_many/with_doc_id_test.go index 86551c5934..7bb494dba3 100644 --- a/tests/integration/query/one_to_many/with_doc_id_test.go +++ b/tests/integration/query/one_to_many/with_doc_id_test.go @@ -49,7 +49,7 @@ func TestQueryOneToManyWithChildDocID(t *testing.T) { Author { name published ( - docID: "bae-5366ba09-54e8-5381-8169-a770aa9282ae" + docID: "bae-064f13c1-7726-5d53-8eec-c395d94da4d0" ) { name } diff --git a/tests/integration/query/one_to_many/with_doc_ids_test.go b/tests/integration/query/one_to_many/with_doc_ids_test.go index b704cd0ddd..5b561fe98e 100644 --- a/tests/integration/query/one_to_many/with_doc_ids_test.go +++ b/tests/integration/query/one_to_many/with_doc_ids_test.go @@ -65,7 +65,7 @@ func TestQueryOneToManyWithChildDocIDs(t *testing.T) { Author { name published ( - docIDs: ["bae-5366ba09-54e8-5381-8169-a770aa9282ae", "bae-1ccf3043-d760-543e-be1b-6691fa6aa7a8"] + docIDs: ["bae-064f13c1-7726-5d53-8eec-c395d94da4d0", "bae-649c8101-76b8-5d18-a701-21c97a5c66b3"] ) { name } @@ -77,10 +77,10 @@ func TestQueryOneToManyWithChildDocIDs(t *testing.T) { "name": "John Grisham", "published": []map[string]any{ { - "name": "The Associate", + "name": "Painted House", }, { - "name": "Painted House", + "name": "The Associate", }, }, }, diff --git a/tests/integration/query/one_to_many/with_filter_related_id_test.go b/tests/integration/query/one_to_many/with_filter_related_id_test.go index 4f9bffaffb..a05a042817 100644 --- a/tests/integration/query/one_to_many/with_filter_related_id_test.go +++ b/tests/integration/query/one_to_many/with_filter_related_id_test.go @@ -100,8 +100,8 @@ func TestQueryFromManySideWithEqFilterOnRelatedType(t *testing.T) { }`, Results: map[string]any{ "Book": []map[string]any{ - {"name": "The Client"}, {"name": "Painted House"}, + {"name": "The Client"}, {"name": "A Time for Mercy"}, }, }, @@ -196,8 +196,8 @@ func TestQueryFromManySideWithFilterOnRelatedObjectID(t *testing.T) { }`, Results: map[string]any{ "Book": []map[string]any{ - {"name": "The Client"}, {"name": "Painted House"}, + {"name": "The Client"}, {"name": "A Time for Mercy"}, }, }, @@ -297,8 +297,8 @@ func TestQueryFromManySideWithSameFiltersInDifferentWayOnRelatedType(t *testing. }`, Results: map[string]any{ "Book": []map[string]any{ - {"name": "The Client"}, {"name": "Painted House"}, + {"name": "The Client"}, {"name": "A Time for Mercy"}, }, }, @@ -387,7 +387,7 @@ func TestQueryFromSingleSideWithEqFilterOnRelatedType(t *testing.T) { }, testUtils.Request{ Request: `query { - Author(filter: {published: {_docID: {_eq: "bae-96c9de0f-2903-5589-9604-b42882afde8c"}}}) { + Author(filter: {published: {_docID: {_eq: "bae-064f13c1-7726-5d53-8eec-c395d94da4d0"}}}) { name } }`, @@ -483,11 +483,11 @@ func TestQueryFromSingleSideWithFilterOnRelatedObjectID_Error(t *testing.T) { }, testUtils.Request{ Request: `query { - Author(filter: {published_id: {_eq: "bae-5366ba09-54e8-5381-8169-a770aa9282ae"}}) { + Author(filter: {published_id: {_eq: "bae-064f13c1-7726-5d53-8eec-c395d94da4d0"}}) { name } }`, - ExpectedError: "Argument \"filter\" has invalid value {published_id: {_eq: \"bae-5366ba09-54e8-5381-8169-a770aa9282ae\"}}.\nIn field \"published_id\": Unknown field.", + ExpectedError: "Argument \"filter\" has invalid value {published_id: {_eq: \"bae-064f13c1-7726-5d53-8eec-c395d94da4d0\"}}.\nIn field \"published_id\": Unknown field.", }, }, } diff --git a/tests/integration/query/one_to_many/with_group_filter_test.go b/tests/integration/query/one_to_many/with_group_filter_test.go index 5071b963cf..9356e4f334 100644 --- a/tests/integration/query/one_to_many/with_group_filter_test.go +++ b/tests/integration/query/one_to_many/with_group_filter_test.go @@ -273,14 +273,14 @@ func TestQueryOneToManyWithParentJoinGroupNumberAndNumberFilterOnGroup(t *testin { "name": "John Grisham", "published": []map[string]any{ - { - "name": "The Client", - "rating": 4.5, - }, { "name": "Painted House", "rating": 4.9, }, + { + "name": "The Client", + "rating": 4.5, + }, { "name": "A Time for Mercy", "rating": 4.5, diff --git a/tests/integration/query/one_to_many/with_group_related_id_alias_test.go b/tests/integration/query/one_to_many/with_group_related_id_alias_test.go index 2847b0da2c..ad35a32470 100644 --- a/tests/integration/query/one_to_many/with_group_related_id_alias_test.go +++ b/tests/integration/query/one_to_many/with_group_related_id_alias_test.go @@ -128,16 +128,16 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeFromManySideUsingAlias(t *t "author_id": "bae-e1ea288f-09fa-55fa-b0b5-0ac8941ea35b", "_group": []map[string]any{ { - "name": "The Client", - "rating": 4.5, + "name": "Painted House", + "rating": 4.9, "author": map[string]any{ "age": int64(65), "name": "John Grisham", }, }, { - "name": "Painted House", - "rating": 4.9, + "name": "The Client", + "rating": 4.5, "author": map[string]any{ "age": int64(65), "name": "John Grisham", @@ -153,19 +153,6 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeFromManySideUsingAlias(t *t }, }, }, - { - "author_id": "bae-34a9bd41-1f0d-5748-8446-48fc36ef2614", - "_group": []map[string]any{ - { - "name": "Histoiare des Celtes et particulierement des Gaulois et des Germains depuis les temps fabuleux jusqua la prise de Roze par les Gaulois", - "rating": 2.0, - "author": map[string]any{ - "age": int64(327), - "name": "Simon Pelloutier", - }, - }, - }, - }, { "author_id": "bae-1594d2aa-d63c-51d2-8e5e-06ee0c9e2e8c", "_group": []map[string]any{ @@ -187,6 +174,19 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeFromManySideUsingAlias(t *t }, }, }, + { + "author_id": "bae-34a9bd41-1f0d-5748-8446-48fc36ef2614", + "_group": []map[string]any{ + { + "name": "Histoiare des Celtes et particulierement des Gaulois et des Germains depuis les temps fabuleux jusqua la prise de Roze par les Gaulois", + "rating": 2.0, + "author": map[string]any{ + "age": int64(327), + "name": "Simon Pelloutier", + }, + }, + }, + }, }, }, }, @@ -314,16 +314,16 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeFromManySideUsingAliasAndRe }, "_group": []map[string]any{ { - "name": "The Client", - "rating": 4.5, + "name": "Painted House", + "rating": 4.9, "author": map[string]any{ "age": int64(65), "name": "John Grisham", }, }, { - "name": "Painted House", - "rating": 4.9, + "name": "The Client", + "rating": 4.5, "author": map[string]any{ "age": int64(65), "name": "John Grisham", @@ -339,22 +339,6 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeFromManySideUsingAliasAndRe }, }, }, - { - "author": map[string]any{ - "name": "Simon Pelloutier", - "_docID": "bae-34a9bd41-1f0d-5748-8446-48fc36ef2614", - }, - "_group": []map[string]any{ - { - "name": "Histoiare des Celtes et particulierement des Gaulois et des Germains depuis les temps fabuleux jusqua la prise de Roze par les Gaulois", - "rating": 2.0, - "author": map[string]any{ - "age": int64(327), - "name": "Simon Pelloutier", - }, - }, - }, - }, { "author": map[string]any{ "name": "Voltaire", @@ -379,6 +363,22 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeFromManySideUsingAliasAndRe }, }, }, + { + "author": map[string]any{ + "name": "Simon Pelloutier", + "_docID": "bae-34a9bd41-1f0d-5748-8446-48fc36ef2614", + }, + "_group": []map[string]any{ + { + "name": "Histoiare des Celtes et particulierement des Gaulois et des Germains depuis les temps fabuleux jusqua la prise de Roze par les Gaulois", + "rating": 2.0, + "author": map[string]any{ + "age": int64(327), + "name": "Simon Pelloutier", + }, + }, + }, + }, }, }, }, @@ -500,16 +500,16 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeWithIDSelectionFromManySide "author_id": "bae-e1ea288f-09fa-55fa-b0b5-0ac8941ea35b", "_group": []map[string]any{ { - "name": "The Client", - "rating": 4.5, + "name": "Painted House", + "rating": 4.9, "author": map[string]any{ "age": int64(65), "name": "John Grisham", }, }, { - "name": "Painted House", - "rating": 4.9, + "name": "The Client", + "rating": 4.5, "author": map[string]any{ "age": int64(65), "name": "John Grisham", @@ -525,19 +525,6 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeWithIDSelectionFromManySide }, }, }, - { - "author_id": "bae-34a9bd41-1f0d-5748-8446-48fc36ef2614", - "_group": []map[string]any{ - { - "name": "Histoiare des Celtes et particulierement des Gaulois et des Germains depuis les temps fabuleux jusqua la prise de Roze par les Gaulois", - "rating": 2.0, - "author": map[string]any{ - "age": int64(327), - "name": "Simon Pelloutier", - }, - }, - }, - }, { "author_id": "bae-1594d2aa-d63c-51d2-8e5e-06ee0c9e2e8c", "_group": []map[string]any{ @@ -559,6 +546,19 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeWithIDSelectionFromManySide }, }, }, + { + "author_id": "bae-34a9bd41-1f0d-5748-8446-48fc36ef2614", + "_group": []map[string]any{ + { + "name": "Histoiare des Celtes et particulierement des Gaulois et des Germains depuis les temps fabuleux jusqua la prise de Roze par les Gaulois", + "rating": 2.0, + "author": map[string]any{ + "age": int64(327), + "name": "Simon Pelloutier", + }, + }, + }, + }, }, }, }, @@ -688,16 +688,16 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeWithIDSelectionFromManySide }, "_group": []map[string]any{ { - "name": "The Client", - "rating": 4.5, + "name": "Painted House", + "rating": 4.9, "author": map[string]any{ "age": int64(65), "name": "John Grisham", }, }, { - "name": "Painted House", - "rating": 4.9, + "name": "The Client", + "rating": 4.5, "author": map[string]any{ "age": int64(65), "name": "John Grisham", @@ -713,23 +713,6 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeWithIDSelectionFromManySide }, }, }, - { - "author_id": "bae-34a9bd41-1f0d-5748-8446-48fc36ef2614", - "author": map[string]any{ - "name": "Simon Pelloutier", - "_docID": "bae-34a9bd41-1f0d-5748-8446-48fc36ef2614", - }, - "_group": []map[string]any{ - { - "name": "Histoiare des Celtes et particulierement des Gaulois et des Germains depuis les temps fabuleux jusqua la prise de Roze par les Gaulois", - "rating": 2.0, - "author": map[string]any{ - "age": int64(327), - "name": "Simon Pelloutier", - }, - }, - }, - }, { "author_id": "bae-1594d2aa-d63c-51d2-8e5e-06ee0c9e2e8c", "author": map[string]any{ @@ -755,6 +738,23 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeWithIDSelectionFromManySide }, }, }, + { + "author_id": "bae-34a9bd41-1f0d-5748-8446-48fc36ef2614", + "author": map[string]any{ + "name": "Simon Pelloutier", + "_docID": "bae-34a9bd41-1f0d-5748-8446-48fc36ef2614", + }, + "_group": []map[string]any{ + { + "name": "Histoiare des Celtes et particulierement des Gaulois et des Germains depuis les temps fabuleux jusqua la prise de Roze par les Gaulois", + "rating": 2.0, + "author": map[string]any{ + "age": int64(327), + "name": "Simon Pelloutier", + }, + }, + }, + }, }, }, }, diff --git a/tests/integration/query/one_to_many/with_group_related_id_test.go b/tests/integration/query/one_to_many/with_group_related_id_test.go index 86d391a2f6..5ab39a909b 100644 --- a/tests/integration/query/one_to_many/with_group_related_id_test.go +++ b/tests/integration/query/one_to_many/with_group_related_id_test.go @@ -112,16 +112,16 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeIDFromManySide(t *testing.T "author_id": "bae-e1ea288f-09fa-55fa-b0b5-0ac8941ea35b", "_group": []map[string]any{ { - "name": "The Client", - "rating": 4.5, + "name": "Painted House", + "rating": 4.9, "author": map[string]any{ "age": int64(65), "name": "John Grisham", }, }, { - "name": "Painted House", - "rating": 4.9, + "name": "The Client", + "rating": 4.5, "author": map[string]any{ "age": int64(65), "name": "John Grisham", @@ -137,19 +137,6 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeIDFromManySide(t *testing.T }, }, }, - { - "author_id": "bae-34a9bd41-1f0d-5748-8446-48fc36ef2614", - "_group": []map[string]any{ - { - "name": "Histoiare des Celtes et particulierement des Gaulois et des Germains depuis les temps fabuleux jusqua la prise de Roze par les Gaulois", - "rating": 2.0, - "author": map[string]any{ - "age": int64(327), - "name": "Simon Pelloutier", - }, - }, - }, - }, { "author_id": "bae-1594d2aa-d63c-51d2-8e5e-06ee0c9e2e8c", "_group": []map[string]any{ @@ -171,6 +158,19 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeIDFromManySide(t *testing.T }, }, }, + { + "author_id": "bae-34a9bd41-1f0d-5748-8446-48fc36ef2614", + "_group": []map[string]any{ + { + "name": "Histoiare des Celtes et particulierement des Gaulois et des Germains depuis les temps fabuleux jusqua la prise de Roze par les Gaulois", + "rating": 2.0, + "author": map[string]any{ + "age": int64(327), + "name": "Simon Pelloutier", + }, + }, + }, + }, }, }, }, @@ -276,16 +276,16 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeIDWithIDSelectionFromManySi "author_id": "bae-e1ea288f-09fa-55fa-b0b5-0ac8941ea35b", "_group": []map[string]any{ { - "name": "The Client", - "rating": 4.5, + "name": "Painted House", + "rating": 4.9, "author": map[string]any{ "age": int64(65), "name": "John Grisham", }, }, { - "name": "Painted House", - "rating": 4.9, + "name": "The Client", + "rating": 4.5, "author": map[string]any{ "age": int64(65), "name": "John Grisham", @@ -301,19 +301,6 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeIDWithIDSelectionFromManySi }, }, }, - { - "author_id": "bae-34a9bd41-1f0d-5748-8446-48fc36ef2614", - "_group": []map[string]any{ - { - "name": "Histoiare des Celtes et particulierement des Gaulois et des Germains depuis les temps fabuleux jusqua la prise de Roze par les Gaulois", - "rating": 2.0, - "author": map[string]any{ - "age": int64(327), - "name": "Simon Pelloutier", - }, - }, - }, - }, { "author_id": "bae-1594d2aa-d63c-51d2-8e5e-06ee0c9e2e8c", "_group": []map[string]any{ @@ -335,6 +322,19 @@ func TestQueryOneToManyWithParentGroupByOnRelatedTypeIDWithIDSelectionFromManySi }, }, }, + { + "author_id": "bae-34a9bd41-1f0d-5748-8446-48fc36ef2614", + "_group": []map[string]any{ + { + "name": "Histoiare des Celtes et particulierement des Gaulois et des Germains depuis les temps fabuleux jusqua la prise de Roze par les Gaulois", + "rating": 2.0, + "author": map[string]any{ + "age": int64(327), + "name": "Simon Pelloutier", + }, + }, + }, + }, }, }, }, diff --git a/tests/integration/query/one_to_many/with_group_test.go b/tests/integration/query/one_to_many/with_group_test.go index 421c785dbe..b3e259b261 100644 --- a/tests/integration/query/one_to_many/with_group_test.go +++ b/tests/integration/query/one_to_many/with_group_test.go @@ -103,21 +103,21 @@ func TestQueryOneToManyWithInnerJoinGroupNumber(t *testing.T) { "age": int64(65), "published": []map[string]any{ { - "rating": 4.5, + "rating": 4.9, "_group": []map[string]any{ { - "name": "The Client", - }, - { - "name": "A Time for Mercy", + "name": "Painted House", }, }, }, { - "rating": 4.9, + "rating": 4.5, "_group": []map[string]any{ { - "name": "Painted House", + "name": "The Client", + }, + { + "name": "A Time for Mercy", }, }, }, @@ -259,14 +259,14 @@ func TestQueryOneToManyWithParentJoinGroupNumber(t *testing.T) { { "name": "John Grisham", "published": []map[string]any{ - { - "name": "The Client", - "rating": 4.5, - }, { "name": "Painted House", "rating": 4.9, }, + { + "name": "The Client", + "rating": 4.5, + }, { "name": "A Time for Mercy", "rating": 4.5, diff --git a/tests/integration/query/one_to_many/with_related_id_test.go b/tests/integration/query/one_to_many/with_related_id_test.go index 906719c532..ddc12c56f6 100644 --- a/tests/integration/query/one_to_many/with_related_id_test.go +++ b/tests/integration/query/one_to_many/with_related_id_test.go @@ -101,22 +101,14 @@ func TestQueryOneToManyWithRelatedTypeIDFromManySide(t *testing.T) { }`, Results: map[string]any{ "Book": []map[string]any{ - { - "name": "The Client", - "author_id": "bae-e1ea288f-09fa-55fa-b0b5-0ac8941ea35b", - }, { "name": "Painted House", "author_id": "bae-e1ea288f-09fa-55fa-b0b5-0ac8941ea35b", }, { - "name": "A Time for Mercy", + "name": "The Client", "author_id": "bae-e1ea288f-09fa-55fa-b0b5-0ac8941ea35b", }, - { - "name": "Histoiare des Celtes et particulierement des Gaulois et des Germains depuis les temps fabuleux jusqua la prise de Roze par les Gaulois", - "author_id": "bae-34a9bd41-1f0d-5748-8446-48fc36ef2614", - }, { "name": "Candide", "author_id": "bae-1594d2aa-d63c-51d2-8e5e-06ee0c9e2e8c", @@ -125,6 +117,14 @@ func TestQueryOneToManyWithRelatedTypeIDFromManySide(t *testing.T) { "name": "Zadig", "author_id": "bae-1594d2aa-d63c-51d2-8e5e-06ee0c9e2e8c", }, + { + "name": "Histoiare des Celtes et particulierement des Gaulois et des Germains depuis les temps fabuleux jusqua la prise de Roze par les Gaulois", + "author_id": "bae-34a9bd41-1f0d-5748-8446-48fc36ef2614", + }, + { + "name": "A Time for Mercy", + "author_id": "bae-e1ea288f-09fa-55fa-b0b5-0ac8941ea35b", + }, }, }, }, diff --git a/tests/integration/query/one_to_many/with_sum_limit_offset_test.go b/tests/integration/query/one_to_many/with_sum_limit_offset_test.go index 420deeca19..0bfddf48e7 100644 --- a/tests/integration/query/one_to_many/with_sum_limit_offset_test.go +++ b/tests/integration/query/one_to_many/with_sum_limit_offset_test.go @@ -83,7 +83,7 @@ func TestQueryOneToManyWithSumWithLimitAndOffset(t *testing.T) { }, { "name": "John Grisham", - "_sum": 9.4, + "_sum": 8.7, }, }, }, diff --git a/tests/integration/query/one_to_many_to_many/joins_test.go b/tests/integration/query/one_to_many_to_many/joins_test.go index 7fe84162e1..6aad836940 100644 --- a/tests/integration/query/one_to_many_to_many/joins_test.go +++ b/tests/integration/query/one_to_many_to_many/joins_test.go @@ -213,12 +213,26 @@ func TestOneToManyToManyJoinsAreLinkedProperly(t *testing.T) { "_docID": testUtils.NewDocIndex(0, 0), "book": []map[string]any{ { - "_docID": testUtils.NewDocIndex(1, 1), - "name": "Theif Lord", + "_docID": testUtils.NewDocIndex(1, 3), + "name": "Painted House", "publisher": []map[string]any{ { - "_docID": testUtils.NewDocIndex(2, 1), - "name": "Only Publisher of Theif Lord", + "_docID": testUtils.NewDocIndex(2, 2), + "name": "Only Publisher of Painted House", + }, + }, + }, + { + "_docID": testUtils.NewDocIndex(1, 5), + "name": "Sooley", + "publisher": []map[string]any{ + { + "_docID": testUtils.NewDocIndex(2, 5), + "name": "Second of Two Publishers of Sooley", + }, + { + "_docID": testUtils.NewDocIndex(2, 4), + "name": "First of Two Publishers of Sooley", }, }, }, @@ -228,12 +242,12 @@ func TestOneToManyToManyJoinsAreLinkedProperly(t *testing.T) { "publisher": []map[string]any{}, }, { - "_docID": testUtils.NewDocIndex(1, 3), - "name": "Painted House", + "_docID": testUtils.NewDocIndex(1, 1), + "name": "Theif Lord", "publisher": []map[string]any{ { - "_docID": testUtils.NewDocIndex(2, 2), - "name": "Only Publisher of Painted House", + "_docID": testUtils.NewDocIndex(2, 1), + "name": "Only Publisher of Theif Lord", }, }, }, @@ -247,20 +261,6 @@ func TestOneToManyToManyJoinsAreLinkedProperly(t *testing.T) { }, }, }, - { - "_docID": testUtils.NewDocIndex(1, 5), - "name": "Sooley", - "publisher": []map[string]any{ - { - "_docID": testUtils.NewDocIndex(2, 5), - "name": "Second of Two Publishers of Sooley", - }, - { - "_docID": testUtils.NewDocIndex(2, 4), - "name": "First of Two Publishers of Sooley", - }, - }, - }, }, }, }, diff --git a/tests/integration/query/one_to_many_to_one/fixture.go b/tests/integration/query/one_to_many_to_one/fixture.go index ac66aa098d..9fe62d6776 100644 --- a/tests/integration/query/one_to_many_to_one/fixture.go +++ b/tests/integration/query/one_to_many_to_one/fixture.go @@ -84,7 +84,7 @@ func createDocsWith6BooksAnd5Publishers() []testUtils.CreateDoc { }, { CollectionID: 1, - // "bae-7697f14d-7b32-5884-8677-344e183c14bf", Has 1 Publisher + // "bae-86f7a96a-be15-5b4d-91c7-bb6047aa4008", Has 1 Publisher DocMap: map[string]any{ "name": "Theif Lord", "rating": 4.8, @@ -93,7 +93,7 @@ func createDocsWith6BooksAnd5Publishers() []testUtils.CreateDoc { }, { CollectionID: 1, - // "bae-374998e0-e84d-5f6b-9e87-5edaaa2d9c7d", Has no Publisher. + // "bae-5ce5698b-5af6-5f50-a6fb-633252be8d12", Has no Publisher. DocMap: map[string]any{ "name": "The Associate", "rating": 4.2, @@ -102,7 +102,7 @@ func createDocsWith6BooksAnd5Publishers() []testUtils.CreateDoc { }, { CollectionID: 1, - // "bae-aef1d940-5ac1-5924-a87f-63ac40758b22", Has 1 Publisher + // "bae-d890c705-8a7a-57ce-88b1-ddd7827438ea", Has 1 Publisher DocMap: map[string]any{ "name": "Painted House", "rating": 4.9, @@ -111,7 +111,7 @@ func createDocsWith6BooksAnd5Publishers() []testUtils.CreateDoc { }, { CollectionID: 1, - // "bae-1d0dcbed-300a-567a-9b48-c23cd026d165", Has 1 Publisher + // "bae-fc61b19e-646a-5537-82d6-69259e4f959a", Has 1 Publisher DocMap: map[string]any{ "name": "A Time for Mercy", "rating": 4.5, @@ -120,7 +120,7 @@ func createDocsWith6BooksAnd5Publishers() []testUtils.CreateDoc { }, { CollectionID: 1, - // "bae-ee6b8339-8a9e-58a9-9a0d-dbd8d44fa149", Has 1 Publisher + // "bae-fc9f77fd-7b26-58c3-ad29-b2bd58a877be", Has 1 Publisher DocMap: map[string]any{ "name": "Sooley", "rating": 3.2, diff --git a/tests/integration/query/one_to_many_to_one/joins_test.go b/tests/integration/query/one_to_many_to_one/joins_test.go index 1699096357..9dc921f18f 100644 --- a/tests/integration/query/one_to_many_to_one/joins_test.go +++ b/tests/integration/query/one_to_many_to_one/joins_test.go @@ -177,39 +177,39 @@ func TestOneToManyToOneJoinsAreLinkedProperly(t *testing.T) { "_docID": "bae-7aabc9d2-fbbc-5911-b0d0-b49a2a1d0e84", "book": []map[string]any{ { - "_docID": "bae-1d0dcbed-300a-567a-9b48-c23cd026d165", - "name": "A Time for Mercy", - "publisher": map[string]any{ - "_docID": "bae-2bad7de3-0f1a-56c0-b499-a552debef4b8", - "name": "Only Publisher of A Time for Mercy", - }, - }, - { - "_docID": "bae-374998e0-e84d-5f6b-9e87-5edaaa2d9c7d", + "_docID": "bae-5ce5698b-5af6-5f50-a6fb-633252be8d12", "name": "The Associate", "publisher": nil, }, { - "_docID": "bae-7697f14d-7b32-5884-8677-344e183c14bf", + "_docID": "bae-86f7a96a-be15-5b4d-91c7-bb6047aa4008", "name": "Theif Lord", "publisher": map[string]any{ - "_docID": "bae-d43823c0-0bb6-58a9-a098-1826dffa4e4a", + "_docID": "bae-6223fba1-5461-5e47-9682-6c769c8e5518", "name": "Only Publisher of Theif Lord", }, }, { - "_docID": "bae-aef1d940-5ac1-5924-a87f-63ac40758b22", + "_docID": "bae-d890c705-8a7a-57ce-88b1-ddd7827438ea", "name": "Painted House", "publisher": map[string]any{ - "_docID": "bae-a104397b-7804-5cd0-93e5-c3986b4e5e71", + "_docID": "bae-de7d087b-d33f-5b4b-b0e4-79de4335d9ed", "name": "Only Publisher of Painted House", }, }, { - "_docID": "bae-ee6b8339-8a9e-58a9-9a0d-dbd8d44fa149", + "_docID": "bae-fc61b19e-646a-5537-82d6-69259e4f959a", + "name": "A Time for Mercy", + "publisher": map[string]any{ + "_docID": "bae-5fd29915-86c6-5e9f-863a-a03292206b8c", + "name": "Only Publisher of A Time for Mercy", + }, + }, + { + "_docID": "bae-fc9f77fd-7b26-58c3-ad29-b2bd58a877be", "name": "Sooley", "publisher": map[string]any{ - "_docID": "bae-efeca601-cce1-5289-b392-85fa5b7bc0f7", + "_docID": "bae-e2cc19bd-4b3e-5cbe-9146-fb24f5913566", "name": "Only Publisher of Sooley", }, }, @@ -220,10 +220,10 @@ func TestOneToManyToOneJoinsAreLinkedProperly(t *testing.T) { "_docID": "bae-fb2a1852-3951-5ce9-a3bf-6825202f201b", "book": []map[string]any{ { - "_docID": "bae-1867d7cb-01b3-572f-a993-1c3f22f46526", + "_docID": "bae-5a5ef6dd-0c2b-5cd0-a644-f0c47a640565", "name": "The Rooster Bar", "publisher": map[string]any{ - "_docID": "bae-09af7e39-8596-584f-8825-cb430c4156b3", + "_docID": "bae-0020b43b-500c-57d0-81b3-43342c9d8d1d", "name": "Only Publisher of The Rooster Bar", }, }, diff --git a/tests/integration/query/one_to_many_to_one/simple_test.go b/tests/integration/query/one_to_many_to_one/simple_test.go index da6206c1e7..d87d3d7f23 100644 --- a/tests/integration/query/one_to_many_to_one/simple_test.go +++ b/tests/integration/query/one_to_many_to_one/simple_test.go @@ -61,7 +61,7 @@ func TestQueryOneToOneRelations(t *testing.T) { }, testUtils.CreateDoc{ CollectionID: 1, - // "bae-7697f14d-7b32-5884-8677-344e183c14bf", Has 1 Publisher + // "bae-86f7a96a-be15-5b4d-91c7-bb6047aa4008", Has 1 Publisher DocMap: map[string]any{ "name": "Theif Lord", "rating": 4.8, @@ -70,7 +70,7 @@ func TestQueryOneToOneRelations(t *testing.T) { }, testUtils.CreateDoc{ CollectionID: 1, - // "bae-374998e0-e84d-5f6b-9e87-5edaaa2d9c7d", Has no Publisher. + // "bae-5ce5698b-5af6-5f50-a6fb-633252be8d12", Has no Publisher. DocMap: map[string]any{ "name": "The Associate", "rating": 4.2, diff --git a/tests/integration/query/one_to_many_to_one/with_filter_test.go b/tests/integration/query/one_to_many_to_one/with_filter_test.go index 147f71f790..07f4400091 100644 --- a/tests/integration/query/one_to_many_to_one/with_filter_test.go +++ b/tests/integration/query/one_to_many_to_one/with_filter_test.go @@ -241,12 +241,6 @@ func TestOneToManyToOneWithTwoLevelDeepFilter(t *testing.T) { "Author": []map[string]any{ { "book": []map[string]any{ - { - "name": "A Time for Mercy", - "publisher": map[string]any{ - "yearOpened": int64(2013), - }, - }, { "name": "The Associate", "publisher": nil, @@ -263,6 +257,12 @@ func TestOneToManyToOneWithTwoLevelDeepFilter(t *testing.T) { "yearOpened": int64(1995), }, }, + { + "name": "A Time for Mercy", + "publisher": map[string]any{ + "yearOpened": int64(2013), + }, + }, { "name": "Sooley", "publisher": map[string]any{ diff --git a/tests/integration/query/one_to_one/simple_test.go b/tests/integration/query/one_to_one/simple_test.go index 4433c3ff9c..91ad7265af 100644 --- a/tests/integration/query/one_to_one/simple_test.go +++ b/tests/integration/query/one_to_one/simple_test.go @@ -257,15 +257,15 @@ func TestQueryOneToOneWithMultipleRecordsSecondaryDirection(t *testing.T) { Results: map[string]any{ "Author": []map[string]any{ { - "name": "Cornelia Funke", + "name": "John Grisham", "published": map[string]any{ - "name": "Theif Lord", + "name": "Painted House", }, }, { - "name": "John Grisham", + "name": "Cornelia Funke", "published": map[string]any{ - "name": "Painted House", + "name": "Theif Lord", }, }, }, @@ -437,7 +437,7 @@ func TestQueryOneToOne_WithRelationIDFromSecondarySide(t *testing.T) { "Book": []map[string]any{ { "name": "Painted House", - "author_id": "bae-420e72a6-e0c6-5a06-a958-2cc7adb7b3d0", + "author_id": "bae-35fc1c36-4347-5bf4-a41f-bf676b145075", }, }, }, diff --git a/tests/integration/query/one_to_one/with_clashing_id_field_test.go b/tests/integration/query/one_to_one/with_clashing_id_field_test.go index 077416084f..9097b80b4b 100644 --- a/tests/integration/query/one_to_one/with_clashing_id_field_test.go +++ b/tests/integration/query/one_to_one/with_clashing_id_field_test.go @@ -63,7 +63,7 @@ func TestQueryOneToOneWithClashingIdFieldOnSecondary(t *testing.T) { "Book": []map[string]any{ { "name": "Painted House", - "author_id": "bae-1a0405fa-e17d-5b0f-8fe2-eb966938df1c", + "author_id": "bae-5da9ad38-0a01-51ad-b54f-43eb9288d4f5", "author": map[string]any{ "name": "John Grisham", }, diff --git a/tests/integration/query/one_to_one/with_group_related_id_alias_test.go b/tests/integration/query/one_to_one/with_group_related_id_alias_test.go index 9def4654f4..0ae9548536 100644 --- a/tests/integration/query/one_to_one/with_group_related_id_alias_test.go +++ b/tests/integration/query/one_to_one/with_group_related_id_alias_test.go @@ -74,7 +74,7 @@ func TestQueryOneToOneWithGroupRelatedIDAlias(t *testing.T) { Results: map[string]any{ "Book": []map[string]any{ { - "author_id": "bae-077b5e8d-5a86-5ae7-a321-ac7e423bb260", + "author_id": "bae-fc7bf08d-9117-5acd-8b49-bc7431b1b238", "author": map[string]any{ "name": "John Grisham", }, @@ -85,7 +85,7 @@ func TestQueryOneToOneWithGroupRelatedIDAlias(t *testing.T) { }, }, { - "author_id": "bae-b11e00fc-340f-558b-909d-2ab94601570b", + "author_id": "bae-fcb12812-4c38-574e-bc8b-91b37ee6cd9b", "author": map[string]any{ "name": "Andrew Lone", }, @@ -156,10 +156,10 @@ func TestQueryOneToOneWithGroupRelatedIDAliasFromSecondaryWithoutInnerGroup(t *t Results: map[string]any{ "Book": []map[string]any{ { - "author_id": "bae-3c308f94-dc9e-5262-b0ce-ef4e8e545820", + "author_id": "bae-23a33112-7345-52f1-8816-0481747645f2", }, { - "author_id": "bae-420e72a6-e0c6-5a06-a958-2cc7adb7b3d0", + "author_id": "bae-35fc1c36-4347-5bf4-a41f-bf676b145075", }, }, }, @@ -225,13 +225,13 @@ func TestQueryOneToOneWithGroupRelatedIDAliasFromSecondaryWithoutInnerGroupWithJ Results: map[string]any{ "Book": []map[string]any{ { - "author_id": "bae-3c308f94-dc9e-5262-b0ce-ef4e8e545820", + "author_id": "bae-23a33112-7345-52f1-8816-0481747645f2", "author": map[string]any{ "name": "Andrew Lone", }, }, { - "author_id": "bae-420e72a6-e0c6-5a06-a958-2cc7adb7b3d0", + "author_id": "bae-35fc1c36-4347-5bf4-a41f-bf676b145075", "author": map[string]any{ "name": "John Grisham", }, @@ -300,7 +300,7 @@ func TestQueryOneToOneWithGroupRelatedIDAliasFromSecondaryWithInnerGroup(t *test Results: map[string]any{ "Book": []map[string]any{ { - "author_id": "bae-3c308f94-dc9e-5262-b0ce-ef4e8e545820", + "author_id": "bae-23a33112-7345-52f1-8816-0481747645f2", "_group": []map[string]any{ { "name": "Go Guide for Rust developers", @@ -308,7 +308,7 @@ func TestQueryOneToOneWithGroupRelatedIDAliasFromSecondaryWithInnerGroup(t *test }, }, { - "author_id": "bae-420e72a6-e0c6-5a06-a958-2cc7adb7b3d0", + "author_id": "bae-35fc1c36-4347-5bf4-a41f-bf676b145075", "_group": []map[string]any{ { "name": "Painted House", @@ -382,7 +382,7 @@ func TestQueryOneToOneWithGroupRelatedIDAliasFromSecondaryWithInnerGroupWithJoin Results: map[string]any{ "Book": []map[string]any{ { - "author_id": "bae-3c308f94-dc9e-5262-b0ce-ef4e8e545820", + "author_id": "bae-23a33112-7345-52f1-8816-0481747645f2", "author": map[string]any{ "name": "Andrew Lone", }, @@ -393,7 +393,7 @@ func TestQueryOneToOneWithGroupRelatedIDAliasFromSecondaryWithInnerGroupWithJoin }, }, { - "author_id": "bae-420e72a6-e0c6-5a06-a958-2cc7adb7b3d0", + "author_id": "bae-35fc1c36-4347-5bf4-a41f-bf676b145075", "author": map[string]any{ "name": "John Grisham", }, diff --git a/tests/integration/query/one_to_one/with_group_related_id_test.go b/tests/integration/query/one_to_one/with_group_related_id_test.go index 7607965203..5b1aa09dce 100644 --- a/tests/integration/query/one_to_one/with_group_related_id_test.go +++ b/tests/integration/query/one_to_one/with_group_related_id_test.go @@ -71,7 +71,7 @@ func TestQueryOneToOneWithGroupRelatedID(t *testing.T) { Results: map[string]any{ "Book": []map[string]any{ { - "author_id": "bae-077b5e8d-5a86-5ae7-a321-ac7e423bb260", + "author_id": "bae-fc7bf08d-9117-5acd-8b49-bc7431b1b238", "_group": []map[string]any{ { "name": "Painted House", @@ -79,7 +79,7 @@ func TestQueryOneToOneWithGroupRelatedID(t *testing.T) { }, }, { - "author_id": "bae-cfee1ed9-ede8-5b80-a6fa-78c727a076ac", + "author_id": "bae-f2dcf043-d24d-5885-9a0a-60196094c782", "_group": []map[string]any{ { "name": "Go Guide for Rust developers", @@ -147,10 +147,10 @@ func TestQueryOneToOneWithGroupRelatedIDFromSecondaryWithoutGroup(t *testing.T) Results: map[string]any{ "Book": []map[string]any{ { - "author_id": "bae-3c308f94-dc9e-5262-b0ce-ef4e8e545820", + "author_id": "bae-23a33112-7345-52f1-8816-0481747645f2", }, { - "author_id": "bae-420e72a6-e0c6-5a06-a958-2cc7adb7b3d0", + "author_id": "bae-35fc1c36-4347-5bf4-a41f-bf676b145075", }, }, }, @@ -216,13 +216,13 @@ func TestQueryOneToOneWithGroupRelatedIDFromSecondaryWithoutGroupWithJoin(t *tes Results: map[string]any{ "Book": []map[string]any{ { - "author_id": "bae-3c308f94-dc9e-5262-b0ce-ef4e8e545820", + "author_id": "bae-23a33112-7345-52f1-8816-0481747645f2", "author": map[string]any{ "name": "Andrew Lone", }, }, { - "author_id": "bae-420e72a6-e0c6-5a06-a958-2cc7adb7b3d0", + "author_id": "bae-35fc1c36-4347-5bf4-a41f-bf676b145075", "author": map[string]any{ "name": "John Grisham", }, @@ -291,7 +291,7 @@ func TestQueryOneToOneWithGroupRelatedIDFromSecondaryWithGroup(t *testing.T) { Results: map[string]any{ "Book": []map[string]any{ { - "author_id": "bae-bb4d6e89-e8b4-5eec-bfeb-6f7aa4840950", + "author_id": "bae-b6aedb41-3a00-54dd-9a84-78d0654dbc42", "_group": []map[string]any{ { "name": "Go Guide for Rust developers", @@ -299,7 +299,7 @@ func TestQueryOneToOneWithGroupRelatedIDFromSecondaryWithGroup(t *testing.T) { }, }, { - "author_id": "bae-420e72a6-e0c6-5a06-a958-2cc7adb7b3d0", + "author_id": "bae-35fc1c36-4347-5bf4-a41f-bf676b145075", "_group": []map[string]any{ { "name": "Painted House", @@ -373,7 +373,7 @@ func TestQueryOneToOneWithGroupRelatedIDFromSecondaryWithGroupWithJoin(t *testin Results: map[string]any{ "Book": []map[string]any{ { - "author_id": "bae-3c308f94-dc9e-5262-b0ce-ef4e8e545820", + "author_id": "bae-23a33112-7345-52f1-8816-0481747645f2", "author": map[string]any{ "name": "Andrew Lone", }, @@ -384,7 +384,7 @@ func TestQueryOneToOneWithGroupRelatedIDFromSecondaryWithGroupWithJoin(t *testin }, }, { - "author_id": "bae-420e72a6-e0c6-5a06-a958-2cc7adb7b3d0", + "author_id": "bae-35fc1c36-4347-5bf4-a41f-bf676b145075", "author": map[string]any{ "name": "John Grisham", }, diff --git a/tests/integration/query/one_to_one_multiple/simple_test.go b/tests/integration/query/one_to_one_multiple/simple_test.go index 66b823138a..4696db5dcf 100644 --- a/tests/integration/query/one_to_one_multiple/simple_test.go +++ b/tests/integration/query/one_to_one_multiple/simple_test.go @@ -302,21 +302,21 @@ func TestQueryOneToOneMultiple_FromSecondary(t *testing.T) { Results: map[string]any{ "Book": []map[string]any{ { - "name": "Painted House", + "name": "Theif Lord", "publisher": map[string]any{ - "name": "Old Publisher", + "name": "New Publisher", }, "author": map[string]any{ - "name": "John Grisham", + "name": "Cornelia Funke", }, }, { - "name": "Theif Lord", + "name": "Painted House", "publisher": map[string]any{ - "name": "New Publisher", + "name": "Old Publisher", }, "author": map[string]any{ - "name": "Cornelia Funke", + "name": "John Grisham", }, }, }, diff --git a/tests/integration/query/one_to_one_to_one/simple_test.go b/tests/integration/query/one_to_one_to_one/simple_test.go index bb054c4380..0486d3db77 100644 --- a/tests/integration/query/one_to_one_to_one/simple_test.go +++ b/tests/integration/query/one_to_one_to_one/simple_test.go @@ -94,20 +94,20 @@ func TestQueryOneToOneToOne(t *testing.T) { Results: map[string]any{ "Publisher": []map[string]any{ { - "name": "New Publisher", + "name": "Old Publisher", "printed": map[string]any{ - "name": "Theif Lord", + "name": "Painted House", "author": map[string]any{ - "name": "Cornelia Funke", + "name": "John Grisham", }, }, }, { - "name": "Old Publisher", + "name": "New Publisher", "printed": map[string]any{ - "name": "Painted House", + "name": "Theif Lord", "author": map[string]any{ - "name": "John Grisham", + "name": "Cornelia Funke", }, }, }, @@ -302,20 +302,20 @@ func TestQueryOneToOneToOnePrimaryThenSecondary(t *testing.T) { Results: map[string]any{ "Publisher": []map[string]any{ { - "name": "New Publisher", + "name": "Old Publisher", "printed": map[string]any{ - "name": "Theif Lord", + "name": "Painted House", "author": map[string]any{ - "name": "Cornelia Funke", + "name": "John Grisham", }, }, }, { - "name": "Old Publisher", + "name": "New Publisher", "printed": map[string]any{ - "name": "Painted House", + "name": "Theif Lord", "author": map[string]any{ - "name": "John Grisham", + "name": "Cornelia Funke", }, }, }, diff --git a/tests/integration/query/one_to_two_many/simple_test.go b/tests/integration/query/one_to_two_many/simple_test.go index 47e946b6e4..c8106f30a3 100644 --- a/tests/integration/query/one_to_two_many/simple_test.go +++ b/tests/integration/query/one_to_two_many/simple_test.go @@ -97,17 +97,6 @@ func TestQueryOneToTwoManyWithNilUnnamedRelationship_FromOneSide(t *testing.T) { }`, Results: map[string]any{ "Book": []map[string]any{ - { - "name": "Painted House", - "rating": 4.9, - "author": map[string]any{ - "name": "John Grisham", - }, - "reviewedBy": map[string]any{ - "name": "Cornelia Funke", - "age": int64(62), - }, - }, { "name": "A Time for Mercy", "rating": 4.5, @@ -130,6 +119,17 @@ func TestQueryOneToTwoManyWithNilUnnamedRelationship_FromOneSide(t *testing.T) { "age": int64(65), }, }, + { + "name": "Painted House", + "rating": 4.9, + "author": map[string]any{ + "name": "John Grisham", + }, + "reviewedBy": map[string]any{ + "name": "Cornelia Funke", + "age": int64(62), + }, + }, }, }, }, @@ -224,14 +224,14 @@ func TestQueryOneToTwoManyWithNilUnnamedRelationship_FromManySide(t *testing.T) "name": "Cornelia Funke", "age": int64(62), "reviewed": []map[string]any{ - { - "name": "Painted House", - "rating": 4.9, - }, { "name": "A Time for Mercy", "rating": 4.5, }, + { + "name": "Painted House", + "rating": 4.9, + }, }, "written": []map[string]any{ { @@ -250,10 +250,10 @@ func TestQueryOneToTwoManyWithNilUnnamedRelationship_FromManySide(t *testing.T) }, "written": []map[string]any{ { - "name": "Painted House", + "name": "A Time for Mercy", }, { - "name": "A Time for Mercy", + "name": "Painted House", }, }, }, @@ -375,21 +375,6 @@ func TestQueryOneToTwoManyWithNamedAndUnnamedRelationships(t *testing.T) { }`, Results: map[string]any{ "Book": []map[string]any{ - { - "name": "Painted House", - "rating": 4.9, - "author": map[string]any{ - "name": "John Grisham", - }, - "reviewedBy": map[string]any{ - "name": "Cornelia Funke", - "age": int64(62), - }, - "price": map[string]any{ - "currency": "GBP", - "value": 12.99, - }, - }, { "name": "A Time for Mercy", "rating": 4.5, @@ -420,6 +405,21 @@ func TestQueryOneToTwoManyWithNamedAndUnnamedRelationships(t *testing.T) { "value": 12.99, }, }, + { + "name": "Painted House", + "rating": 4.9, + "author": map[string]any{ + "name": "John Grisham", + }, + "reviewedBy": map[string]any{ + "name": "Cornelia Funke", + "age": int64(62), + }, + "price": map[string]any{ + "currency": "GBP", + "value": 12.99, + }, + }, }, }, }, @@ -541,14 +541,14 @@ func TestQueryOneToTwoManyWithNamedAndUnnamedRelationships_FromManySide(t *testi "name": "Cornelia Funke", "age": int64(62), "reviewed": []map[string]any{ - { - "name": "Painted House", - "rating": 4.9, - }, { "name": "A Time for Mercy", "rating": 4.5, }, + { + "name": "Painted House", + "rating": 4.9, + }, }, "written": []map[string]any{ { @@ -570,15 +570,15 @@ func TestQueryOneToTwoManyWithNamedAndUnnamedRelationships_FromManySide(t *testi }, "written": []map[string]any{ { - "name": "Painted House", + "name": "A Time for Mercy", "price": map[string]any{ - "value": 12.99, + "value": float64(129), }, }, { - "name": "A Time for Mercy", + "name": "Painted House", "price": map[string]any{ - "value": float64(129), + "value": 12.99, }, }, }, diff --git a/tests/integration/schema/one_many_test.go b/tests/integration/schema/one_many_test.go index cd7a288f8b..f29d0bf34d 100644 --- a/tests/integration/schema/one_many_test.go +++ b/tests/integration/schema/one_many_test.go @@ -223,8 +223,8 @@ func TestSchemaOneMany_SelfUsingActualName(t *testing.T) { ExpectedResults: []client.SchemaDescription{ { Name: "User", - Root: "bafkreiabowhib7ym6wumgywbc6f747e4u665ddxa5q43povrmjk4rmkzfi", - VersionID: "bafkreiabowhib7ym6wumgywbc6f747e4u665ddxa5q43povrmjk4rmkzfi", + Root: "bafkreifchjktkdtha7vkcqt6itzsw6lnzfyp7ufws4s32e7vigu7akn2q4", + VersionID: "bafkreifchjktkdtha7vkcqt6itzsw6lnzfyp7ufws4s32e7vigu7akn2q4", Fields: []client.SchemaFieldDescription{ { Name: request.DocIDFieldName, diff --git a/tests/integration/schema/one_one_test.go b/tests/integration/schema/one_one_test.go index d0fea6b7a2..425d950804 100644 --- a/tests/integration/schema/one_one_test.go +++ b/tests/integration/schema/one_one_test.go @@ -117,8 +117,8 @@ func TestSchemaOneOne_SelfUsingActualName(t *testing.T) { ExpectedResults: []client.SchemaDescription{ { Name: "User", - Root: "bafkreiabowhib7ym6wumgywbc6f747e4u665ddxa5q43povrmjk4rmkzfi", - VersionID: "bafkreiabowhib7ym6wumgywbc6f747e4u665ddxa5q43povrmjk4rmkzfi", + Root: "bafkreifchjktkdtha7vkcqt6itzsw6lnzfyp7ufws4s32e7vigu7akn2q4", + VersionID: "bafkreifchjktkdtha7vkcqt6itzsw6lnzfyp7ufws4s32e7vigu7akn2q4", Fields: []client.SchemaFieldDescription{ { Name: request.DocIDFieldName,