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

chore: upgrade solidity-coverage to v0.6+ #921

Merged
merged 8 commits into from
Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ install:
- travis_wait 60 npm install
jobs:
allow_failures:
- script: npm run coverage:agent
- script: npm run coverage:payroll
include:
- stage: tests
Expand Down
4 changes: 2 additions & 2 deletions apps/agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
"@aragon/test-helpers": "^2.0.0",
"eth-ens-namehash": "^2.0.8",
"eth-gas-reporter": "^0.2.0",
"ethereumjs-testrpc-sc": "^6.1.6",
"ethereumjs-testrpc-sc": "^6.4.5-sc.3",
"ethereumjs-util": "^6.1.0",
"ganache-cli": "^6.4.3",
"solidity-coverage": "^0.5.11",
"solidity-coverage": "^0.6.2",
"solium": "^1.2.3",
"truffle": "4.1.14",
"truffle-extract": "^1.2.1",
Expand Down
4 changes: 2 additions & 2 deletions apps/finance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"@aragon/cli": "^6.0.0",
"@aragon/test-helpers": "^2.0.0",
"eth-gas-reporter": "^0.2.0",
"ethereumjs-testrpc-sc": "^6.1.6",
"ethereumjs-testrpc-sc": "^6.4.5-sc.3",
"ganache-cli": "^6.4.3",
"solidity-coverage": "^0.5.11",
"solidity-coverage": "^0.6.2",
"solium": "^1.2.3",
"truffle": "4.1.14",
"truffle-extract": "^1.2.1"
Expand Down
4 changes: 3 additions & 1 deletion apps/survey/.solcover.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ module.exports = {
'@aragon/os',
'@aragon/apps-shared-minime',
'@aragon/test-helpers',
]
],
// Turn on deep skip to avoid preprocessing (e.g. removing view/pure modifiers) for skipped files
deepSkip: true
}
1 change: 1 addition & 0 deletions apps/survey/contracts/test/TestImports.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "@aragon/os/contracts/kernel/Kernel.sol";
import "@aragon/os/contracts/factory/DAOFactory.sol";
import "@aragon/os/contracts/factory/EVMScriptRegistryFactory.sol";

import "@aragon/apps-shared-minime/contracts/MiniMeToken.sol";
import "@aragon/apps-shared-migrations/contracts/Migrations.sol";

// You might think this file is a bit odd, but let me explain.
Expand Down
4 changes: 2 additions & 2 deletions apps/survey/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"@aragon/cli": "^6.0.0",
"@aragon/test-helpers": "^2.0.0",
"eth-gas-reporter": "^0.2.0",
"ethereumjs-testrpc-sc": "^6.1.6",
"ethereumjs-testrpc-sc": "^6.4.5-sc.3",
"ganache-cli": "^6.4.3",
"solidity-coverage": "^0.5.11",
"solidity-coverage": "^0.6.2",
"solium": "^1.2.3",
"truffle": "4.1.14",
"truffle-extract": "^1.2.1"
Expand Down
4 changes: 2 additions & 2 deletions apps/token-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"@aragon/cli": "^6.0.0",
"@aragon/test-helpers": "^2.0.0",
"eth-gas-reporter": "^0.2.0",
"ethereumjs-testrpc-sc": "^6.1.6",
"ethereumjs-testrpc-sc": "^6.4.5-sc.3",
"ganache-cli": "^6.4.3",
"solidity-coverage": "^0.5.11",
"solidity-coverage": "^0.6.2",
"solium": "^1.2.3",
"truffle": "4.1.14",
"truffle-extract": "^1.2.1"
Expand Down
14 changes: 6 additions & 8 deletions apps/token-manager/test/tokenmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ const ExecutionTarget = artifacts.require('ExecutionTarget')

const TokenManager = artifacts.require('TokenManagerMock')
const MiniMeToken = artifacts.require('MiniMeToken')
const ACL = artifacts.require('@aragon/core/contracts/acl/ACL')
const Kernel = artifacts.require('@aragon/core/contracts/kernel/Kernel')
const DAOFactory = artifacts.require('@aragon/core/contracts/factory/DAOFactory')
const EVMScriptRegistryFactory = artifacts.require('@aragon/core/contracts/factory/EVMScriptRegistryFactory')
const ACL = artifacts.require('ACL')
const Kernel = artifacts.require('Kernel')
const DAOFactory = artifacts.require('DAOFactory')
const EVMScriptRegistryFactory = artifacts.require('EVMScriptRegistryFactory')
const EtherTokenConstantMock = artifacts.require('EtherTokenConstantMock')

const getContract = name => artifacts.require(name)

const n = '0x00'
const ANY_ADDR = '0xffffffffffffffffffffffffffffffffffffffff'

Expand Down Expand Up @@ -52,8 +50,8 @@ contract('Token Manager', ([root, holder, holder2, anyone]) => {
const NOW = 1

before(async () => {
const kernelBase = await getContract('Kernel').new(true) // petrify immediately
const aclBase = await getContract('ACL').new()
const kernelBase = await Kernel.new(true) // petrify immediately
const aclBase = await ACL.new()
const regFact = await EVMScriptRegistryFactory.new()
daoFact = await DAOFactory.new(kernelBase.address, aclBase.address, regFact.address)
tokenManagerBase = await TokenManager.new()
Expand Down
4 changes: 2 additions & 2 deletions apps/vault/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"@aragon/test-helpers": "^2.0.0",
"eth-ens-namehash": "^2.0.8",
"eth-gas-reporter": "^0.2.0",
"ethereumjs-testrpc-sc": "^6.1.6",
"ethereumjs-testrpc-sc": "^6.4.5-sc.3",
"ganache-cli": "^6.4.3",
"solidity-coverage": "^0.5.11",
"solidity-coverage": "^0.6.2",
"solium": "^1.2.3",
"truffle": "4.1.14",
"truffle-extract": "^1.2.1"
Expand Down
1 change: 1 addition & 0 deletions apps/voting/contracts/test/TestImports.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "@aragon/os/contracts/kernel/Kernel.sol";
import "@aragon/os/contracts/factory/DAOFactory.sol";
import "@aragon/os/contracts/factory/EVMScriptRegistryFactory.sol";

import "@aragon/apps-shared-minime/contracts/MiniMeToken.sol";
import "@aragon/apps-shared-migrations/contracts/Migrations.sol";

// You might think this file is a bit odd, but let me explain.
Expand Down
4 changes: 2 additions & 2 deletions apps/voting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
"@aragon/cli": "^6.0.0",
"@aragon/test-helpers": "^2.0.0",
"eth-gas-reporter": "^0.2.0",
"ethereumjs-testrpc-sc": "^6.1.6",
"ethereumjs-testrpc-sc": "^6.4.5-sc.3",
"ganache-cli": "^6.4.3",
"solidity-coverage": "^0.5.11",
"solidity-coverage": "^0.6.2",
"solidity-sha3": "^0.4.1",
"solium": "^1.2.3",
"truffle": "4.1.14",
Expand Down
15 changes: 7 additions & 8 deletions apps/voting/test/voting.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ const ExecutionTarget = artifacts.require('ExecutionTarget')

const Voting = artifacts.require('VotingMock')

const ACL = artifacts.require('@aragon/os/contracts/acl/ACL')
const Kernel = artifacts.require('@aragon/os/contracts/kernel/Kernel')
const DAOFactory = artifacts.require('@aragon/os/contracts/factory/DAOFactory')
const EVMScriptRegistryFactory = artifacts.require('@aragon/os/contracts/factory/EVMScriptRegistryFactory')
const MiniMeToken = artifacts.require('@aragon/apps-shared-minime/contracts/MiniMeToken')
const ACL = artifacts.require('ACL')
const Kernel = artifacts.require('Kernel')
const DAOFactory = artifacts.require('DAOFactory')
const EVMScriptRegistryFactory = artifacts.require('EVMScriptRegistryFactory')
const MiniMeToken = artifacts.require('MiniMeToken')

const getContract = name => artifacts.require(name)
const bigExp = (x, y) => new web3.BigNumber(x).times(new web3.BigNumber(10).toPower(y))
const pct16 = x => bigExp(x, 16)
const createdVoteId = receipt => getEventArgument(receipt, 'StartVote', 'voteId')
Expand Down Expand Up @@ -59,8 +58,8 @@ contract('Voting App', ([root, holder1, holder2, holder20, holder29, holder51, n
const votingDuration = 1000

before(async () => {
const kernelBase = await getContract('Kernel').new(true) // petrify immediately
const aclBase = await getContract('ACL').new()
const kernelBase = await Kernel.new(true) // petrify immediately
const aclBase = await ACL.new()
const regFact = await EVMScriptRegistryFactory.new()
daoFact = await DAOFactory.new(kernelBase.address, aclBase.address, regFact.address)
votingBase = await Voting.new()
Expand Down
14 changes: 11 additions & 3 deletions future-apps/payroll/.solcover.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
module.exports = {
norpc: true,
copyPackages: ['@aragon/os', '@aragon/apps-finance', '@aragon/apps-vault', '@aragon/test-helpers'],
copyPackages: [
'@aragon/os',
'@aragon/apps-finance',
'@aragon/apps-vault',
'@aragon/ppf-contracts',
'@aragon/test-helpers'
],
skipFiles: [
'test',
'test',
'examples',
'@aragon/os',
'@aragon/apps-vault',
'@aragon/apps-finance',
'@aragon/ppf-contracts',
'@aragon/test-helpers',
]
],
// Turn on deep skip to avoid preprocessing (e.g. removing view/pure modifiers) for skipped files
deepSkip: true
}
4 changes: 2 additions & 2 deletions future-apps/payroll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
"@aragon/cli": "^6.0.0",
"@aragon/test-helpers": "^2.0.0",
"eth-gas-reporter": "^0.2.0",
"ethereumjs-testrpc-sc": "^6.1.6",
"ethereumjs-testrpc-sc": "^6.4.5-sc.3",
Copy link
Contributor

Choose a reason for hiding this comment

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

since the new solidity-coverage version is using ganache, do we still need this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so, the reason was that lerna hoisting makes running testrpc-sc a bit of a pain unless we explicitly declare this dependency here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, but I we shouldn't need to run it anymore right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we still have to; the ganache-cli.sh script runs testrpc-sc and AFAIK coverage still requires the modified version of testrpc.

"ganache-cli": "^6.4.3",
"solidity-coverage": "^0.5.11",
"solidity-coverage": "^0.6.2",
"solium": "^1.2.3",
"truffle": "4.1.14",
"truffle-extract": "^1.2.1"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"scripts": {
"install": "node scripts/install",
"bootstrap": "lerna bootstrap --hoist --nohoist=@aragon/os --nohoist=@aragon/apps-shared-minime",
"bootstrap": "lerna bootstrap --hoist --nohoist=@aragon/os --nohoist=@aragon/apps-* --nohoist=@aragon/ppf-contracts",
"bootstrap:ci": "npm run bootstrap -- --no-ci",
"clean": "git clean -fdxi apps future-apps shared",
"test": "npm run test:all",
Expand Down
2 changes: 1 addition & 1 deletion shared/test-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"peerDependencies": {
"ganache-cli": "^6.0.0",
"solidity-coverage": "^0.5.11"
"solidity-coverage": "^0.6.2"
},
"devDependencies": {
"ethereumjs-abi": "^0.6.4"
Expand Down