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

Testing solidity-coverage hardhat plugin #2

Open
wants to merge 10 commits into
base: buidler-multi-solc
Choose a base branch
from
Open
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
229 changes: 67 additions & 162 deletions .circleci/config.yml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ parameters:
network:
type: string
steps:
- fork_start:
- cmd-fork-start:
network: << parameters.network >>
reset: true
- run: node publish deploy --use-fork --yes --network << parameters.network >>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ steps:
- run:
command: node publish fork --network << parameters.network >> <<# parameters.reset >> --reset <</ parameters.reset >>
background: true
- wait_for_rpc
- cmd-wait-for-rpc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ parameters:
network:
type: string
steps:
- fork_start:
- cmd-fork-start:
network: << parameters.network >>
reset: true
- run: npm run test:prod:gas && npx codechecks codechecks.prod.yml
- store_artifacts:
path: test-gas-used-prod.log
9 changes: 9 additions & 0 deletions .circleci/src/jobs/job-compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
working_directory: ~/repo
docker:
- image: circleci/node:12.18
steps:
- checkout
- attach_workspace:
at: .
- run: npx buidler compile --optimizer --fail-oversize
- run: npx buidler compile --use-ovm --optimizer --fail-oversize
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ steps:
- checkout
- attach_workspace:
at: .
- fork_test_prod:
- cmd-fork-deploy:
network: << parameters.network >>
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ steps:
- checkout
- attach_workspace:
at: .
- fork_prepare_deploy:
- cmd-fork-prepare-deploy:
network: << parameters.network >>
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ steps:
- checkout
- attach_workspace:
at: .
- fork_deploy:
- cmd-fork-test-prod:
network: << parameters.network >>
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ steps:
- attach_workspace:
at: .
- run: npm run test:gas && npx codechecks codechecks.unit.yml
- store_artifacts:
path: test-gas-used.log
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
- restore_cache:
keys:
- 'v2-dependencies-{{ checksum "package-lock.json" }}'
- run: npm ci
- run: yarn
- save_cache:
key: 'v2-dependencies-{{ checksum "package-lock.json" }}'
paths:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ steps:
- checkout
- attach_workspace:
at: .
- testnet_pvt:
- cmd-testnet-pvt:
network: kovan
- etherscan_check:
- cmd-etherscan-check:
network: kovan
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ steps:
- attach_workspace:
at: .
# - run: No PVT for mainnet just yet
- etherscan_check:
- cmd-etherscan-check:
network: mainnet
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ steps:
- attach_workspace:
at: .
- run:
name: Compile in OVM, enforcing size limit
name: Run unit tests on OVM compiled output (TODO enable tests)
command: |
npx buidler compile --ovm --optimizer
npx buidler compile --use-ovm --optimizer
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ steps:
- checkout
- attach_workspace:
at: .
- testnet_pvt:
- cmd-testnet-pvt:
network: rinkeby
- etherscan_check:
- cmd-etherscan-check:
network: rinkeby
61 changes: 0 additions & 61 deletions .circleci/src/workflows/dev.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .circleci/src/workflows/workflow-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
jobs:
- job-prepare
- job-test-ovm:
requires:
- job-prepare
- job-coverage-report:
requires:
- job-prepare
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
jobs:
- prepare:
- job-prepare:
filters:
branches:
only: develop
# ~~~~~~~~~~~~~~~ MAINNET ~~~~~~~~~~~~~~~ #
- fork-prepare-deploy:
name: fork-prepare-deploy-mainnet
- job-fork-prepare-deploy:
name: job-fork-prepare-deploy-mainnet
network: mainnet
requires:
- prepare
- fork-deploy:
name: fork-deploy-mainnet
- job-prepare
- job-fork-deploy:
name: job-fork-deploy-mainnet
network: mainnet
requires:
- fork-prepare-deploy-mainnet
- fork-test-prod:
name: fork-test-prod-mainnet
- job-fork-prepare-deploy-mainnet
- job-fork-test-prod:
name: job-fork-test-prod-mainnet
network: mainnet
requires:
- fork-deploy-mainnet
- job-fork-deploy-mainnet
# ~~~~~~~~~~~~~~~ RINKEBY ~~~~~~~~~~~~~~~ #
- fork-prepare-deploy:
name: fork-prepare-deploy-rinkeby
- job-fork-prepare-deploy:
name: job-fork-prepare-deploy-rinkeby
network: rinkeby
requires:
- prepare
- job-prepare
filters:
branches:
only: develop
- fork-deploy:
name: fork-deploy-rinkeby
- job-fork-deploy:
name: job-fork-deploy-rinkeby
network: rinkeby
requires:
- fork-prepare-deploy-rinkeby
- job-fork-prepare-deploy-rinkeby
filters:
branches:
only: develop
- fork-test-prod:
name: fork-test-prod-rinkeby
- job-fork-test-prod:
name: job-fork-test-prod-rinkeby
network: rinkeby
requires:
- fork-deploy-rinkeby
- job-fork-deploy-rinkeby
filters:
branches:
only: develop
# ~~~~~~~~~~~~~~~ KOVAN ~~~~~~~~~~~~~~~ #
- fork-prepare-deploy:
name: fork-prepare-deploy-kovan
- job-fork-prepare-deploy:
name: job-fork-prepare-deploy-kovan
network: rinkeby
requires:
- prepare
- job-prepare
filters:
branches:
only: develop
- fork-deploy:
name: fork-deploy-kovan
- job-fork-deploy:
name: job-fork-deploy-kovan
network: rinkeby
requires:
- fork-prepare-deploy-kovan
- job-fork-prepare-deploy-kovan
filters:
branches:
only: develop
- fork-test-prod:
name: fork-test-prod-kovan
- job-fork-test-prod:
name: job-fork-test-prod-kovan
network: rinkeby
requires:
- fork-deploy-kovan
- job-fork-deploy-kovan
filters:
branches:
only: develop
Expand Down
12 changes: 0 additions & 12 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
const {
constants: { inflationStartTimestampInSecs },
} = require('.');

