Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,37 @@ group: beta
language: node_js
node_js:
- "8"

cache:
directories:
- node_modules
env:
-
- SOLIDITY_COVERAGE=true
- SOLC_NIGHTLY=true
matrix:

jobs:
# XXX fast_finish doesn't work with stages yet. See
# https://github.com/travis-ci/travis-ci/issues/8425
# --elopio - 20180531
fast_finish: true
allow_failures:
- env: SOLIDITY_COVERAGE=true
- env: SOLC_NIGHTLY=true
before_script:
- truffle version
script:
- npm run lint
- npm run lint:sol
- npm run test
include:
# Run the unit test suite three times in parallel.
# The first one gets results faster and is the only one required to pass.
# 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
Copy link
Contributor

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?

Copy link
Author

Choose a reason for hiding this comment

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

sounds good.

script: npm run test
- stage: unit
script: npm run test
env: SOLIDITY_COVERAGE=true
- stage: unit
script: npm run test
env: SOLC_NIGHTLY=true
Copy link
Contributor

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.

Copy link
Author

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.

# solidity and javascript style tests.
- stage: static
Copy link
Contributor

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"?

Copy link
Author

Choose a reason for hiding this comment

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

wfm.

script: npm run lint

notifications:
slack:
rooms:
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
],
"scripts": {
"test": "scripts/test.sh",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"lint:js": "eslint .",
Copy link
Contributor

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.

Copy link
Contributor

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.

"lint:js:fix": "eslint . --fix",
"lint:sol": "solium -d .",
"lint:sol:fix": "solium -d . --fix",
"lint:all": "npm run lint && npm run lint:sol",
"lint:all:fix": "npm run lint:fix && npm run lint:sol:fix",
"lint": "npm run lint:js && npm run lint:sol",
"lint:fix": "npm run lint:js:fix && npm run lint:sol:fix",
"console": "truffle console",
"coverage": "scripts/coverage.sh",
"version": "scripts/version.js"
Expand Down
2 changes: 2 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ if [ "$SOLC_NIGHTLY" = true ]; then
wget -q https://raw.githubusercontent.com/ethereum/solc-bin/gh-pages/bin/soljson-nightly.js -O /tmp/soljson.js && find . -name soljson.js -exec cp /tmp/soljson.js {} \;
fi

truffle version

if [ "$SOLIDITY_COVERAGE" = true ]; then
node_modules/.bin/solidity-coverage

Expand Down