diff --git a/packages/contracts/.env.example b/packages/contracts/.env.example index 543c35c2e..b638374a1 100644 --- a/packages/contracts/.env.example +++ b/packages/contracts/.env.example @@ -3,7 +3,6 @@ ETHERSCAN_KEY= POLYGONSCAN_KEY= ARBISCAN_KEY= -REPORT_GAS= COINMARKETCAP_API_KEY= MAINNET_DAO_ENS_DOMAIN= diff --git a/packages/contracts/README.md b/packages/contracts/README.md index 6e057096b..c0047b5c5 100644 --- a/packages/contracts/README.md +++ b/packages/contracts/README.md @@ -46,6 +46,8 @@ npx solhint 'contracts/**/*.sol' npx solhint 'contracts/**/*.sol' --fix ``` +> Tests can be sped up if needed. See [the test performance optimization](#performance-optimizations) section for more info. + ## Documentation You can find all documentation regarding how to use this protocol in [Aragon's Developer Portal here](https://devs.aragon.org). @@ -177,6 +179,14 @@ describe('Legacy Test Example', function () { # Performance optimizations +There are 3 ways to run tests: + +1. `yarn test` runs tests in sequence. Can take a while but is the default. + +2. `yarn test:parallel`, depending on your hardware can be significantly faster and is generally good for most cases. See the [hardhat docs](https://hardhat.org/hardhat-runner/docs/guides/test-contracts#running-tests-in-parallel) for more information about parallelized testing. Not suitable for gas reports (see below) + +3. `yarn test:gas-report` outputs a gas report. Cannot be run in parallel mode. + For faster runs of your tests and scripts, consider skipping ts-node's type checking by setting the environment variable `TS_NODE_TRANSPILE_ONLY` to `1` in hardhat's environment. For more details see [the documentation](https://hardhat.org/guides/typescript.html#performance-optimizations). # Releases diff --git a/packages/contracts/hardhat.config.ts b/packages/contracts/hardhat.config.ts index 9c50c95e5..eb612bf32 100644 --- a/packages/contracts/hardhat.config.ts +++ b/packages/contracts/hardhat.config.ts @@ -156,7 +156,7 @@ const config: HardhatUserConfig = { exclude: ['test'], }, mocha: { - timeout: 60000, // 60 seconds // increase the timeout for subdomain validation tests + timeout: 90_000, // 90 seconds // increase the timeout for subdomain validation tests }, }; diff --git a/packages/contracts/package.json b/packages/contracts/package.json index f1f1b4c47..4a3d4db25 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -15,7 +15,9 @@ "typechain:osx": "ts-node scripts/generate-typechain-osx.ts", "typechain:osx-versions": "ts-node scripts/generate-typechain-osx-versions.ts", "typechain": "yarn typechain:osx && yarn typechain:osx-versions", + "test:parallel": "hardhat test --parallel", "test": "hardhat test", + "test:report-gas": "REPORT_GAS=true hardhat test", "build": "hardhat compile && yarn typechain", "build:npm": "rollup --config rollup.config.ts", "coverage": "hardhat coverage --solcoverjs ./.solcover.js",