Skip to content

Commit

Permalink
Merge pull request #8 from ethpm/darq-next
Browse files Browse the repository at this point in the history
Add gas analytics in CI
  • Loading branch information
cgewecke authored May 15, 2018
2 parents d9dde58 + 1446070 commit cb2def1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ env:
- NETWORK=ganache
- NETWORK=geth
- NETWORK=coverage
- NETWORK=ganache GAS_REPORTER=true

matrix:
allow_failures:
- env: NETWORK=coverage
- env: NETWORK=geth
- env: NETWORK=ganache GAS_REPORTER=true

install:
- npm install
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"scripts": {
"test": "NETWORK=ganache ./scripts/test.sh",
"test:geth": "NETWORK=geth ./scripts/test.sh",
"test:gas": "NETWORK=ganache GAS_REPORTER=true ./scripts/test.sh",
"coverage": "./node_modules/.bin/solidity-coverage",
"lint": "./node_modules/.bin/solium -d contracts/",
"compile": "./node_modules/.bin/darq-truffle compile",
Expand All @@ -31,7 +32,8 @@
"homepage": "https://github.com/ethpm/escape-truffle#readme",
"devDependencies": {
"coveralls": "^3.0.0",
"darq-truffle": "^4.1.7-web3-one.5",
"darq-truffle": "4.1.4-next.7",
"eth-gas-reporter": "^0.1.4",
"ganache-cli": "^6.1.0",
"shelljs": "^0.8.1",
"solidity-coverage": "^0.5.0",
Expand Down
15 changes: 13 additions & 2 deletions truffle-config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@

// Thanks AragonOS for this conditional reporter logic.
const mochaGasSettings = {
reporter: 'eth-gas-reporter',
reporterOptions : {
onlyCalledMethods: true,
}
}

const mocha = process.env.GAS_REPORTER ? mochaGasSettings : {}

module.exports = {
networks: {
ganache: {
Expand All @@ -10,7 +21,6 @@ module.exports = {
host: "127.0.0.1",
port: 8546,
network_id: "*",
gas: 4000000,
websockets: true
},
coverage: {
Expand All @@ -21,5 +31,6 @@ module.exports = {
gasPrice: 0x01,
websockets: true
}
}
},
mocha,
}

0 comments on commit cb2def1

Please sign in to comment.