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

[WIP] #261: Add fuzz test #270

Merged
merged 1 commit into from
Dec 19, 2022
Merged

Conversation

td-bn
Copy link
Contributor

@td-bn td-bn commented Dec 13, 2022

Overview

WIP PR for issue#261

Description

Adds:

  • fuzz test for "Create and then resolve returns a document with the same ID".
  • Unit tests for "Generate and then resolve returns a document with the same ID".

How Has This Been Tested?

With commands:
mage fuzz
mage test

@td-bn
Copy link
Contributor Author

td-bn commented Dec 13, 2022

First time working with go 🙏 . With this PR I'm trying to capture expectations and get early feedback.

Looking for pointers to improve and extend this PR - specifically (but not limited to):

  • better way to fuzz test these properties
  • changes required to capture such tests in a mage command

Any feedback is appreciated.

Copy link
Contributor

@andresuribe87 andresuribe87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding mage, I'd recommend adding a separate command for fuzzing, and making sure you include the flag -fuzztime. A sensible default can be 10 seconds.

After you add the mage command, we can include it as part of the CI pipeline. Let me know if that all makes sense and thanks!

did/key_fuzz_test.go Show resolved Hide resolved
did/key_fuzz_test.go Outdated Show resolved Hide resolved
did/key_fuzz_test.go Outdated Show resolved Hide resolved
did/key_fuzz_test.go Outdated Show resolved Hide resolved
did/key_test.go Outdated Show resolved Hide resolved
magefile.go Outdated Show resolved Hide resolved
magefile.go Outdated Show resolved Hide resolved
Copy link
Contributor

@andresuribe87 andresuribe87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this! One small comment but looks great.

magefile.go Outdated Show resolved Hide resolved
@andresuribe87
Copy link
Contributor

Ohhh I forgot - it would make sense to include this in the github CI. Take a look at the .github/workflows/ci.yml file.

@andresuribe87 andresuribe87 merged commit 0802858 into TBD54566975:main Dec 19, 2022
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.

None yet

3 participants