bytecodealliance / bytecodealliance/wasmtime

WASI conformance - HTTP test program refactoring

Open
#7,730 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 18h
Merged PRs (30d)
126

Description

#### Feature

As part of the JCO implementation of wasi:http, I found it useful to rewrite the test runners as WASI commands themselves, which reference the expected server details through environment variables. As a result, the tests can then be run fully independently of the Wasmtime test suite, since if all the test programs pass as commands, that means there is conformance.

#### Benefit

The benefit of this approach is simplifying WASI conformance testing to always be defined in terms of test program completion, given the expected environment for the given test program is configured correctly.

#### Implementation

I went ahead and worked on this refactoring for the JCO HTTP tests in https://github.com/bytecodealliance/wasmtime/compare/main...guybedford:wasmtime:http-incoming-tests-refactor, which reimplements all the client tests as WASI HTTP client tests instead of running through the Rust tests, introducing three new test programs to perform these tests: `proxy_handler`, `proxy_streaming` and `proxy_echo`. These tests are fully migrated and should comprehensively cover the existing tests.

For now this branch is enough to support JCO conformance testing only, not Wasmtime as well. So this will only be suitable to PR when it removes the existing Rust tests in Wasmtime and replaces them with a harness to do the calls through client test programs.

#### Alternatives

There are of course many alternatives - it would be great to get feedback on if this approach seems good to upstream, and if so it we can continue working towards getting the PR ready. Any further feedback or suggestions is very much welcome.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.