-
Notifications
You must be signed in to change notification settings - Fork 206
Fuzz impl v2 #3881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fuzz impl v2 #3881
Conversation
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go but we should ensure we run the fuzzgen
test in fuzzgen/src/test/kotlin/software/amazon/smithy/rust/codegen/fuzz/FuzzHarnessBuildPluginTest.kt
in CI.
@@ -113,6 +113,7 @@ class CargoTomlGenerator( | |||
"features" to cargoFeatures.toMap(), | |||
).deepMergeWith(manifestCustomizations) | |||
|
|||
println(cargoToml) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intentional or a leftover?
fuzzgen/src/main/kotlin/software/amazon/smithy/rust/codegen/fuzz/FuzzHarnessBuildPlugin.kt
Outdated
Show resolved
Hide resolved
operations: [SayHello], | ||
version: "1" | ||
} | ||
@optionalAuth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is @optionalAuth
relevant here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no
import software.amazon.smithy.rust.codegen.core.util.runCommand | ||
import software.amazon.smithy.rust.codegen.server.smithy.testutil.serverIntegrationTest | ||
|
||
class FuzzHarnessBuildPluginTest() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this test will get run by CI? Since this fuzzgen
Gradle module is new.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes fixed thanks
3. The fuzz driver can be used on other fuzz targets. | ||
|
||
### Setup | ||
First, you'll need to generate the 1 (or more) versions of a smithy-rs server to test against. The best way to do this is by using the smithy CLI. **This process is fully automated with the `aws-smithy-fuzz setup-smithy`. The following docs are in place in case you want to alter the behavior.** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, you'll need to generate the 1 (or more) versions of a smithy-rs server to test against. The best way to do this is by using the smithy CLI. **This process is fully automated with the `aws-smithy-fuzz setup-smithy`. The following docs are in place in case you want to alter the behavior.** | |
First, you'll need to generate the 2 (or more) versions of a smithy-rs server to test against. The best way to do this is by using the smithy CLI. **This process is fully automated with the `aws-smithy-fuzz setup-smithy`. The following docs are in place in case you want to alter the behavior.** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can fuzz against 1 — you are then fuzzing for panics instead of fuzzing for comparison
exec( | ||
Command::new("rm") | ||
.arg("-r") | ||
.arg(format!("{}/.m2", home_dir.display())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps nuke just ~/.m2/repository/software/amazon/smithy/
? Lest we overreach and delete important stuff.
A new generated diff is ready to view.
A new doc preview is ready to view. |
@@ -0,0 +1,111 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a great place to comment so I'm just picking here. This is fine for now but I'd really like to see us refactor our project structure a bit and group codegen all together, something like:
codegen/
smithy-rs-server-codegen/
smithy-rs-client-codegen/
smithy-rs-shared-codegen/
...
Example names but we also need to consider publishing and it's useful if the directory for a maven artifact matches the published name (1) easier to find and (2) that's the default anyway when publishing is to use the project name.
I'd like to do something similar for the runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable
## 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: david-perez <[email protected]>
Motivation and Context
This implements fuzzing for smithy-rs servers
Description
Testing
Checklist
.changelog
directory, specifying "client," "server," or both in theapplies_to
key..changelog
directory, specifying "aws-sdk-rust" in theapplies_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.