Commit df9426f9 by Leo Arias Committed by Francisco Giordano

tests: use stages for the travis execution (#967)

* tests: use stages for the travis execution

Fixes #694

* add comments as suggested by @nventuro

* move the unit tests first, as suggested by @frangio

* make stages clearer as suggested by @nventuro

* tests: use stages for the travis execution

Fixes #694

* add comments as suggested by @nventuro

* move the unit tests first, as suggested by @frangio

* make stages clearer as suggested by @nventuro

* update the stage names as suggested by @frangio

* Run all tests in parallel

* added names
parent b59b43fa
...@@ -4,24 +4,41 @@ group: beta ...@@ -4,24 +4,41 @@ group: beta
language: node_js language: node_js
node_js: node_js:
- "8" - "8"
cache: cache:
directories: directories:
- node_modules - node_modules
env:
- jobs:
- SOLIDITY_COVERAGE=true # XXX fast_finish doesn't work with stages yet. See
- SOLC_NIGHTLY=true # https://github.com/travis-ci/travis-ci/issues/8425
matrix: # --elopio - 20180531
fast_finish: true fast_finish: true
allow_failures: allow_failures:
- env: SOLIDITY_COVERAGE=true - env: SOLIDITY_COVERAGE=true
- env: SOLC_NIGHTLY=true - env: SOLC_NIGHTLY=true
before_script: include:
- truffle version # Run the unit test suite three times in parallel.
script: # The first one gets results faster and is the only one required to pass.
- npm run lint # The second one generates the coverage report.
- npm run lint:sol # The third one is to keep us informed about possible issues with the
- npm run test # upcoming solidity release.
- stage: tests
name: "unit tests"
script: npm run test
- stage: tests
name: "unit tests with coverage"
script: npm run test
env: SOLIDITY_COVERAGE=true
- stage: tests
name: "unit tests with solc nightly"
script: npm run test
env: SOLC_NIGHTLY=true
# solidity and javascript style tests.
- stage: tests
name: "static tests"
script: npm run lint
notifications: notifications:
slack: slack:
rooms: rooms:
......
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
], ],
"scripts": { "scripts": {
"test": "scripts/test.sh", "test": "scripts/test.sh",
"lint": "eslint .", "lint:js": "eslint .",
"lint:fix": "eslint . --fix", "lint:js:fix": "eslint . --fix",
"lint:sol": "solium -d .", "lint:sol": "solium -d .",
"lint:sol:fix": "solium -d . --fix", "lint:sol:fix": "solium -d . --fix",
"lint:all": "npm run lint && npm run lint:sol", "lint": "npm run lint:js && npm run lint:sol",
"lint:all:fix": "npm run lint:fix && npm run lint:sol:fix", "lint:fix": "npm run lint:js:fix && npm run lint:sol:fix",
"console": "truffle console", "console": "truffle console",
"coverage": "scripts/coverage.sh", "coverage": "scripts/coverage.sh",
"version": "scripts/version.js" "version": "scripts/version.js"
......
...@@ -59,6 +59,8 @@ if [ "$SOLC_NIGHTLY" = true ]; then ...@@ -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 {} \; 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 fi
truffle version
if [ "$SOLIDITY_COVERAGE" = true ]; then if [ "$SOLIDITY_COVERAGE" = true ]; then
node_modules/.bin/solidity-coverage node_modules/.bin/solidity-coverage
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment