Unverified Commit 41ca31b8 authored by Russell Cohen's avatar Russell Cohen Committed by GitHub
Browse files

Add CI action to test aws-sdk-services (#2251)

* run cargo test --all-features instead

* Add check-only option, change check to test

* Support nested APIs in operation input tests
parent 0965f12f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ jobs:
        - action: check-aws-config
        - action: check-aws-sdk-canary
        - action: check-aws-sdk-cargo-deny
        - action: check-aws-sdk-services
        - action: check-only-aws-sdk-services
        - action: check-aws-sdk-smoketest-docs-clippy-udeps
        - action: check-aws-sdk-smoketest-unit-tests
        - action: check-aws-sdk-standalone-integration-tests
+7 −1
Original line number Diff line number Diff line
@@ -48,11 +48,17 @@ use smithy.rules#endpointTests
            }
        },
        "params": { }
        "operationInputs": [
            { "operationName": "TestOperation", "operationParams": {
                "bar": { f: "blah" }
              } }
        ]
    }]
})
@restJson1
@title("Test Service")
@service(sdkId: "Test")
@aws.auth#sigv4(name: "test-service")
service TestService {
    operations: [TestOperation]
}
@@ -60,7 +66,7 @@ service TestService {
@input
structure Foo { bar: Bar }

structure Bar {}
structure Bar { f: String }

@http(uri: "/foo", method: "POST")
operation TestOperation {
+3 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import software.amazon.smithy.rust.codegen.core.rustlang.rust
import software.amazon.smithy.rust.codegen.core.rustlang.rustBlock
import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate
import software.amazon.smithy.rust.codegen.core.rustlang.writable
import software.amazon.smithy.rust.codegen.core.smithy.PublicImportSymbolProvider
import software.amazon.smithy.rust.codegen.core.smithy.RustCrate
import software.amazon.smithy.rust.codegen.core.smithy.generators.setterName
import software.amazon.smithy.rust.codegen.core.testutil.integrationTest
@@ -113,7 +114,8 @@ fun usesDeprecatedBuiltIns(testOperationInput: EndpointTestOperationInput): Bool
 * Doing this in AWS codegen allows us to actually integration test generated clients.
 */

class OperationInputTestGenerator(private val ctx: ClientCodegenContext, private val test: EndpointTestCase) {
class OperationInputTestGenerator(_ctx: ClientCodegenContext, private val test: EndpointTestCase) {
    private val ctx = _ctx.copy(symbolProvider = PublicImportSymbolProvider(_ctx.symbolProvider, _ctx.moduleUseName()))
    private val runtimeConfig = ctx.runtimeConfig
    private val moduleName = ctx.moduleUseName()
    private val endpointCustomizations = ctx.rootDecorator.endpointCustomizations(ctx)
+4 −0
Original line number Diff line number Diff line
@@ -36,6 +36,10 @@ check-aws-sdk-examples: generate-aws-sdk
check-aws-sdk-services: generate-aws-sdk
	$(CI_ACTION) $@ $(ARGS)

.PHONY: check-only-aws-sdk-services
check-only-aws-sdk-services: generate-aws-sdk
	$(CI_ACTION) $@ $(ARGS)

.PHONY: check-aws-sdk-smoketest-docs-clippy-udeps
check-aws-sdk-smoketest-docs-clippy-udeps: generate-aws-sdk-smoketest
	$(CI_ACTION) $@ $(ARGS)
+7 −2
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ class EndpointsDecoratorTest {
                "Region": "test-region"
              },
              "operationInputs": [
                { "operationName": "TestOperation" }
                { "operationName": "TestOperation", "operationParams": { "nested": { "field": "test" } } }
              ],
              "expect": {
                "endpoint": {
@@ -110,7 +110,12 @@ class EndpointsDecoratorTest {

        structure TestOperationInput {
            @contextParam(name: "Bucket")
            bucket: String
            bucket: String,
            nested: NestedStructure
        }

        structure NestedStructure {
            field: String
        }
    """.asSmithyModel()

Loading