Feat mock ffi testing #22
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces the
mock-ffifeature to enable testing without requiring the Blockless WASM runtime environment.The changes include updates to the CI pipeline, new feature definitions, documentation enhancements, and conditional implementations of FFI functions for testing purposes.
CI and Feature Updates:
.github/workflows/ci.yaml: Added a new step to run tests using themock-ffifeature in the CI pipeline.Cargo.toml: Introduced themock-ffifeature to provide mock implementations of FFI functions.Documentation Enhancements:
README.md: Added a section explaining themock-ffifeature, including its purpose, usage, and limitations, to help developers understand how to run tests without the runtime.Conditional FFI Implementations:
src/cgi.rs: Added conditional compilation for FFI functions using themock-ffifeature, along with mock implementations for CGI-related functions. [1] [2]src/http.rs: Added conditional compilation and mock implementations for HTTP-related FFI functions. [1] [2]src/llm.rs: Added conditional compilation and mock implementations for LLM-related FFI functions. [1] [2]src/memory.rs: Added conditional compilation and mock implementations for memory-related FFI functions. [1] [2]src/socket.rs: Added conditional compilation and mock implementations for socket-related FFI functions. [1] [2]