diff options
author | Luca Casonato <hello@lcas.dev> | 2023-10-31 12:13:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-31 11:13:57 +0000 |
commit | 2d9298f5f5550c21ba218ff7095aa9afe80c7e02 (patch) | |
tree | 6daee1cc6007745097e176c7367b697e58632baf /test_util/src | |
parent | 092555c611ebab87ad570b4dcb73d54288dccdd9 (diff) |
chore: update ext/kv to use denokv_* crates (#20986)
This commit updates the ext/kv module to use the denokv_* crates for
the protocol and the sqlite backend. This also fixes a couple of bugs in
the sqlite backend, and updates versionstamps to be updated less
linearly.
Diffstat (limited to 'test_util/src')
-rw-r--r-- | test_util/src/kv_remote.rs | 7 | ||||
-rw-r--r-- | test_util/src/lib.rs | 19 |
2 files changed, 8 insertions, 18 deletions
diff --git a/test_util/src/kv_remote.rs b/test_util/src/kv_remote.rs deleted file mode 100644 index d258a0551..000000000 --- a/test_util/src/kv_remote.rs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -// Generated code, disable lints -#[allow(clippy::all, non_snake_case)] -pub mod datapath { - include!(concat!(env!("OUT_DIR"), "/datapath.rs")); -} diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs index b7106a2b3..692a6a08c 100644 --- a/test_util/src/lib.rs +++ b/test_util/src/lib.rs @@ -4,6 +4,12 @@ use anyhow::anyhow; use base64::prelude::BASE64_STANDARD; use base64::Engine; +use denokv_proto::datapath::AtomicWrite; +use denokv_proto::datapath::AtomicWriteOutput; +use denokv_proto::datapath::AtomicWriteStatus; +use denokv_proto::datapath::ReadRangeOutput; +use denokv_proto::datapath::SnapshotRead; +use denokv_proto::datapath::SnapshotReadOutput; use futures::Future; use futures::FutureExt; use futures::Stream; @@ -18,12 +24,6 @@ use hyper::Body; use hyper::Request; use hyper::Response; use hyper::StatusCode; -use kv_remote::datapath::AtomicWrite; -use kv_remote::datapath::AtomicWriteOutput; -use kv_remote::datapath::AtomicWriteStatus; -use kv_remote::datapath::ReadRangeOutput; -use kv_remote::datapath::SnapshotRead; -use kv_remote::datapath::SnapshotReadOutput; use npm::CUSTOM_NPM_PACKAGE_CACHE; use once_cell::sync::Lazy; use pretty_assertions::assert_eq; @@ -70,7 +70,6 @@ pub mod assertions; mod builders; pub mod factory; mod fs; -mod kv_remote; pub mod lsp; mod npm; pub mod pty; @@ -1206,7 +1205,7 @@ async fn main_server( .header("content-type", "application/json") .body(Body::from( serde_json::json!({ - "version": 2, + "version": 1000, "databaseId": KV_DATABASE_ID, "endpoints": [ { @@ -1268,9 +1267,7 @@ async fn main_server( .map(|_| ReadRangeOutput { values: vec![] }) .collect(), read_disabled: false, - regions_if_read_disabled: vec![], read_is_strongly_consistent: true, - primary_if_not_strongly_consistent: "".into(), } .encode_to_vec(), )) @@ -1311,7 +1308,7 @@ async fn main_server( AtomicWriteOutput { status: AtomicWriteStatus::AwSuccess.into(), versionstamp: vec![0u8; 10], - primary_if_write_disabled: "".into(), + failed_checks: vec![], } .encode_to_vec(), )) |