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

Fuzz impl v2 (#3881)



## Motivation and Context
This implements fuzzing for smithy-rs servers

## Description
<!--- Describe your changes in detail -->

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [ ] For changes to the smithy-rs codegen or runtime crates, I have
created a changelog entry Markdown file in the `.changelog` directory,
specifying "client," "server," or both in the `applies_to` key.
- [ ] For changes to the AWS SDK, generated SDK code, or SDK runtime
crates, I have created a changelog entry Markdown file in the
`.changelog` directory, specifying "aws-sdk-rust" in the `applies_to`
key.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Co-authored-by: default avatardavid-perez <d@vidp.dev>
parent a51570be
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -109,6 +109,8 @@ jobs:
          fetch-depth: 0
        - action: check-sdk-codegen-unit-tests
          runner: ubuntu-latest
        - action: check-fuzzgen
          runner: ubuntu-latest
        - action: check-server-codegen-integration-tests
          runner: smithy_ubuntu-latest_8-core
        - action: check-server-codegen-integration-tests-python
+4 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

buildscript {
    repositories {
        mavenCentral()
@@ -14,6 +15,7 @@ buildscript {
    }
}


allprojects {
    val allowLocalDeps: String by project
    repositories {
@@ -23,8 +25,10 @@ allprojects {
        mavenCentral()
        google()
    }

}


val ktlint by configurations.creating
val ktlintVersion: String by project

+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ group = "software.amazon.smithy.rust.codegen"
version = "0.1.0"

val smithyVersion: String by project
val smithyRsVersion: String by project

dependencies {
    implementation(project(":codegen-core"))
+1 −0
Original line number Diff line number Diff line
@@ -360,6 +360,7 @@ fun RustCrate.testModule(block: Writable) =
    }

fun FileManifest.printGeneratedFiles() {
    println("Generated files:")
    this.files.forEach { path ->
        println("file:///$path")
    }
+3 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ fun String.runCommand(
    workdir: Path? = null,
    environment: Map<String, String> = mapOf(),
    timeout: Long = 3600,
    redirect: ProcessBuilder.Redirect = ProcessBuilder.Redirect.PIPE,
): String {
    val logger = Logger.getLogger("RunCommand")
    logger.fine("Invoking comment $this in `$workdir` with env $environment")
@@ -23,8 +24,8 @@ fun String.runCommand(
    val parts = this.split("\\s".toRegex())
    val builder =
        ProcessBuilder(*parts.toTypedArray())
            .redirectOutput(ProcessBuilder.Redirect.PIPE)
            .redirectError(ProcessBuilder.Redirect.PIPE)
            .redirectOutput(redirect)
            .redirectError(redirect)
            .letIf(workdir != null) {
                it.directory(workdir?.toFile())
            }
Loading