-
Notifications
You must be signed in to change notification settings - Fork 106
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
[WIP] Upgrade solidity-coverage to 0.7.0-beta #716
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
const { execSync } = require("child_process"); | ||
const log = console.log; | ||
|
||
// Copies pre-built token artifacts to .coverage_artifacts/contracts | ||
function provisionTokenContracts(config){ | ||
let output; | ||
const provisionColonyToken = `bash ./scripts/provision-token-contracts.sh`; | ||
|
||
log('Provisioning ColonyToken contracts...') | ||
output = execSync(provisionColonyToken); | ||
log(output.toString()) | ||
} | ||
|
||
module.exports = { | ||
skipFiles: [ | ||
'Migrations.sol', | ||
|
@@ -7,8 +20,13 @@ module.exports = { | |
'testHelpers/NoLimitSubdomains', | ||
'testHelpers/TaskSkillEditing' | ||
], | ||
copyPackages: ['openzeppelin-solidity'], | ||
compileCommand: 'yarn run provision:token:contracts', | ||
testCommand: '../node_modules/.bin/truffle test --network coverage', | ||
testrpcOptions: `--port 8555 -i 1999 --acctKeys="./coverageEnv/ganache-accounts.json" --noVMErrorsOnRPCResponse --accounts 12 --allowUnlimitedContractSize` | ||
}; | ||
providerOptions: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are all the flags passed to testrc-sc, translated to ganache-core options and passed to ganache. |
||
port: 8555, | ||
network_id: 1999, | ||
account_keys_path: "./ganache-accounts.json", | ||
vmErrorsOnRPCResponse: false, | ||
total_accounts: 12 | ||
}, | ||
onCompileComplete: provisionTokenContracts | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ export async function setupEtherRouter(interfaceContract, deployedImplementation | |
const fName = value.name; | ||
const fType = value.type; | ||
// These are from DSAuth, and so are on EtherRouter itself without any more help. | ||
if (fName !== "authority" && fName !== "owner") { | ||
if (fName !== "authority" && fName !== "owner" && !fName.includes("coverage_")) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instrumentation is now done using an injected public function (instead of an event) and it needs to be excluded here. |
||
// We only care about functions. | ||
if (fType === "function") { | ||
// Gets the types of the parameters, which is all we care about for function signatures. | ||
|
@@ -92,7 +92,6 @@ export async function setupUpgradableColonyNetwork( | |
deployedImplementations.ContractRecovery = contractRecovery.address; | ||
|
||
await setupEtherRouter("IColonyNetwork", deployedImplementations, resolver); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a mistake. |
||
await etherRouter.setResolver(resolver.address); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
"test:contracts:upgrade:2to3": "npm run start:blockchain:client:2to3 & truffle test ./test-upgrade/2to3/2to3.js", | ||
"test:contracts:gasCosts": "npm run start:blockchain:client & truffle migrate --reset --compile-all && truffle test test-gas-costs/gasCosts.js --network development", | ||
"test:contracts:patricia": "npm run start:blockchain:client parity & truffle migrate --reset --compile-all && truffle test packages/reputation-miner/patricia-test.js --network development", | ||
"test:contracts:coverage": "SOLIDITY_COVERAGE=1 solidity-coverage && istanbul check-coverage --statements 99 --branches 94 --functions 99 --lines 99", | ||
"test:contracts:coverage": "SOLIDITY_COVERAGE=1 truffle run coverage --network coverage --temp build && istanbul check-coverage --statements 99 --branches 94 --functions 99 --lines 99", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There something important here: In <= |
||
"test:contracts:watch": "npm run start:blockchain:client & truffle migrate --reset --compile-all && truffle watch --network development", | ||
"test:contracts:e2e": "npm run start:blockchain:client & truffle migrate --reset --compile-all && truffle test test-system/end-to-end.js --network development", | ||
"test:security:slither": "slither contracts/ --solc-disable-warnings --exclude-low --exclude-informational --exclude uninitialized-state-variables,uninitialized-local-variables,reentrancy-no-eth", | ||
|
@@ -108,10 +108,10 @@ | |
"prettier": "^1.18.0", | ||
"rimraf": "^3.0.0", | ||
"shortid": "^2.2.14", | ||
"solidity-coverage": "^0.6.0", | ||
"solidity-coverage": "0.7.0-beta.2", | ||
"solidity-parser-antlr": "^0.4.5", | ||
"solidity-steamroller": "^1.1.0", | ||
"truffle": "^5.0.14", | ||
"truffle": "^5.0.37", | ||
"truffle-hdwallet-provider": "^1.0.9", | ||
"truffle-security": "^1.5.2", | ||
"web3-utils": "^1.0.0" | ||
|
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.
This token provisioning is now done in a post-compilation hook executed by the Truffle plugin. You're also usually compiling the DappSys contracts during this step but Truffle kept reporting there was nothing to compile there, so I just skipped that. But if it's necessary it would go in this function...