-
Notifications
You must be signed in to change notification settings - Fork 12.4k
tests: use stages for the travis execution #967
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
tests: use stages for the travis execution #967
Conversation
4011750 to
7ba669d
Compare
|
I'm not super sure about fast finish and allow failures. But it's late and travis is grumpy and not taking this PR. So, WIP, please don't merge it yet. |
7ba669d to
0087954
Compare
98b4616 to
0f1286e
Compare
|
Okay, ready for review. |
| - script: npm run test | ||
| env: SOLIDITY_COVERAGE=true | ||
| - script: npm run test | ||
| env: SOLC_NIGHTLY=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a short comment explaining we're running 3 jobs in the unit stage, since Travis' syntax for this is so obscure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @nventuro!
I've added comments, please take another look.
|
Apparently Travis supports explicitly indicating the stage for each job: I think this would make the intent clearer. This config: produces the same result. |
|
@nventuro updated. |
frangio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this but I don't like giving up fast_finish. I think it's important that builds be as fast as possible, and coverage analysis is super super slow.
I'd put this on hold for now.
| "test": "scripts/test.sh", | ||
| "lint": "eslint .", | ||
| "lint:fix": "eslint . --fix", | ||
| "lint:js": "eslint .", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay! This was in my mind too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we put this PR on hold we should still do this now.
.travis.yml
Outdated
| script: npm run test | ||
| env: SOLC_NIGHTLY=true | ||
| # solidity and javascript style tests. | ||
| - stage: static |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think "Static" is a very clear name. Have you considered "Linting"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wfm.
.travis.yml
Outdated
| # The second one generates the coverage report. | ||
| # The third one is to keep us informed about possible issues with the | ||
| # upcoming solidity release. | ||
| - stage: unit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about "Unit tests" for the stage name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good.
|
@ElOpio Can you explain a bit further the motivation behind this? Were you looking to put linting in a separate job? If so, what is the problem with it running in parallel with everything else? |
|
@frangio yes, the initial requirement was to not run linting on the coverage job, as requested on #694. In testing, to make the best use of human and machine resources, you build a pyramid. The base of the pyramid is clean code, then testing functionality of units, and then testing integrations and the system viewed from a higher level. About failfast, I prefer to sacrifice those 10 minutes before the squash button is enabled instead of using the matrix. Knowing how travis works, this is not likely to be fixed fast. But if you prefer to keep failfast, I can modify the test script to make the matrix not so ugly. |
This is nice, I had never heard of it.
For the record, Travis does have limits on parallel use of resources, but I don't think it would affect us too negatively in this case.
I'd love to get a third opinion on this before moving forward with either option. @nventuro? |
|
Fast finish does work, but stages won't advance until all jobs (even those that are allowed to fail) finish. So we could have the best of both worlds, by putting the linter stage first. Given our decision of not treating aesthetic linter errors as build errors, this is fine by me. |
|
It's still not clear to me if having the unit tests as the last stage will result in |
|
I'll do some tests on this and come back with more information. |
|
Hey stages are now stable, since last month. π https://blog.travis-ci.com/2018-07-18-build-stages-officially-released |
|
It seems like linting will still not run until all jobs including coverage have finished. |
|
@ElOpio we'd like for: a) linting errors to cause a build error, but still allow for the test suite to run (i.e. don't run linting first and abort the build on error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frangio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ElOpio!
Fixes #694
π Description
Use travis stages for better control of the things to run in parallel.
npm run lint:all:fix).