Skip to content

Commit eb952c3

Browse files
committed
Consolidate .solcover config files
1 parent ded4d9d commit eb952c3

9 files changed

+25
-25
lines changed

.solcover.extensions.js

-5
This file was deleted.

.solcover.reputation.js

-5
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const config = require("./.solcover.js")
1+
const config = require("./solcover.js")
22

33
config.providerOptions.network_id = parseInt(process.env.CHAIN_ID, 10);
44
config.providerOptions._chainId = parseInt(process.env.CHAIN_ID, 10);
55
config.providerOptions._chainIdRpc = parseInt(process.env.CHAIN_ID, 10);
66
config.istanbulFolder = `./coverage-chainid-${process.env.CHAIN_ID}`
7-
module.exports = config
7+
module.exports = config

.solcover.crosschain.js renamed to .solcover/crosschain.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
const config = require("./.solcover.js")
2-
const ethers = require("ethers");
1+
const config = require("./solcover.js")
32

4-
const { FORKED_XDAI_CHAINID } = require("./helpers/constants");
3+
const { FORKED_XDAI_CHAINID } = require("./../helpers/constants");
54

65
config.istanbulFolder = `./coverage-cross-chain-${process.env.HARDHAT_FOREIGN === "true" ? "foreign" : "home"}`
76
console.log(`Coverage folder: ${config.istanbulFolder}`)

.solcover/extensions.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const config = require("./solcover.js")
2+
3+
config.istanbulFolder = "./coverage-extensions"
4+
5+
module.exports = config

.solcover/reputation.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const config = require("./solcover.js")
2+
3+
config.istanbulFolder = "./coverage-reputation"
4+
5+
module.exports = config

.solcover.js renamed to .solcover/solcover.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
},
1414
providerOptions: {
1515
network_id: 1999,
16-
account_keys_path: "./ganache-accounts.json",
16+
account_keys_path: "./../ganache-accounts.json",
1717
vmErrorsOnRPCResponse: false,
1818
total_accounts: 18,
1919
_chainId: 265669100,

.solcover.upgrade.js renamed to .solcover/upgrade.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
const config = require("./solcover.js")
2+
13
const { execSync } = require("child_process");
2-
const config = require("./.solcover.js")
34

45
function getFilesToSkip(){
56
const array = [
@@ -16,4 +17,4 @@ function getFilesToSkip(){
1617
config.istanbulFolder = "./coverage-upgrade"
1718
config.skipFiles = getFilesToSkip();
1819

19-
module.exports = config
20+
module.exports = config

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@
4848
"test:contracts:bridging:2": "CHAIN_ID_1=265669101 CHAIN_ID_2=265669100 pnpm run start:blockchain:client:both && HARDHAT_FOREIGN=true MINING_CHAIN_ID=265669100 CHAIN_ID=265669101 npx hardhat test ./test/cross-chain/* --network development",
4949
"test:contracts:chainid": "pnpm run start:blockchain:client && npx hardhat test ./test/misc/chainid.js",
5050
"test:contracts:e2e": "pnpm run start:blockchain:client && npx hardhat test test/misc/end-to-end.js --network development",
51-
"test:contracts:coverage": "npx hardhat coverage --temp build-coverage --testfiles './test/contracts-network/*'",
52-
"test:contracts:extensions:coverage": "npx hardhat compile && NODE_OPTIONS='--max-old-space-size=6144' npx hardhat coverage --solcoverjs ./.solcover.extensions.js --temp build-coverage --testfiles './test/extensions/*'",
53-
"test:contracts:bridging:1:coverage": "CHAIN_ID=265669101 pnpm run start:blockchain:client:2 && HARDHAT_FOREIGN=false MINING_CHAIN_ID=265669100 npx hardhat --show-stack-traces coverage --solcoverjs ./.solcover.crosschain.js --temp build-coverage --testfiles './test/cross-chain/**/*'",
54-
"test:contracts:bridging:2:coverage": "CHAIN_ID=265669100 pnpm run start:blockchain:client:2 && HARDHAT_FOREIGN=true MINING_CHAIN_ID=265669100 CHAIN_ID=265669101 npx hardhat coverage --solcoverjs ./.solcover.crosschain.js --temp build-coverage --testfiles './test/cross-chain/**/*'",
55-
"test:contracts:chainid:coverage": "npx hardhat coverage --solcoverjs ./.solcover.chainid.js --temp build-coverage --testfiles './test/misc/chainid.js'",
56-
"test:contracts:upgrade:coverage": "pnpm run generate:test:contracts && npx hardhat coverage --solcoverjs ./.solcover.upgrade.js --temp build-coverage --testfiles './test/upgrade/*'",
51+
"test:contracts:coverage": "npx hardhat coverage --solcoverjs ./.solcover/solcover.js --temp build-coverage --testfiles './test/contracts-network/*'",
52+
"test:contracts:extensions:coverage": "npx hardhat compile && NODE_OPTIONS='--max-old-space-size=6144' npx hardhat coverage --solcoverjs ./.solcover/extensions.js --temp build-coverage --testfiles './test/extensions/*'",
53+
"test:contracts:bridging:1:coverage": "CHAIN_ID=265669101 pnpm run start:blockchain:client:2 && HARDHAT_FOREIGN=false MINING_CHAIN_ID=265669100 npx hardhat --show-stack-traces coverage --solcoverjs ./.solcover/crosschain.js --temp build-coverage --testfiles './test/cross-chain/**/*'",
54+
"test:contracts:bridging:2:coverage": "CHAIN_ID=265669100 pnpm run start:blockchain:client:2 && HARDHAT_FOREIGN=true MINING_CHAIN_ID=265669100 CHAIN_ID=265669101 npx hardhat coverage --solcoverjs ./.solcover/crosschain.js --temp build-coverage --testfiles './test/cross-chain/**/*'",
55+
"test:contracts:chainid:coverage": "npx hardhat coverage --solcoverjs ./.solcover/chainid.js --temp build-coverage --testfiles './test/misc/chainid.js'",
56+
"test:contracts:upgrade:coverage": "pnpm run generate:test:contracts && npx hardhat coverage --solcoverjs ./.solcover/upgrade.js --temp build-coverage --testfiles './test/upgrade/*'",
5757
"test:reputation:1": "pnpm run start:blockchain:client && npx hardhat test ./test/reputation-system/*.js --network development",
5858
"test:reputation:2": "pnpm run start:blockchain:client && npx hardhat test ./test/reputation-system/reputation-mining-client/* --network development",
5959
"test:reputation:1:anotherChain": "CHAIN_ID=101010101 pnpm run start:blockchain:client && MINING_CHAIN_ID=101010101 CHAIN_ID=101010101 npx hardhat test ./test/reputation-system/*.js --network development",
6060
"test:reputation:2:anotherChain": "CHAIN_ID=101010101 pnpm run start:blockchain:client && MINING_CHAIN_ID=101010101 CHAIN_ID=101010101 npx hardhat test ./test/reputation-system/reputation-mining-client/* --network development",
61-
"test:reputation:coverage": "npx hardhat coverage --solcoverjs ./.solcover.reputation.js --temp build-coverage --testfiles './test/reputation-system/**/*'",
61+
"test:reputation:coverage": "npx hardhat coverage --solcoverjs ./.solcover/reputation.js --temp build-coverage --testfiles './test/reputation-system/**/*'",
6262
"test:security:slither": "slither . --solc-disable-warnings --exclude-low --exclude-informational --exclude-optimization --filter-paths 'lib|contracts/testHelpers|@openzeppelin'",
6363
"posttest:contracts": "pnpm run stop:blockchain:client",
6464
"posttest:contracts:extensions": "pnpm run stop:blockchain:client",

0 commit comments

Comments
 (0)