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

Reintegrate blockchain tests #193

Merged
merged 1 commit into from
Sep 11, 2017
Merged

Conversation

holgerd77
Copy link
Member

This reintegrates the blockchain tests to be run on travis builds (leaving BlockchainTests/GeneralStateTests).

PR should be merged also on travis build failure since blockchain tests are failing for other reasons atm and this is just a basis for testing/fixing this.

@holgerd77 holgerd77 force-pushed the reintegrate-blockchain-tests branch 4 times, most recently from 39fe9c1 to 872d935 Compare September 7, 2017 12:46
@holgerd77 holgerd77 requested review from cdetrio and axic September 7, 2017 13:46
@holgerd77
Copy link
Member Author

@cdetrio @axic This is now running around 30-40 minutes, running selected blockchain test folders. Should be acceptable, shouldn't it? Can one of you review?

@holgerd77 holgerd77 requested a review from jwasinger September 7, 2017 19:57
Copy link
Contributor

@jwasinger jwasinger left a comment

Choose a reason for hiding this comment

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

I think this looks mostly good. One suggestion that I do have is that we consider renaming --dir to --testcase.
It would also be useful to be able to pass more than one value to --excludeDir and --dir.

So in summary, I would rename --dir to --testcases and --excludeDir to --exclude. It would probably be best to do this on a separate PR.

@@ -45,6 +45,9 @@
"testVM": "node ./tests/tester -v",
"testState": "node ./tests/tester -s",
"testBlockchain": "node --stack-size=1500 ./tests/tester -b",
"testBlockchainBlockGasLimit": "node --stack-size=1500 ./tests/tester -b --dir='bcBlockGasLimitTest'",
"testBlockchainValid": "node --stack-size=1500 ./tests/tester -b --dir='bcValidBlockTest'",
"testBlockchainTotalDifficulty": "node --stack-size=1500 ./tests/tester -b --dir='bcTotalDifficultyTest'",
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally, these could be one line:

"testBlockchainTravis": "node --stack-size=1500 ./tests/tester -b --dir='bcBlockGasLimitTest testBlockchainValidtest BlockchainTotalDifficulty'

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. --dir really is a directory option - directly passed through to ethereumjs-testing, where you can select e.g. all the GeneralStateTests in BlockChainTests with --dir='GeneralStateTests' or a subfolder (test cases) with --dir='GeneralStateTests/stCallCodes'. For just renaming --excludeDir this doesn't seems worth the effort, since this would have to be routed through the already merged PR on ethereumjs-testing.

  2. Since including several directories isn't supported in the current version of ethereumjs-testing this would need a wrapper in the ethereumjs-vm tests implementation and I think this is more confusing than helpful for people reading the code and expecting the same API as in ethereumjs-testing. So I also would say this isn't worth the effort here, this doesn't have to scale or something, it's just a practical solution to get three test folders runnning.

Copy link
Member Author

@holgerd77 holgerd77 Sep 8, 2017

Choose a reason for hiding this comment

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

I actually thought longer than it might seem on how to implement the --dir option (e.g. not using the filters from npm-dir). The selected solution has some flexibility in some directions (e.g. the subfolder selection from above wouldn't be possible with the current filter implementation in npm-dir), and it is generally easier to use (with npm-dir filter I actually experimented over half an hour and didn't get the results I expected).

So the --dir implementation lacks a filter functionality but I think the use case for this for directories is relatively limited, though one can probably come up with use cases (all directories with memory in it, hmm :-)). If this should be needed in the future an option --dirFilter could additionally be added.

It is also possible to expand the current --dir implementation with the possibility to add several directories in the future and not loosing backwards compatibility. I wouldn't want to do this now though.

To sum up: for our current use cases I decided that this is the better choice. :-)

Copy link
Contributor

Choose a reason for hiding this comment

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

The change to make --dir accept several directories can be made in a future PR. It would be nice to be able to condense the test suites into one.

@holgerd77 holgerd77 force-pushed the reintegrate-blockchain-tests branch from 872d935 to b7549db Compare September 8, 2017 13:20
@holgerd77 holgerd77 force-pushed the reintegrate-blockchain-tests branch 2 times, most recently from f3e5cf7 to df28ff6 Compare September 10, 2017 08:08
@holgerd77 holgerd77 force-pushed the reintegrate-blockchain-tests branch from df28ff6 to 0d54e95 Compare September 10, 2017 08:37
@holgerd77
Copy link
Member Author

I've rebased this and tests are now passing (see comments on Gitter), this can now be merged.

@cdetrio cdetrio merged commit 31d7d5b into master Sep 11, 2017
@axic axic deleted the reintegrate-blockchain-tests branch September 13, 2017 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants