Unverified Commit 7ad342aa authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Copy non-service integration tests into SDK root tests directory (#2255)

* Copy non-service integration tests into SDK root tests directory

For tests in `aws/sdk/integration-tests` that are not named after a
service module, copy them into the SDK's root `tests/` directory so that
they are run as part of CI on the entire SDK.

* Add missing fields to integration test manifests
* Remove tests from root workspace
* Explicitly exclude the root tests from the root workspace
parent 980b5c44
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@

import aws.sdk.AwsServices
import aws.sdk.Membership
import aws.sdk.RootTest
import aws.sdk.discoverServices
import aws.sdk.docsLandingPage
import aws.sdk.parseMembership
@@ -198,6 +199,28 @@ tasks.register("relocateExamples") {
    outputs.dir(outputDir)
}

tasks.register("relocateTests") {
    description = "relocate the root integration tests and rewrite path dependencies"
    doLast {
        if (awsServices.rootTests.isNotEmpty()) {
            copy {
                val testDir = projectDir.resolve("integration-tests")
                from(testDir)
                awsServices.rootTests.forEach { test ->
                    include(test.path.toRelativeString(testDir) + "/**")
                }
                into(outputDir.resolve("tests"))
                exclude("**/target")
                filter { line -> line.replace("build/aws-sdk/sdk/", "sdk/") }
            }
        }
    }
    for (test in awsServices.rootTests) {
        inputs.dir(test.path)
    }
    outputs.dir(outputDir)
}

tasks.register<ExecRustBuildTool>("fixExampleManifests") {
    description = "Adds dependency path and corrects version number of examples after relocation"
    enabled = awsServices.examples.isNotEmpty()
@@ -272,6 +295,8 @@ tasks.register<Copy>("relocateChangelog") {
fun generateCargoWorkspace(services: AwsServices): String {
    return """
    |[workspace]
    |exclude = [${"\n"}${services.rootTests.map(RootTest::manifestName).joinToString(",\n") { "|    \"$it\"" }}
    |]
    |members = [${"\n"}${services.allModules.joinToString(",\n") { "|    \"$it\"" }}
    |]
    """.trimMargin()
@@ -287,6 +312,9 @@ tasks.register("generateCargoWorkspace") {
    if (awsServices.examples.isNotEmpty()) {
        inputs.dir(projectDir.resolve("examples"))
    }
    for (test in awsServices.rootTests) {
        inputs.dir(test.path)
    }
    outputs.file(outputDir.resolve("Cargo.toml"))
    outputs.upToDateWhen { false }
}
@@ -310,6 +338,7 @@ tasks.register<ExecRustBuildTool>("fixManifests") {
    dependsOn("relocateRuntime")
    dependsOn("relocateAwsRuntime")
    dependsOn("relocateExamples")
    dependsOn("relocateTests")
}

tasks.register<ExecRustBuildTool>("hydrateReadme") {
@@ -371,6 +400,7 @@ tasks.register("finalizeSdk") {
        "relocateRuntime",
        "relocateAwsRuntime",
        "relocateExamples",
        "relocateTests",
        "generateIndexMd",
        "fixManifests",
        "generateVersionManifest",
+3 −0
Original line number Diff line number Diff line
@@ -4,6 +4,9 @@ name = "dynamo-tests"
version = "0.1.0"
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Russell Cohen <rcoh@amazon.com>"]
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

+3 −0
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@
name = "ec2-tests"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"
publish = false

[dev-dependencies]
aws-credential-types = { path = "../../build/aws-sdk/sdk/aws-credential-types", features = ["test-util"] }
+3 −0
Original line number Diff line number Diff line
@@ -4,6 +4,9 @@ name = "glacier-tests"
version = "0.1.0"
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>"]
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

+3 −0
Original line number Diff line number Diff line
@@ -4,6 +4,9 @@ name = "iam-tests"
version = "0.1.0"
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>"]
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Loading