Unverified Commit 49cc08da authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Move core tests from `codegen-client` into `codegen-core` (#1776)

* Move `testutil` into `core` where possible
* Move `rustlang` tests into `core`
* Move remaining `util` tests to `core`
* Move and refactor `TopLevelErrorGeneratorTest` to not require `RustCodegenPlugin`
* Move protocols into `core`
* Move `generator` tests into `core`
* Move protocol ser/de tests into `core`
* Suppress deprecation warning in `TopLevelErrorGeneratorTest`
* Move `InlineFunctionNamerTest` into `core`
* Move model transform tests into `core`
* Rename `SymbolBuilderTest` to `SymbolVisitorTest` to match class under test
* Move server classes out of client
* Move core codegen tests into their own CI step
parent dcfb8557
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ jobs:
        - action: check-aws-sdk-adhoc-tests
        - action: check-client-codegen-integration-tests
        - action: check-client-codegen-unit-tests
        - action: check-core-codegen-unit-tests
        - action: check-rust-runtimes
        - action: check-sdk-codegen-unit-tests
        - action: check-server-codegen-integration-tests
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@ package software.amazon.smithy.rustsdk.customize.glacier

import software.amazon.smithy.model.shapes.OperationShape
import software.amazon.smithy.model.shapes.ShapeId
import software.amazon.smithy.rust.codegen.client.testutil.TokioWithTestMacros
import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency
import software.amazon.smithy.rust.codegen.core.rustlang.Writable
import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate
@@ -17,6 +16,7 @@ import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType
import software.amazon.smithy.rust.codegen.core.smithy.customize.OperationCustomization
import software.amazon.smithy.rust.codegen.core.smithy.customize.OperationSection
import software.amazon.smithy.rust.codegen.core.smithy.generators.operationBuildError
import software.amazon.smithy.rust.codegen.core.testutil.TokioWithTestMacros
import software.amazon.smithy.rustsdk.InlineAwsDependency

val TreeHashDependencies = listOf(
+3 −3
Original line number Diff line number Diff line
@@ -16,8 +16,7 @@ import software.amazon.smithy.model.transform.ModelTransformer
import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext
import software.amazon.smithy.rust.codegen.client.smithy.customize.RustCodegenDecorator
import software.amazon.smithy.rust.codegen.client.smithy.generators.protocol.ClientProtocolGenerator
import software.amazon.smithy.rust.codegen.client.smithy.protocols.RestXml
import software.amazon.smithy.rust.codegen.client.smithy.protocols.RestXmlFactory
import software.amazon.smithy.rust.codegen.client.smithy.protocols.ClientRestXmlFactory
import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency
import software.amazon.smithy.rust.codegen.core.rustlang.RustModule
import software.amazon.smithy.rust.codegen.core.rustlang.Writable
@@ -31,6 +30,7 @@ import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType
import software.amazon.smithy.rust.codegen.core.smithy.generators.LibRsCustomization
import software.amazon.smithy.rust.codegen.core.smithy.generators.LibRsSection
import software.amazon.smithy.rust.codegen.core.smithy.protocols.ProtocolMap
import software.amazon.smithy.rust.codegen.core.smithy.protocols.RestXml
import software.amazon.smithy.rust.codegen.core.smithy.traits.AllowInvalidXmlRoot
import software.amazon.smithy.rust.codegen.core.util.letIf
import software.amazon.smithy.rustsdk.AwsRuntimeType
@@ -57,7 +57,7 @@ class S3Decorator : RustCodegenDecorator<ClientProtocolGenerator, ClientCodegenC
    ): ProtocolMap<ClientProtocolGenerator, ClientCodegenContext> =
        currentProtocols.letIf(applies(serviceId)) {
            it + mapOf(
                RestXmlTrait.ID to RestXmlFactory { protocolConfig ->
                RestXmlTrait.ID to ClientRestXmlFactory { protocolConfig ->
                    S3(protocolConfig)
                },
            )
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ import software.amazon.smithy.model.shapes.OperationShape
import software.amazon.smithy.model.shapes.ServiceShape
import software.amazon.smithy.model.shapes.ShapeId
import software.amazon.smithy.model.traits.HttpTrait
import software.amazon.smithy.rust.codegen.client.testutil.asSmithyModel
import software.amazon.smithy.rust.codegen.core.testutil.asSmithyModel
import software.amazon.smithy.rust.codegen.core.util.expectTrait
import software.amazon.smithy.rust.codegen.core.util.orNull
import software.amazon.smithy.rustsdk.traits.PresignableTrait
+3 −3
Original line number Diff line number Diff line
@@ -15,16 +15,16 @@ import software.amazon.smithy.rust.codegen.client.smithy.customize.RequiredCusto
import software.amazon.smithy.rust.codegen.client.smithy.customize.RustCodegenDecorator
import software.amazon.smithy.rust.codegen.client.smithy.generators.config.ConfigCustomization
import software.amazon.smithy.rust.codegen.client.smithy.generators.protocol.ClientProtocolGenerator
import software.amazon.smithy.rust.codegen.client.testutil.asSmithyModel
import software.amazon.smithy.rust.codegen.client.testutil.generatePluginContext
import software.amazon.smithy.rust.codegen.client.testutil.stubConfigCustomization
import software.amazon.smithy.rust.codegen.client.testutil.unitTest
import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency
import software.amazon.smithy.rust.codegen.core.rustlang.asType
import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate
import software.amazon.smithy.rust.codegen.core.smithy.CodegenContext
import software.amazon.smithy.rust.codegen.core.smithy.RustCrate
import software.amazon.smithy.rust.codegen.core.smithy.generators.LibRsCustomization
import software.amazon.smithy.rust.codegen.core.testutil.asSmithyModel
import software.amazon.smithy.rust.codegen.core.testutil.generatePluginContext
import software.amazon.smithy.rust.codegen.core.testutil.unitTest
import software.amazon.smithy.rust.codegen.core.util.runCommand

internal class EndpointConfigCustomizationTest {
Loading