36b50b3dac
## Motivation and Context Follow-up on https://github.com/smithy-lang/smithy-rs/pull/2544 to add client-side support for the protocol ## Description The client implementation mainly focuses on a sub-section [Requests](https://smithy.io/2.0/additional-specs/protocols/smithy-rpc-v2.html#requests) in the spec. To that end, this PR addresses `TODO` for the client to fill in the blanks and includes additional adjustments/refactoring to pass client protocol tests. ## Testing - Existing tests in CI - Upstream protocol test `rpcv2Cbor` - Our handwritten protocol test `rpcv2Cbor-extras.smithy` ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ |
||
---|---|---|
.. | ||
model | ||
.gitignore | ||
README.md | ||
build.gradle.kts |
README.md
Codegen Integration Tests
This module defines integration tests of the code generation machinery.
./build.gradle.kts
will generate a smithy-build.json
file as part of the
build. The rust-client-codegen
Smithy build plugin then invokes our codegen
machinery and generates Rust crates, one for each of the integration test
services defined under model/
.
Usage
These commands are all meant to be run from the repository root.
To run all protocol tests of all the integration test services:
./gradlew codegen-client-test:build
To run only a subset of the integration test services (refer to
./build.gradle.kts
for a full list):
./gradlew codegen-client-test:build -P modules='simple,rest_json'
The Gradle task will run cargo check
, cargo test
, cargo docs
and cargo clippy
by default on all the generated Rust crates. You can also specify a
subset of these commands. For instance, if you're working on documentation and
want to check that the crates also compile, you can run:
./gradlew codegen-client-test:build -P cargoCommands='check,docs'
For fast development iteration cycles on protocol tests, we recommend you write
a codegen unit test with a minimal service definition and only run that unit
test. Alternatively, you can write a minimal integration test service
definition in model/simple.smithy
and run:
./gradlew codegen-client-test:build -P cargoCommands='test' -P modules='simple'