feat(tests): add streaming HTTP integration test and example components#165
feat(tests): add streaming HTTP integration test and example components#165Aditya1404Sal wants to merge 3 commits intowasmCloud:mainfrom
Conversation
| cpu_limit: 2, | ||
| config: HashMap::new(), | ||
| environment: HashMap::new(), | ||
| volume_mounts: vec![], |
There was a problem hiding this comment.
I dont know if LocaResources implemented Default, might be cleaner to use that instead:
local_resources: LocalResources {
allowed_hosts: vec!["generativelanguage.googleapis.com".to_string()],
..Default::default()
}
There was a problem hiding this comment.
Yes, LocalResources::default() is present
aab131e to
81e45c9
Compare
|
CC @lxfontes pretty sure the CI failure is a flake, So it's ready for a review |
|
I like the examples with streaming. Rebase on upstream/main. |
| use url::Url; | ||
|
|
||
| mod bindings { | ||
| wit_bindgen::generate!({ |
There was a problem hiding this comment.
You can make the generated async trait and get rid of the code related to the executor
https://docs.rs/wit-bindgen/latest/wit_bindgen/macro.generate.html#options-to-generate
There was a problem hiding this comment.
That's neat! didn't know that was possible 😮
81e45c9 to
6feb1ce
Compare
6feb1ce to
f4b37d9
Compare
…ni proxy component Signed-off-by: Aditya <aditya.salunkh919@gmail.com>
Signed-off-by: Aditya <aditya.salunkh919@gmail.com>
f4b37d9 to
fd85bbd
Compare
…onent Signed-off-by: Aditya <aditya.salunkh919@gmail.com>
fd85bbd to
376a6c4
Compare
|
@lxfontes I've refactored the fixture part here and rebased, should be good for a review! |
|
This repository has been merged into wasmCloud/wasmCloud. Please re-open this PR against wasmCloud/wasmCloud:main. |
Feature or Problem
This PR adds comprehensive testing and example components for streaming HTTP responses in wasmCloud, providing:
The streaming capability is essential for:
Related Issues
Release Information
Target:
nextreleaseConsumer Impact
Breaking Changes: None
Benefits:
Testing
Unit Test(s)
Acceptance or Integration
Added comprehensive integration test:
tests/integration_http_streaming.rsTest Design:
Example Components Included:
http_streaming.wasm- Deterministic test component for CI/CDhttp_ai_proxy.wasm- Real-world Gemini API proxy demonstrating AI streaming use casesTest Assertions:
Why this approach?
The integration test prioritizes reliability and determinism over realism. Using a controlled streaming pattern ensures tests won't fail due to:
The real-world Gemini proxy example is included to demonstrate practical streaming applications, but the CI test uses a predictable pattern.
Manual Verification
Built and ran both components:
http_streaming.wasm(test component with deterministic timing)http_ai_proxy.wasm(Gemini proxy example for real-world use)Deterministic Test Component:
Observed streaming behavior (Gemini example):
Both approaches confirm that the streaming implementation works correctly and components can continue streaming after the handler returns.