-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[15.0.0] Backport WIT-changing PRs (#7529)
* Remove timezone interface from wasi-clocks (#7515) * delete wasi-clocks timezone interface: import wit changes from WebAssembly/wasi-clocks#55 * remove other references to wasi:clocks/timezone in wits * remove todo! implementation of clocks/timezone and add_to_linker funcs * Move the `wasi:io/stream/error` resource into `wasi:io/error` (#7521) * Move the `error` resource into `wasi:io/error` * error.wit: update doc comments * downstream fixes to streams.wit doc comments * fix package name in error.wit --------- Co-authored-by: Trevor Elliott <[email protected]> * wasi-http: Make child fields immutable (#7524) * Make child fields immutable * Add `get_fields` and remove `FieldMapMutability` Clean up the interface to immutable fields by adding a different accessor. * Clean up the diff * wasi-http: Migrate to more descriptive error variant (#7434) * Migrate to a more specific error-code variant in wasi-http Co-authored-by: Pat Hickey <[email protected]> * Optional fields, and align with upstream pr * Update for upstream changes to the error-code variant * Sync with the upstream implementation * Missed updating an error for riscv64 and s390x * More debuggable error prtest:full * Try to stabilize the test on windows --------- Co-authored-by: Pat Hickey <[email protected]> * Remove a debugging eprintln (#7528) * Remove no-longer-necessary reactor world (#7516) The `wasi:cli` WIT package now has a `reactor` world so the adapter can use that instead of defining its own. --------- Co-authored-by: Pat Hickey <[email protected]> Co-authored-by: Trevor Elliott <[email protected]>
- Loading branch information
1 parent
aff8d97
commit 5d89b87
Showing
40 changed files
with
532 additions
and
565 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
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
17 changes: 7 additions & 10 deletions
17
crates/test-programs/src/bin/http_outbound_request_invalid_version.rs
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,17 +1,14 @@ | ||
use test_programs::wasi::http::types::{Method, Scheme}; | ||
use test_programs::wasi::http::types::{ErrorCode, Method, Scheme}; | ||
|
||
fn main() { | ||
let addr = std::env::var("HTTP_SERVER").unwrap(); | ||
let res = | ||
test_programs::http::request(Method::Connect, Scheme::Http, &addr, "/", None, Some(&[])); | ||
|
||
let error = res.unwrap_err().to_string(); | ||
if !error.starts_with("Error::ProtocolError(\"") { | ||
panic!( | ||
r#"assertion failed: `(left == right)` | ||
left: `"{error}"`, | ||
right: `"Error::ProtocolError(\"invalid HTTP version parsed\")"` | ||
or `"Error::ProtocolError(\"operation was canceled\")"`)"# | ||
) | ||
} | ||
assert!(matches!( | ||
res.unwrap_err() | ||
.downcast::<ErrorCode>() | ||
.expect("expected a wasi-http ErrorCode"), | ||
ErrorCode::HttpProtocolError, | ||
)); | ||
} |
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
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
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
Oops, something went wrong.