Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the config-store-lookup tests #387

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions cli/tests/integration/config_store_lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ async fn json_config_store_lookup_works() -> TestResult {
description = "json config_store lookup test"
authors = ["Jill Bryson <[email protected]>", "Rose McDowall <[email protected]>"]
language = "rust"
[local_server]
[local_server.config_stores]
[local_server.config_stores.animals]
file = "../test-fixtures/data/json-config_store.json"
format = "json"
"#;

let resp = Test::using_fixture("config_store-lookup.wasm")
// let resp = Test::using_fixture("config_store-lookup.wasm")
let resp = Test::using_fixture("config-store-lookup.wasm")
.using_fastly_toml(FASTLY_TOML)?
.against_empty()
.await?;
Expand All @@ -37,16 +36,14 @@ async fn inline_toml_config_store_lookup_works() -> TestResult {
description = "inline toml config_store lookup test"
authors = ["Jill Bryson <[email protected]>", "Rose McDowall <[email protected]>"]
language = "rust"
[local_server]
[local_server.config_stores]
[local_server.config_stores.animals]
format = "inline-toml"
[local_server.config_stores.animals.contents]
dog = "woof"
cat = "meow"
"#;

let resp = Test::using_fixture("config_store-lookup.wasm")
let resp = Test::using_fixture("config-store-lookup.wasm")
.using_fastly_toml(FASTLY_TOML)?
.against_empty()
.await?;
Expand All @@ -69,7 +66,7 @@ async fn missing_config_store_works() -> TestResult {
language = "rust"
"#;

let resp = Test::using_fixture("config_store-lookup.wasm")
let resp = Test::using_fixture("config-store-lookup.wasm")
.using_fastly_toml(FASTLY_TOML)?
.against_empty()
.await?;
Expand Down
1 change: 1 addition & 0 deletions cli/tests/integration/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mod async_io;
mod body;
mod client_certs;
mod common;
mod config_store_lookup;
mod device_detection_lookup;
mod dictionary_lookup;
mod downstream_req;
Expand Down
10 changes: 10 additions & 0 deletions test-fixtures/src/bin/config-store-lookup.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//! A guest program to test that dictionary lookups work properly.
use fastly::ConfigStore;

fn main() {
let animals = ConfigStore::open("animals");
assert_eq!(animals.get("dog").unwrap(), "woof");
assert_eq!(animals.get("cat").unwrap(), "meow");
assert_eq!(animals.get("lamp"), None);
}
Loading