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

Write Test Runners for Spec Tests in Their Respective Packages #2812

Closed
18 tasks done
rauljordan opened this issue Jun 17, 2019 · 10 comments
Closed
18 tasks done

Write Test Runners for Spec Tests in Their Respective Packages #2812

rauljordan opened this issue Jun 17, 2019 · 10 comments
Labels
Priority: Critical Highest, immediate priority item

Comments

@rauljordan
Copy link
Contributor

rauljordan commented Jun 17, 2019

Hi all,

This is a tracking issue to ensure Prysm passes the latest Eth2 spec tests as maintained here. Every YAML file has a specific structure to it with specific expectations and configuration values. As discussed by the team offline, we agreed to keep these test runners constrained to the specific package they target. For example, the spec test runner for block processing should be kept in

/beacon-chain
  /core
    /blocks
      /spectest
        autogenerated.yaml.go
        block_processing_spec_test.go
      block_processing.go

This runner will have specific Go code for parsing and running the block sanity tests. This work can be split up, and shuffling spec tests have already been handled by @shayzluf here, but they should still be moved somewhere closer to the core shuffling logic in a respective /spectest folder as outlined above. The TODOS are as follow:

@rauljordan rauljordan added the Priority: Critical Highest, immediate priority item label Jun 17, 2019
@rauljordan rauljordan pinned this issue Jun 17, 2019
@prestonvanloon
Copy link
Member

prestonvanloon commented Jun 17, 2019

Example gist of using upstream eth2 yaml as a runfile data via bazel: https://gist.github.com/prestonvanloon/7beb97de9d22651dd5bf318135bb4520

Please choose the appropriate test size https://docs.bazel.build/versions/master/test-encyclopedia.html#role-of-the-test-runner

Please tag all of the spec tests with spectest.

# Example test target (exclude the comments in prod BUILD files)
go_test(
   name = "go_default_test",
   ...
    
   size = "large", # Implied test timeout of 900s; choose appropriate size.
   tags = [
        "spectest", # So we can query for spec tests.
    ],
)

Edit: do not attempt to use bazel as the upstream dep manager for yaml files and generated go files yet.
Use this tool for now: prysmaticlabs/yaml-to-go#8
We'll add that tool as starlark rules at a later date and remove the generated stuff.

Edit: I removed suggestion for manual tag. These tests are not as big as I expected.

Edit: We can should check in xxx.yaml.go files but not check in the yaml itself. That is provided from the forked repository where we upload archives. It is in master WORKSPACE now here:

prysm/WORKSPACE

Line 133 in 9bd6147

name = "eth2_spec_tests",

@rauljordan
Copy link
Contributor Author

I am taking up SSZ

@prestonvanloon
Copy link
Member

prestonvanloon commented Jun 20, 2019

Is this a complete list of all yamls upstream?

tests
├── bls
│   ├── aggregate_pubkeys
│   ├── aggregate_sigs
│   ├── msg_hash_g2_compressed
│   ├── msg_hash_g2_uncompressed
│   ├── priv_to_pub
│   └── sign_msg
├── epoch_processing
│   ├── crosslinks
│   └── registry_updates
├── operations
│   ├── attestation
│   ├── attester_slashing
│   ├── block_header
│   ├── deposit
│   ├── proposer_slashing
│   ├── transfer
│   └── voluntary_exit
├── sanity
│   ├── blocks
│   └── slots
├── shuffling
│   └── core
├── ssz_generic
│   └── uint
└── ssz_static
    └── core

Edit: was missing BLS.

@prestonvanloon
Copy link
Member

Waiting for spec freeze to cut new (final) yaml files to resolve this.

@prestonvanloon
Copy link
Member

@rauljordan
Copy link
Contributor Author

Completed in the spec-v0.6 branch

@rauljordan rauljordan unpinned this issue Jul 11, 2019
@prestonvanloon
Copy link
Member

There are still two PRs that are open:

#2901 - Final updates spec test
#2905 - Genesis trigger update
TBD - Genesis trigger spec tests

@prestonvanloon
Copy link
Member

Some details about genesis yaml test here: #2934

@0xKiwi
Copy link
Contributor

0xKiwi commented Jul 11, 2019

Genesis Spec Tests complete, #2940 builds fine!

@rauljordan
Copy link
Contributor Author

Closed by #2940

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Critical Highest, immediate priority item
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants