-
Notifications
You must be signed in to change notification settings - Fork 68
Add a basic fuzzer - FuzzScopedHTML #619
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
Conversation
|
7d96591
to
254fbf0
Compare
another option that isn't blocked on updating to go 1.18 would be using fast-check: https://github.com/dubzzz/fast-check/tree/main/packages/fast-check/documentation this allows for creating property tests to augment unit tests by generating data of a certain shape and asserting certain properties of it, like that a parse should contain only unicode strings or an error. ex: https://github.com/dubzzz/fast-check/blob/main/examples/001-simple/fibonacci/main.spec.ts ex closer to the compiler: https://github.com/dubzzz/fast-check/blob/main/examples/001-simple/indexOf/main.spec.ts |
This can be run via `go test ./internal/transform -fuzz=FuzzScopeHTML` from the root directory to run an ongoing fuzz test of the html scoping. Uses https://tip.golang.org/doc/tutorial/fuzz
254fbf0
to
648c882
Compare
This is ready for review now that go is > 1.18! This can be run in CI with something like https://github.com/jidicula/go-fuzz-action or something similar, or often able to be run in person. I'd say merge && run in person for now - though eventually hopefully all immediate bugs are found that would make this fail outright I'd probably recc https://google.github.io/oss-fuzz/getting-started/continuous-integration/ actually, since they have the most experience running fuzzing continuously in CI. Though this would be a more of "catch bugs in recently commited code" setup |
Changes
Small bugfixes that will be eventually moved to other PRs
Testing
This PR is tracking the addition of a simple go based fuzzer to test the html parser / scoped styles generator.
I'll add fixes to bugs I discover as I go along, and then eventually I'll break out the bugs and this fuzzer into individually mergable PRs
This can be run via
go test ./internal/transform -fuzz=FuzzScopeHTML
from the root directory to run an ongoing fuzz test of the html scoping.Uses https://tip.golang.org/doc/tutorial/fuzz
Docs
There should be contributor docs for how the fuzzer works, how to run it && how to update fuzz tests