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

On-demand testing for VM State and Blockchain #951

Merged
merged 5 commits into from
Nov 17, 2020

Conversation

evertonfraga
Copy link
Contributor

@evertonfraga evertonfraga commented Nov 12, 2020

This is the implementation of regular and extended VM State and Blockchain tests. It took lots of research and testing to have a concise code. The focus is on maintainability :)

On an ordinary PR, these tests will be fired:

image

But vm-state-extended and vm-blockchain-extended will be skipped.

All workflows running after adding the special label type: test all hardforks will have tests for all hardforks. Analogously, if the label is removed, the extended tests will not run anymore.

How it can be improved in the future:

  • use YAML includes to reuse some code.
  • If having vm-state-extended and vm-blockchain-extended on the checks start to bother you guys, there's an alternative: create one job with a script that outputs the matrix variables, just like I did with the node-versions.yml build file. The downside is to have more code to take care of, something I am always avoiding.

image

A run without the label.

A run with the type: test all hardforks label.

🙃

@evertonfraga evertonfraga self-assigned this Nov 12, 2020
@codecov
Copy link

codecov bot commented Nov 12, 2020

Codecov Report

Merging #951 (c0dd7ee) into master (11eb16f) will increase coverage by 0.13%.
The diff coverage is n/a.

Impacted file tree graph

Flag Coverage Δ
block 77.69% <ø> (+0.27%) ⬆️
blockchain 77.39% <ø> (ø)
common 92.11% <ø> (+0.24%) ⬆️
ethash 82.08% <ø> (ø)
tx 86.04% <ø> (-0.22%) ⬇️
vm 87.21% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@evertonfraga evertonfraga added the type: test all hardforks This special label enables VM state and blockchain tests for all hardforks on the respective PR. label Nov 12, 2020
- run: npm run test:blockchain -- ${{ matrix.args }}

vm-blockchain-extended:
if: contains(join(github.event.pull_request.labels.*.name, ' '), 'Test all hardforks')
Copy link
Contributor

Choose a reason for hiding this comment

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

coool

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could not use the entire label name type: Test all hardforks, because YAML libraries have trouble with character escaping. The colon was interpreted as a regular key: value, resulting in syntax errors. 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

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

interesting, ok, good to know! and I noticed the label has a lowercase t for test.

Comment on lines -106 to -111
# '--fork=Petersburg --dir=GeneralStateTests/stTimeConsuming --expected-test-amount=15561',
# '--fork=Petersburg --excludeDir=stTimeConsuming --expected-test-amount=17174',
Copy link
Contributor

Choose a reason for hiding this comment

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

did you mean to keep these commented out here, or should they be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ryanio
Copy link
Contributor

ryanio commented Nov 14, 2020

love it, this is a really cool and elegant solution.

should we add some docs to readme or developer.md about this feature? another good place for this info could be a pull request template.

@evertonfraga
Copy link
Contributor Author

should we add some docs to readme or developer.md about this feature? another good place for this info could be a pull request template.

@ryanio those are great ideas :)

@holgerd77
Copy link
Member

Ah, there we have it with the tests breaking along the move to the latest ethereum/tests develop state I mentioned in #953 (comment) . 😋

So I think I would revise my statement from there and rather pledge that we go back for now to the safer way and fixing the ethereum/tests state with a tag or by commit or something and then maybe add some notes similar to the old release notes from ethereumjs-testing somewhere here in the repo along the (developer) docs. @evertonfraga can you have a look into this?

@evertonfraga
Copy link
Contributor Author

@holgerd77 here it is: #953 (comment)

@holgerd77 holgerd77 force-pushed the ci/vm-tests-on-demand branch from 16274c4 to 3fb8eb5 Compare November 17, 2020 09:28
Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

Ok, I've made the submodule fixes discussed with @evertonfraga (go back to a ethereumjs-testing v1.3.3 submodule commit state, move ethereum-tests to packages, some fixes along), test now pass, thanks Everton, this is a really great addition 😀 , will merge.

On the ethereum/tests update question we still need to minimally introduce some kind of documentation here or some process. The optimal way would be to directly have the ethereum/tests releases come more frequently, I might suggest over there a new process with me doing the releases there on a more frequent basis and in parallel to our updates here. Not sure if this suggestion will get positive perception, we'll see. 😄

@holgerd77 holgerd77 merged commit c188339 into master Nov 17, 2020
@holgerd77 holgerd77 deleted the ci/vm-tests-on-demand branch November 17, 2020 10:41
@ryanio ryanio mentioned this pull request Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: vm PR state: needs review type: test all hardforks This special label enables VM state and blockchain tests for all hardforks on the respective PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants