Commit Graph

52 Commits

Author SHA1 Message Date
Marek Siarkowicz 5a059075db Serve LISTs with exact RV and continuations from cache
Kubernetes-commit: f82c9e56d928d1028d4b298578f275a2e5e69490
2024-07-03 21:36:51 +02:00
Marek Siarkowicz c59961a007 Test continue with negative RV for reading consistent RV
Kubernetes-commit: 6d21d8f2376b6e25064b10148b4f416e8d89a508
2025-03-17 12:10:54 +01:00
Marek Siarkowicz 6f6da8e97b Add test cases for negative resource version in TestList
Kubernetes-commit: c4d77a07993302057441a886125c1c887e7869f1
2025-03-14 12:22:17 +01:00
Marek Siarkowicz 6ace22f694 Fix flaky RunTestConsistentList
Noticed that cache might not nesseserly observe the write causing test
to flake. Fixed that changing the logic to require LessOrEqual of
writeRV instead of equal to writeRV. Also added comments explaining
edge cases.

Kubernetes-commit: 86169a7a1e09c120cadafc0213afbf9630f0d8af
2025-03-14 13:45:55 +01:00
Marek Siarkowicz 4305a14262 Separate compactWatchCache from increaseRV
Kubernetes-commit: 15cb82b3b3fa95ba5b914a5a02ac01d42eda892f
2025-02-25 14:44:50 +01:00
Marek Siarkowicz 476d81d4ba Test continuations and exact revision LISTs
Kubernetes-commit: 034285dc4774f2217ca4df4626ca44b8f5f4f261
2025-02-18 17:32:41 +01:00
Marek Siarkowicz 1e6e6f0a46 Refactor TestList and validate continuations to allow testing pagination and more exact RVs in the future
Kubernetes-commit: 764e13e27aedfd9e304e6014af23f20b5619216b
2025-02-19 17:10:58 +01:00
Davanum Srinivas 0a703e3517 Linter to ensure go-cmp/cmp is used ONLY in tests
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 4e05bc20db99ff89b2d2205218d24b9935a7fdd7
2025-01-24 17:03:29 -05:00
Abu Kashem fbb5ab0d70 handle watch for unsafe delete
Kubernetes-commit: 25efc8f2d136a9574166be02789ac727c5b4a3fd
2024-11-05 20:36:56 -05:00
Marek Siarkowicz 518e8ed25c Adding tests for using indexers in tests
Kubernetes-commit: 711772a1e15288d813a830780317a134df9acb5c
2024-08-22 20:04:37 +02:00
Abu Kashem 3a0975b22c refactor: add delete options for Delete method in storage interface
Kubernetes-commit: bc0ea34bc380e073a7278216fe6690a1b9aee48c
2024-09-19 10:31:08 -04:00
Marek Siarkowicz 132d3e46d6 Add paging tests
Kubernetes-commit: 99e69569808cf746262b25a9d9d515c26256c7e5
2024-07-07 16:15:47 +02:00
Lukasz Szaszkiewicz f0e44d48b8 apiserver/storage: storagetesting.RunTestList validates RemainingItemCount
Kubernetes-commit: f9b15700fb5a99ab74d51c7779ea2aae0f51168c
2024-06-27 11:01:37 +02:00
Marek Siarkowicz 2abbfffe9a Fix TestGetListRecursivePrefix for all types of LIST
Kubernetes-commit: c207f967ac3122d3a2a5ae4befdc5ada22347323
2024-06-19 10:31:37 +02:00
Marek Siarkowicz a8b9f862fb Add tests for how recursive parameter works with object prefixes
Kubernetes-commit: faa6193f34f7dac775328fbacb2f957370482024
2024-06-11 14:29:51 +02:00
Wojciech Tyczyński fd60fafe9c Deflake watchcache tests
Kubernetes-commit: 6d9edcc694415d4c1a897c4312ecd872a7f0fbf3
2024-04-29 14:26:25 +02:00
Marek Siarkowicz 67b6245fc3 Fix enabling consistent list from watch cache also works for resourceVersion=0
Kubernetes-commit: 0b8e79580eb3a63ca7707626b4894adfb9125586
2024-03-04 19:35:34 +01:00
Marek Siarkowicz 483da2032d Fix non-recursive list when consistent list from cache is enabled
Kubernetes-commit: a527cab9fce0b0234db8b4e1e95a0fc20e135df1
2024-03-04 17:59:04 +01:00
Wojciech Tyczyński 324d2bc3cf Cleanup paging parameters in etcd3 store
Kubernetes-commit: 3f4d3b67682335db510f85deb65b322127a3a0a1
2023-10-20 15:38:59 +02:00
Siyuan Zhang 77032c52b8 k8s.io/apiserver/storage: add 3 new unit tests for delete.
Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: 26a4e06c92c248748dd3c50c74d75f8adc3c6823
2023-10-11 10:38:01 -07:00
Siyuan Zhang 70af178d56 k8s.io/apiserver/storage: add a new TestCreate case.
Add a test case of create with rv set.

Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: 2f923e356e042d9dce88e8f78abf30f414051e71
2023-10-11 10:24:31 -07:00
Siyuan Zhang a0dede6875 k8s.io/apiserver/storage: add some ResourceVersion validation in GetList unit tests
Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: baac8bb573c8efb314b037f4fbac116556c03c83
2023-10-11 10:46:30 -07:00
Lukasz Szaszkiewicz f5adfca95e storage/testing: a simple refactor
Kubernetes-commit: 39af594f312ad46715dfb705d71ad4e607e27e5d
2023-09-14 11:16:10 +02:00
Wojciech Tyczyński f56b9ee7f5 Graduate RemainingItemCount to GA
Kubernetes-commit: 4e2e059c7b205d2e4b246a262128223258a49498
2023-07-21 15:22:51 +02:00
Marek Siarkowicz df9896fd00 Test consistent List
Kubernetes-commit: b36fdd68b72cd5c64ea5be3917846067644da983
2023-07-03 17:22:22 +02:00
Wojciech Tyczyński 68a91d7597 Enable a bunch of generic storage tests for watchcache.
Kubernetes-commit: 88e2c34439016e5feddfed529698ed71e81904d9
2023-04-17 19:03:51 +02:00
Wojciech Tyczyński e4d6a4de7c Deflake TestGetListNonRecursive
Kubernetes-commit: 05f4e497f1d692031b31c27098abc1e838e8814b
2023-03-29 13:46:49 +02:00
Madhav Jivrajani abbe297fc8 storage: Get rid of TestListDeprecated
This commit extends the test cases of RunTestList
to include the things tested by TestListDeprecated
and subsequently deletes the test.

This additionally adds a test case for checking that
the list return the modified version of an object.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: 7474d9b719619caa356dfb71a06482f33b3ed1ce
2023-02-15 16:54:10 +05:30
Madhav Jivrajani 5544d5836e storage/testing: Use Int64 method for pointers
Int64Ptr is now deprecated.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: 1d639085eeef74ee7582a8944154a18f58d13a7b
2023-02-15 15:21:42 +05:30
Wojciech Tyczyński 8808b718c9 Explicit sorting in TestList storage test
Kubernetes-commit: 34de5fa73dabd9dcbd6f535cf6a853371ec653f1
2022-11-21 12:03:54 +01:00
Wojciech Tyczyński 299c158ba3 Reuse generic List test for watchcache
Kubernetes-commit: ef8c4fbca8e5bed1e7edc162b95c412a7f1a758e
2022-11-04 22:01:37 +01:00
Wojciech Tyczyński 8cd19efa73 Fix inconsistency in returning list results both in etcd3 and watchcache
Kubernetes-commit: da8d197a7205c01fdf376246995b0a1b3ab53859
2022-11-08 11:47:28 +01:00
Tim Allclair 3268b0561b Validate etcd paths
Kubernetes-commit: f1693a02c46f79f8c90a4ef17c4a750034f21484
2022-10-10 18:15:22 -07:00
Wojciech Tyczyński 0ed87195b0 Standardize naming in generic storage tests
Kubernetes-commit: e49c225eb9e7c428aca97e8031089e7ad91ca7c4
2022-11-05 12:14:56 +01:00
Wojciech Tyczyński 82397f8421 Fix naming in storage test setup
Kubernetes-commit: 1bc95675b19c68807ed3ae45a24701fc5c2fb935
2022-11-04 15:37:47 +01:00
Wojciech Tyczyński c51bbc3183 Parallelize tests cases in some storage tests
Kubernetes-commit: 6d85f947bf86d12e4459d31029c41d6049d40c0e
2022-11-04 10:23:40 +01:00
Wojciech Tyczyński 44c802979e Reuse generic ListNonRecurisve test for cacher
Kubernetes-commit: e301306d89a69ff1a328a4ae3fa39a9e3deb022e
2022-11-03 14:58:34 +01:00
Wojciech Tyczyński b312c7eb5b Stop exporting storage testing utility functions
Kubernetes-commit: 37db332298fc6d14a798f610ce6049792299f0b1
2022-11-03 08:47:38 +01:00
Wojciech Tyczyński c38aa93533 Reuse generic TestGet in cache tests.
Kubernetes-commit: 75a1ef87b32213a7d3d1c2027dd515e4f74c1777
2022-10-27 16:00:30 +02:00
Wojciech Tyczyński 07db92af49 Fix setting resource version on deletion
Kubernetes-commit: bbcf5e38776f2b18026539a0fbcf3aa505386c1f
2022-10-26 21:37:19 +02:00
Wojciech Tyczyński 3f5a3e0ae0 Refactor etcd3 list consistency test
Kubernetes-commit: cd5da36c92f3ed52debc22c39a7cd9d369b0eecd
2022-10-27 10:19:09 +02:00
Wojciech Tyczyński f6802e074e Refactor storage tests using compaction
Kubernetes-commit: b02f172cbdf7e824d13a6a9c3a9b9fe4f3f92afb
2022-10-26 20:47:19 +02:00
Wojciech Tyczyński 834cf0fc14 Refactor compaction in etcd3 tests
Kubernetes-commit: 7da7ddd779f9ea835f0c57deae05e050c543066b
2022-10-26 16:34:28 +02:00
Wojciech Tyczyński 73a664638b Refactor pagination tests
Kubernetes-commit: 6c8ce894e18a2e2cae20edd2f6e79db9407ebce3
2022-10-26 12:18:21 +02:00
Wojciech Tyczyński 5a8fdf8480 Move GuaranteedUpdateChecksData test to generic package
Kubernetes-commit: afc5ded83931cdb8a2643486d6834eb8d9b04588
2022-10-25 14:31:20 +02:00
Wojciech Tyczyński d9a3685d6f Minor cleanup of storage tests
Kubernetes-commit: 5344bc5e1b7e50d5ff359c714d522b421b28bd12
2022-10-25 14:09:36 +02:00
Wojciech Tyczyński 1960fa837f Move GuaranteedUpdate test to generic test package
Kubernetes-commit: 012676acc3dd2b235bd601e4105294d2715f155b
2022-10-25 14:04:00 +02:00
Steve Kuznetsov 03363cd42b storage: move some list tests to generic package
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: 162450c01c9004ded53bb77f651f9a3f30920b30
2022-05-12 15:16:07 -07:00
Steve Kuznetsov 6bff431f4a storage: move test utiltiies out of test files
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: e50cb6c8d36ca73c99c935126978cbec01f9be01
2022-05-12 11:52:28 -07:00
Steve Kuznetsov 67344c728d storage: move continue token definition to storage
The means by which we encode and decode the continue token during a
paginated LIST call is not specific to etcd3. In order to allow for a
generic suite of tests against any storage.Interface implementation, we
need this logic to live outside of the etcd3 package, or import cycles
will exist.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: eb3aa5be10393968d8083c79f5958501fc029e8d
2022-05-11 07:52:02 -07:00