-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the wasmtime library instead of the binary to run client tests
- Loading branch information
Showing
4 changed files
with
52 additions
and
54 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
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,52 +1,38 @@ | ||
use std::process::Command; | ||
mod common; | ||
|
||
fn wasmtime() -> Command { | ||
let mut wasmtime = Command::new("wasmtime"); | ||
wasmtime.arg("-S").arg("http"); | ||
wasmtime | ||
} | ||
use crate::common::run_wasi; | ||
|
||
#[test] | ||
fn client_get_chunk() { | ||
let status = wasmtime() | ||
.arg(test_programs_artifacts::CLIENT_GET_CHUNK_COMPONENT) | ||
.status() | ||
#[tokio::test(flavor = "multi_thread")] | ||
async fn client_get_chunk() { | ||
run_wasi(test_programs_artifacts::CLIENT_GET_CHUNK_COMPONENT) | ||
.await | ||
.unwrap(); | ||
assert!(status.success()); | ||
} | ||
|
||
#[test] | ||
fn client_get_with_query() { | ||
let status = wasmtime() | ||
.arg(test_programs_artifacts::CLIENT_GET_WITH_QUERY_COMPONENT) | ||
.status() | ||
#[tokio::test(flavor = "multi_thread")] | ||
async fn client_get_with_query() { | ||
run_wasi(test_programs_artifacts::CLIENT_GET_WITH_QUERY_COMPONENT) | ||
.await | ||
.unwrap(); | ||
assert!(status.success()); | ||
} | ||
|
||
#[test] | ||
fn client_post_with_form_data() { | ||
let status = wasmtime() | ||
.arg(test_programs_artifacts::CLIENT_POST_WITH_FORM_DATA_COMPONENT) | ||
.status() | ||
#[tokio::test(flavor = "multi_thread")] | ||
async fn client_post_with_form_data() { | ||
run_wasi(test_programs_artifacts::CLIENT_POST_WITH_FORM_DATA_COMPONENT) | ||
.await | ||
.unwrap(); | ||
assert!(status.success()); | ||
} | ||
|
||
#[test] | ||
fn client_post_with_json_data() { | ||
let status = wasmtime() | ||
.arg(test_programs_artifacts::CLIENT_POST_WITH_JSON_DATA_COMPONENT) | ||
.status() | ||
#[tokio::test(flavor = "multi_thread")] | ||
async fn client_post_with_json_data() { | ||
run_wasi(test_programs_artifacts::CLIENT_POST_WITH_JSON_DATA_COMPONENT) | ||
.await | ||
.unwrap(); | ||
assert!(status.success()); | ||
} | ||
|
||
#[test] | ||
fn client_post_with_multipart_form_data() { | ||
let status = wasmtime() | ||
.arg(test_programs_artifacts::CLIENT_POST_WITH_MULTIPART_FORM_DATA_COMPONENT) | ||
.status() | ||
#[tokio::test(flavor = "multi_thread")] | ||
async fn client_post_with_multipart_form_data() { | ||
run_wasi(test_programs_artifacts::CLIENT_POST_WITH_MULTIPART_FORM_DATA_COMPONENT) | ||
.await | ||
.unwrap(); | ||
assert!(status.success()); | ||
} |
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
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