Skip to content
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

Add arbitrary support #1032

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

LegNeato
Copy link
Member

@LegNeato LegNeato commented Mar 1, 2022

This adds optional support for https://github.com/rust-fuzz/arbitrary/ behind
the arbitrary1 feature flag (off by default).

This will be used in a future pull request to enable fuzzing using cargo-fuzz

@LegNeato
Copy link
Member Author

LegNeato commented Mar 1, 2022

I haven't added this to CI yet. I'm also not sure we want these next to the definitions rather than in their own module...next to definitions makes the file noisy, but putting them in their own crate makes them further away from the type they are implementing on.

@LegNeato
Copy link
Member Author

LegNeato commented Mar 1, 2022

Note that I had to manually implement rather than use the Arbitrary derive in many places due to lifetimes (see rust-fuzz/arbitrary#104)

LegNeato added a commit to LegNeato/juniper that referenced this pull request Mar 1, 2022
@LegNeato LegNeato mentioned this pull request Mar 1, 2022
@LegNeato
Copy link
Member Author

LegNeato commented Mar 1, 2022

This isn't 100% yet because the arbitrary Name implementation on Schema causes an error of IncorrectFormat all the time. That being said, this is a good start and allows everything to compile (minus the TODOs). I'm working on the custom arbitrary implementations that more closely match the expectations of the underlying data model.

This adds optional support for https://github.com/rust-fuzz/arbitrary/ behind
the `arbitrary` feature flag (off by default).

This will be used in a future pull request to enable fuzzing using `cargo-fuzz`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant