forked from fastly/Viceroy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for environment variables in the adapter (fastly#400)
This copies over the implementation of `environ_get` and `environ_sizes_get` from the upstream adapter in wasmtime, and enables the environment variable test for components.
- Loading branch information
Showing
3 changed files
with
79 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
use crate::common::{Test, TestResult}; | ||
use crate::{ | ||
common::{Test, TestResult}, | ||
viceroy_test, | ||
}; | ||
|
||
#[tokio::test] | ||
async fn env_vars_are_set() -> TestResult { | ||
let resp = Test::using_fixture("env-vars.wasm").against_empty().await?; | ||
viceroy_test!(env_vars_are_set, |is_component| { | ||
let resp = Test::using_fixture("env-vars.wasm") | ||
.adapt_component(is_component) | ||
.against_empty() | ||
.await?; | ||
assert!(resp.status().is_success()); | ||
Ok(()) | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.