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

Negative fixtures framework (Go & JS), and negative fixtures for dag-pb! #81

Merged
merged 5 commits into from
Jan 6, 2023

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Jan 4, 2023

Finally this closes #80.

  • Negative fixtures framework in JS & Go for running decode() operations and checking failure conditions - blocks are defined in hex within the fixture docs.
  • Negative fixtures framework in JS & Go for running encode() operations and checking failure conditions - the JSON files containing the fixtures define a data model form in an existing codec that can be decoded (currently only dag-json, just plainly presented inside the JSON, but this will likely need to be extended to present a hex form for other codecs so there's optionality), then that data model form is passed through the codec's encoder and error is checked
  • Docs
  • Fixtures for encode and decode for dag-pb, extracted from the common tests that I've built up for both current JS & Go implementations.

No Rust yet; but I'd really love to get these in and expanded: dag-pb mainly for Iroh and dag-cbor mainly for FVM.

  • I need to "fix" the JS dag-pb's error messages to match what I have here, it highlighted some inconsistencies and a bit of sloppiness, will do a PR over there following this.

@rvagg rvagg requested a review from vmx January 4, 2023 07:04
rvagg added a commit to ipld/js-dag-pb that referenced this pull request Jan 4, 2023
Ref: ipld/codec-fixtures#81

This should only be a BREAKING CHANGE for users that are matching error
messages, otherwise this should not have a material impact on use.
@rvagg
Copy link
Member Author

rvagg commented Jan 4, 2023

ipld/js-dag-pb#69 - will be a semver-major because we're messing with error messages.

@rvagg rvagg self-assigned this Jan 4, 2023
rvagg added a commit to ipld/js-dag-pb that referenced this pull request Jan 4, 2023
Ref: ipld/codec-fixtures#81

This should only be a BREAKING CHANGE for users that are matching error
messages, otherwise this should not have a material impact on use.
rvagg added a commit to ipld/js-dag-pb that referenced this pull request Jan 6, 2023
Ref: ipld/codec-fixtures#81

This should only be a BREAKING CHANGE for users that are matching error
messages, otherwise this should not have a material impact on use.
@rvagg rvagg merged commit 1bcc7a1 into master Jan 6, 2023
@rvagg rvagg deleted the rvagg/negative-fixtures branch January 6, 2023 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🎉 Done
Development

Successfully merging this pull request may close these issues.

Add a mechanism for negative test fixtures
1 participant