Commit ceaff7e
authored
fix: Address edge cases for excluding large properties when using save (googleapis#1356)
* fix: The save function should not throw an error for name/value properties in arrays (googleapis#1336)
* Add some test cases for findLargeProperties_
* Add a test for arrays and skip it.
* Add a test for the complex case wrapped in an arra
* Add a test case for an array without name/value.
* Add another test for name/value pair
* Change the test case involving a name/value pair
* Add two simple test cases for excludeFromIndexes
* Add another unit test for findLargeProperties_
* Remove if block that stops recursion
* Add a test for save with a `name/value` pair
* Add some test code that ensures name/value encoded
Against the current source code, this test fails because the code throws an error, but it should pass.
* Add header
* Remove only
* Add a test that saves a long string value property
* Add a unit test checking longString for value
* Remove only
* TODO is done
* refactor: Add separate function for adding large properties to the excludeFromIndexes list (googleapis#1349)
* Add some test cases for findLargeProperties_
* Add a test for arrays and skip it.
* Add a test for the complex case wrapped in an arra
* Add a test case for an array without name/value.
* Add another test for name/value pair
* Change the test case involving a name/value pair
* Add two simple test cases for excludeFromIndexes
* Add another unit test for findLargeProperties_
* Remove if block that stops recursion
* Add a test for save with a `name/value` pair
* Add some test code that ensures name/value encoded
Against the current source code, this test fails because the code throws an error, but it should pass.
* Add header
* Remove only
* Add a test that saves a long string value property
* Add a unit test checking longString for value
* Remove only
* TODO is done
* Refactor the save function
Pull out the code that extends the excludeFromIndexes list
* Add TODO
* Write unit tests for the new excludeFromIndexes fn
* Add the header
* Document parameter for extendExcludeFromIndexes
* Remove redundant check
* refactor: Add a separate function for building the entity proto (googleapis#1350)
* Add some test cases for findLargeProperties_
* Add a test for arrays and skip it.
* Add a test for the complex case wrapped in an arra
* Add a test case for an array without name/value.
* Add another test for name/value pair
* Change the test case involving a name/value pair
* Add two simple test cases for excludeFromIndexes
* Add another unit test for findLargeProperties_
* Remove if block that stops recursion
* Add a test for save with a `name/value` pair
* Add some test code that ensures name/value encoded
Against the current source code, this test fails because the code throws an error, but it should pass.
* Add header
* Remove only
* Add a test that saves a long string value property
* Add a unit test checking longString for value
* Remove only
* TODO is done
* Refactor the save function
Pull out the code that extends the excludeFromIndexes list
* Add TODO
* Write unit tests for the new excludeFromIndexes fn
* Add the header
* Refactor the code for building the entity proto
* Rename it buildEntityProto
* The tests need another mock due to the structure
The structure change requires another mock.
* First two tests for buildEntityProto
* Reintroduce extendExcludeFromIndexes.ts tests
* Adjust the test to match expected proto
* Add another test for an entity in an array
* Add headers
* Add another header
* Eliminate space. Simplify diff
* test: Ensure that using extendExcludeFromIndexes and then buildEntityProto always excludes large properties from indexing (googleapis#1355)
* Add some test cases for findLargeProperties_
* Add a test for arrays and skip it.
* Add a test for the complex case wrapped in an arra
* Add a test case for an array without name/value.
* Add another test for name/value pair
* Change the test case involving a name/value pair
* Add two simple test cases for excludeFromIndexes
* Add another unit test for findLargeProperties_
* Remove if block that stops recursion
* Add a test for save with a `name/value` pair
* Add some test code that ensures name/value encoded
Against the current source code, this test fails because the code throws an error, but it should pass.
* Add header
* Remove only
* Add a test that saves a long string value property
* Add a unit test checking longString for value
* Remove only
* TODO is done
* Refactor the save function
Pull out the code that extends the excludeFromIndexes list
* Add TODO
* Write unit tests for the new excludeFromIndexes fn
* Add the header
* Refactor the code for building the entity proto
* Rename it buildEntityProto
* The tests need another mock due to the structure
The structure change requires another mock.
* First two tests for buildEntityProto
* Reintroduce extendExcludeFromIndexes.ts tests
* Adjust the test to match expected proto
* Add another test for an entity in an array
* Add headers
* Add another header
* Add some tests for checkEntityProto
Make sure that checkEntityProto is working correctly.
* Empty commit
* Pull out complexCaseEntities
* Add a few more tests to excludeIndexesAndBuildProto
* Add generated test cases ensuring completeness
* Add a few comments that explain behaviour of block
* Add comments explaining code blocks
* Add a bunch of other generated tests
* Make this test more meaningful for name/value chek
* Fix the generator
* Remove console logs
* Add better test name descriptions
* Add TODO
* Add a comment about the array of arrays test case
* Increase the max depth
* Add headers to the codebase
* Update parameter descriptions
* Add a bunch of parameter documentation
Correct only as well.1 parent 536873e commit ceaff7e
File tree
14 files changed
+1523
-536
lines changed- src
- utils/entity
- system-test
- test
- entity
- fixtures
- gapic-mocks
14 files changed
+1523
-536
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1000 | 1000 | | |
1001 | 1001 | | |
1002 | 1002 | | |
1003 | | - | |
1004 | | - | |
1005 | | - | |
1006 | | - | |
1007 | | - | |
1008 | | - | |
1009 | | - | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
1013 | 1003 | | |
1014 | 1004 | | |
1015 | 1005 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
73 | | - | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
1098 | 1099 | | |
1099 | 1100 | | |
1100 | 1101 | | |
1101 | | - | |
1102 | 1102 | | |
1103 | 1103 | | |
1104 | 1104 | | |
| |||
1115 | 1115 | | |
1116 | 1116 | | |
1117 | 1117 | | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
1124 | | - | |
1125 | | - | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
1129 | | - | |
1130 | | - | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
1137 | | - | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
1147 | | - | |
1148 | | - | |
1149 | | - | |
1150 | | - | |
1151 | | - | |
1152 | | - | |
1153 | | - | |
1154 | | - | |
1155 | | - | |
1156 | | - | |
1157 | | - | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
1175 | | - | |
1176 | | - | |
1177 | | - | |
1178 | | - | |
1179 | | - | |
1180 | | - | |
1181 | | - | |
| 1118 | + | |
| 1119 | + | |
1182 | 1120 | | |
1183 | 1121 | | |
1184 | 1122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
351 | 382 | | |
352 | 383 | | |
353 | 384 | | |
| |||
0 commit comments