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

Yaml shuffling test vectors generator #31

Merged
merged 4 commits into from
Dec 11, 2018
Merged

Conversation

mratsim
Copy link
Contributor

@mratsim mratsim commented Dec 6, 2018

This implement a proof-of-concept YAML test vector generator.

As mentioned by @chfast, it's probably best for the test cases to be generated as artifacts during CI to avoid polluting the codebase. This single test adds 11k lines for example. 6k lines (after 4853ff3).

Anyway, the main goal is to re-sparkle testing discussion. This format can be generated, now are clients able to consume it?

Cc @djrtwo, @zscole, @rauljordan, @paulhauner

Reference spec for testing: https://github.com/ethereum/eth2.0-specs/blob/f122dd79e709c27b9259b9bd06bd95f5f45303b4/specs/test-format.md

title: Shuffling Algorithm Tests
summary: Test vectors for shuffling a list based upon a seed using `shuffle`
test_suite: shuffle
fork: tchaikovsky
version: 1.0

test_cases:
- input: []
  output: []
  seed: !!binary ""
- name: boring_list
  description: List with a single element, 0
  input: [0]
  output: [0]
  seed: !!binary ""
- input: [255]
  output: [255]
  seed: !!binary ""
- input: [4, 6, 2, 6, 1, 4, 6, 2, 1, 5]
  output: [1, 6, 4, 1, 6, 6, 2, 2, 4, 5]
  seed: !!binary ""
- input: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
  output: [4, 7, 10, 13, 3, 1, 2, 9, 12, 6, 11, 8, 5]
  seed: !!binary ""
- input: [65, 6, 2, 6, 1, 4, 6, 2, 1, 5]
  output: [6, 65, 2, 5, 4, 2, 6, 6, 1, 1]
  seed: !!binary |
    JlAYJ5H2j8g7PLiPHZI/rTS1uAvKiieOrifPN6Moso0=

@mratsim mratsim changed the title Yaml test vectors generator Yaml shuffling test vectors generator Dec 6, 2018
@mkalinin
Copy link

mkalinin commented Dec 8, 2018

A tiny thing. Let's maybe use hexadecimal binary form? It just reads much better.

@mratsim
Copy link
Contributor Author

mratsim commented Dec 8, 2018

Yes the generator uses hexadecimal. The test format is wrong ;).

@mratsim
Copy link
Contributor Author

mratsim commented Dec 11, 2018

Merging this as I'd like to develop a few other tests on top of that, but feel free to keep the conversion running here.

@mratsim mratsim merged commit d18ca32 into master Dec 11, 2018
@mratsim mratsim deleted the YAML-test-vectors-generator branch December 12, 2018 11:37
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.

2 participants