diff --git a/cli/tests/integration/object_store.rs b/cli/tests/integration/kv_store.rs similarity index 61% rename from cli/tests/integration/object_store.rs rename to cli/tests/integration/kv_store.rs index d582dcb6..5ad0cc27 100644 --- a/cli/tests/integration/object_store.rs +++ b/cli/tests/integration/kv_store.rs @@ -2,7 +2,37 @@ use crate::common::{Test, TestResult}; use hyper::{body::to_bytes, StatusCode}; #[tokio::test(flavor = "multi_thread")] -async fn object_store() -> TestResult { +async fn kv_store() -> TestResult { + const FASTLY_TOML: &str = r#" + name = "kv-store-test" + description = "kv store test" + authors = ["Jill Bryson ", "Rose McDowall "] + language = "rust" + [local_server] + kv_stores.empty_store = [] + kv_stores.store_one = [{key = "first", data = "This is some data"},{key = "second", file = "../test-fixtures/data/kv-store.txt"}] + "#; + + let resp = Test::using_fixture("kv_store.wasm") + .using_fastly_toml(FASTLY_TOML)? + .against_empty() + .await; + + assert_eq!(resp.status(), StatusCode::OK); + assert!(to_bytes(resp.into_body()) + .await + .expect("can read body") + .to_vec() + .is_empty()); + + Ok(()) +} + +#[tokio::test(flavor = "multi_thread")] +async fn object_stores_backward_compat() -> TestResult { + // Previously the "kv_stores" key was named "object_stores" and + // the "file" key was named "path". This test ensures that both + // still work. const FASTLY_TOML: &str = r#" name = "object-store-test" description = "object store test" @@ -10,10 +40,10 @@ async fn object_store() -> TestResult { language = "rust" [local_server] object_stores.empty_store = [] - object_stores.store_one = [{key = "first", data = "This is some data"},{key = "second", file = "../test-fixtures/data/object-store.txt"}] + object_stores.store_one = [{key = "first", data = "This is some data"},{key = "second", path = "../test-fixtures/data/kv-store.txt"}] "#; - let resp = Test::using_fixture("object_store.wasm") + let resp = Test::using_fixture("kv_store.wasm") .using_fastly_toml(FASTLY_TOML)? .against_empty() .await; @@ -27,7 +57,6 @@ async fn object_store() -> TestResult { Ok(()) } - #[tokio::test(flavor = "multi_thread")] async fn object_store_backward_compat() -> TestResult { // Previously the "object_stores" key was named "object_store" and @@ -40,10 +69,10 @@ async fn object_store_backward_compat() -> TestResult { language = "rust" [local_server] object_store.empty_store = [] - object_store.store_one = [{key = "first", data = "This is some data"},{key = "second", path = "../test-fixtures/data/object-store.txt"}] + object_store.store_one = [{key = "first", data = "This is some data"},{key = "second", path = "../test-fixtures/data/kv-store.txt"}] "#; - let resp = Test::using_fixture("object_store.wasm") + let resp = Test::using_fixture("kv_store.wasm") .using_fastly_toml(FASTLY_TOML)? .against_empty() .await; @@ -59,16 +88,16 @@ async fn object_store_backward_compat() -> TestResult { } #[tokio::test(flavor = "multi_thread")] -async fn object_store_bad_configs() -> TestResult { +async fn kv_store_bad_configs() -> TestResult { const BAD_1_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = 3, data = "This is some data"}] + kv_stores.store_one = [{key = 3, data = "This is some data"}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_1_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_1_FASTLY_TOML) { Err(e) => assert_eq!( "invalid configuration for 'store_one': The `key` value for an object is not a string.", &e.to_string() @@ -77,51 +106,51 @@ async fn object_store_bad_configs() -> TestResult { } const BAD_2_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = "first", data = 3}] + kv_stores.store_one = [{key = "first", data = 3}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_2_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_2_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': The `data` value for the object `first` is not a string.", &e.to_string()), _ => panic!(), } const BAD_3_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = "first", data = "This is some data", file = "../test-fixtures/data/object-store.txt"}] + kv_stores.store_one = [{key = "first", data = "This is some data", file = "../test-fixtures/data/kv-store.txt"}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_3_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_3_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': The `file` and `data` keys for the object `first` are set. Only one can be used.", &e.to_string()), _ => panic!(), } const BAD_4_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = "first", file = 3}] + kv_stores.store_one = [{key = "first", file = 3}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_4_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_4_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': The `file` value for the object `first` is not a string.", &e.to_string()), _ => panic!(), } const BAD_5_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = "first", file = "../path/does/not/exist"}] + kv_stores.store_one = [{key = "first", file = "../path/does/not/exist"}] "#; // For CI to pass we need to include the specific message for each platform @@ -135,59 +164,59 @@ async fn object_store_bad_configs() -> TestResult { #[cfg(target_os = "windows")] let invalid_path_message = "invalid configuration for 'store_one': The system cannot find the path specified. (os error 3)"; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_5_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_5_FASTLY_TOML) { Err(e) => assert_eq!(invalid_path_message, &e.to_string()), _ => panic!(), } const BAD_6_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = "first"}] + kv_stores.store_one = [{key = "first"}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_6_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_6_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': The `file` or `data` key for the object `first` is not set. One must be used.", &e.to_string()), _ => panic!(), } const BAD_7_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{data = "This is some data"}] + kv_stores.store_one = [{data = "This is some data"}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_7_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_7_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': The `key` key for an object is not set. It must be used.", &e.to_string()), _ => panic!(), } const BAD_8_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = "lol lmao" + kv_stores.store_one = "lol lmao" "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_8_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_8_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': There is no array of objects for the given store.", &e.to_string()), _ => panic!(), } const BAD_9_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = ["This is some data"] + kv_stores.store_one = ["This is some data"] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_9_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_9_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': There is an object in the given store that is not a table of keys.", &e.to_string()), _ => panic!(), } @@ -196,29 +225,29 @@ async fn object_store_bad_configs() -> TestResult { } #[tokio::test(flavor = "multi_thread")] -async fn object_store_bad_key_values() -> TestResult { +async fn kv_store_bad_key_values() -> TestResult { const BAD_1_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = "", data = "This is some data"}] + kv_stores.store_one = [{key = "", data = "This is some data"}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_1_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_1_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': Invalid `key` value used: Keys for objects cannot be empty.", &e.to_string()), _ => panic!(), } const BAD_2_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = "LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong,looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong,keeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeEEEEEEEEEEEEEEEEEEEEEEEEEEEEEeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeey", data = "This is some data"}] + kv_stores.store_one = [{key = "LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong,looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong,keeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeEEEEEEEEEEEEEEEEEEEEEEEEEEEEEeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeey", data = "This is some data"}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_2_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_2_FASTLY_TOML) { Err(e) => assert_eq!( "invalid configuration for 'store_one': Invalid `key` value used: Keys for objects cannot be over 1024 bytes in size.", &e.to_string() @@ -227,14 +256,14 @@ async fn object_store_bad_key_values() -> TestResult { } const BAD_3_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = ".well-known/acme-challenge/wheeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", data = "This is some data"}] + kv_stores.store_one = [{key = ".well-known/acme-challenge/wheeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", data = "This is some data"}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_3_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_3_FASTLY_TOML) { Err(e) => assert_eq!( "invalid configuration for 'store_one': Invalid `key` value used: Keys for objects cannot start with `.well-known/acme-challenge`.", &e.to_string() @@ -243,118 +272,118 @@ async fn object_store_bad_key_values() -> TestResult { } const BAD_4_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = ".", data = "This is some data"}] + kv_stores.store_one = [{key = ".", data = "This is some data"}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_4_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_4_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': Invalid `key` value used: Keys for objects cannot be named `.`.", &e.to_string()), _ => panic!(), } const BAD_5_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = "..", data = "This is some data"}] + kv_stores.store_one = [{key = "..", data = "This is some data"}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_5_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_5_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': Invalid `key` value used: Keys for objects cannot be named `..`.", &e.to_string()), _ => panic!(), } const BAD_6_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = "carriage\rreturn", data = "This is some data"}] + kv_stores.store_one = [{key = "carriage\rreturn", data = "This is some data"}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_6_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_6_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': Invalid `key` value used: Keys for objects cannot contain a `\r`.", &e.to_string()), _ => panic!(), } const BAD_7_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = "newlines\nin\nthis\neconomy?", data = "This is some data"}] + kv_stores.store_one = [{key = "newlines\nin\nthis\neconomy?", data = "This is some data"}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_7_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_7_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': Invalid `key` value used: Keys for objects cannot contain a `\n`.", &e.to_string()), _ => panic!(), } const BAD_8_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = "howdy[", data = "This is some data"}] + kv_stores.store_one = [{key = "howdy[", data = "This is some data"}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_8_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_8_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': Invalid `key` value used: Keys for objects cannot contain a `[`.", &e.to_string()), _ => panic!(), } const BAD_9_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = "hello]", data = "This is some data"}] + kv_stores.store_one = [{key = "hello]", data = "This is some data"}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_9_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_9_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': Invalid `key` value used: Keys for objects cannot contain a `]`.", &e.to_string()), _ => panic!(), } const BAD_10_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = "yoohoo*", data = "This is some data"}] + kv_stores.store_one = [{key = "yoohoo*", data = "This is some data"}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_10_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_10_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': Invalid `key` value used: Keys for objects cannot contain a `*`.", &e.to_string()), _ => panic!(), } const BAD_11_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = "hey?", data = "This is some data"}] + kv_stores.store_one = [{key = "hey?", data = "This is some data"}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_11_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_11_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': Invalid `key` value used: Keys for objects cannot contain a `?`.", &e.to_string()), _ => panic!(), } const BAD_12_FASTLY_TOML: &str = r#" - name = "object-store-test" - description = "object store test" + name = "kv-store-test" + description = "kv store test" authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - object_stores.store_one = [{key = "ello ello#", data = "This is some data"}] + kv_stores.store_one = [{key = "ello ello#", data = "This is some data"}] "#; - match Test::using_fixture("object_store.wasm").using_fastly_toml(BAD_12_FASTLY_TOML) { + match Test::using_fixture("kv_store.wasm").using_fastly_toml(BAD_12_FASTLY_TOML) { Err(e) => assert_eq!("invalid configuration for 'store_one': Invalid `key` value used: Keys for objects cannot contain a `#`.", &e.to_string()), _ => panic!(), } diff --git a/cli/tests/integration/main.rs b/cli/tests/integration/main.rs index 64ddbe9a..3b18ff9b 100644 --- a/cli/tests/integration/main.rs +++ b/cli/tests/integration/main.rs @@ -6,9 +6,9 @@ mod downstream_req; mod env_vars; mod geolocation_lookup; mod http_semantics; +mod kv_store; mod logging; mod memory; -mod object_store; mod request; mod response; mod secret_store; diff --git a/cli/tests/integration/secret_store.rs b/cli/tests/integration/secret_store.rs index d066143a..ebd0473b 100644 --- a/cli/tests/integration/secret_store.rs +++ b/cli/tests/integration/secret_store.rs @@ -11,7 +11,7 @@ async fn secret_store_works() -> TestResult { authors = ["Jill Bryson ", "Rose McDowall "] language = "rust" [local_server] - secret_stores.store_one = [{key = "first", data = "This is some data"},{key = "second", file = "../test-fixtures/data/object-store.txt"}] + secret_stores.store_one = [{key = "first", data = "This is some data"},{key = "second", file = "../test-fixtures/data/kv-store.txt"}] "#; let resp = Test::using_fixture("secret-store.wasm") diff --git a/lib/src/config.rs b/lib/src/config.rs index 9b9ec8c7..25ec92bd 100644 --- a/lib/src/config.rs +++ b/lib/src/config.rs @@ -204,7 +204,7 @@ struct RawLocalServerConfig { geolocation: Option, #[serde(alias = "config_stores")] dictionaries: Option
, - #[serde(alias = "object_store")] + #[serde(alias = "object_store", alias = "kv_stores")] object_stores: Option
, secret_stores: Option
, } diff --git a/test-fixtures/data/object-store.txt b/test-fixtures/data/kv-store.txt similarity index 100% rename from test-fixtures/data/object-store.txt rename to test-fixtures/data/kv-store.txt diff --git a/test-fixtures/src/bin/object_store.rs b/test-fixtures/src/bin/kv_store.rs similarity index 100% rename from test-fixtures/src/bin/object_store.rs rename to test-fixtures/src/bin/kv_store.rs