module.exports = {
port: 8545,
skipFiles: [
'test-helpers',
'EscrowChecker.sol',
],
providerOptions: {
default_balance_ether: 10000000000000, // extra zero just in case (coverage consumes more gas)
time: new Date(inflationStartTimestampInSecs * 1000),
network_id: 55,
gasLimit: 0x1fffffffffffff,
},
mocha: {
grep: '@cov-skip', // Find everything with this tag
invert: true, // Run the grep's inverse set.
Expand All @@ -22,5 +11,4 @@ module.exports = {
// passed to compiler causes it to crash (See discussion PR #732)
// Line and branch coverage will still be reported.
measureStatementCoverage: false,
measureFunctionCoverage: true,
};
4 changes: 2 additions & 2 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { TASK_COMPILE_SOLIDITY_GET_SOLC_BUILD } = require('hardhat/builtin-tasks/
// require('@eth-optimism/ovm-toolchain/build/src/buidler-plugins/buidler-ovm-compiler'); // enable custom solc compiler
// require('@eth-optimism/ovm-toolchain/build/src/buidler-plugins/buidler-ovm-node'); // add ability to start an OVM node

// usePlugin('solidity-coverage');
require('solidity-coverage');
// usePlugin('buidler-ast-doc'); // compile ASTs for use with synthetix-docs
// usePlugin('buidler-gas-reporter');

Expand Down Expand Up @@ -305,6 +305,7 @@ const localNetwork = Object.assign(
baseNetworkConfig
);


module.exports = {
GAS_PRICE,
solidity: {
Expand All @@ -330,7 +331,6 @@ module.exports = {
},
networks: {
hardhat: baseNetworkConfig,
coverage: localNetwork,
localhost: localNetwork,
},
gasReporter: {
Expand Down
Loading