Skip to content

Commit

Permalink
Switch to node:test and remove mocha and hardhat
Browse files Browse the repository at this point in the history
  • Loading branch information
noisekit committed Nov 4, 2024
1 parent 82228cf commit 181d357
Show file tree
Hide file tree
Showing 56 changed files with 103 additions and 2,473 deletions.
10 changes: 7 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ jobs:
GAS_REPORT: "./gas-<< parameters.chain-id >>-<< parameters.preset >>.csv"
command: |
TEST_FILES=$(circleci tests glob 'e2e/tests/<< parameters.toml >>/*.e2e.js')
echo "$TEST_FILES" | circleci tests run --verbose --split-by=timings --command="xargs yarn mocha --no-bail --exit --reporter mocha-multi --reporter-options spec=-,junit=/tmp/junit.xml"
echo "$TEST_FILES" | circleci tests run --verbose --split-by=timings --command="xargs node --test --test-reporter tap --test-reporter junit --test-reporter-destination=stdout --test-reporter-destination=/tmp/junit.xml"
- store_test_results:
path: "/tmp/junit.xml"
Expand Down Expand Up @@ -426,10 +426,14 @@ jobs:
GAS_REPORT: "./gas-<< parameters.chain-id >>-<< parameters.preset >>.csv"
command: |
TEST_FILES=$(circleci tests glob 'e2e/tests/<< parameters.toml >>/*.e2e.js')
echo "$TEST_FILES" | circleci tests run --verbose --split-by=timings --command="xargs yarn mocha --no-bail --exit --reporter mocha-multi --reporter-options spec=-,mocha-junit-reporter=tmp/junit.xml"
echo "$TEST_FILES" | circleci tests run --verbose --split-by=timings --command="xargs node --test --test-reporter tap --test-reporter junit --test-reporter-destination=stdout --test-reporter-destination=/tmp/junit.xml"
- store_test_results:
path: "./tmp/junit.xml"
path: "/tmp/junit.xml"

- store_artifacts:
path: "/tmp/junit.xml"
destination: "junit.xml"

- store_artifacts:
path: "./debug-<< parameters.chain-id >>-<< parameters.preset >>.log"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This is a GitOps repo for deployment of the [Synthetix](https://www.github.com/s
Sometimes newer or older versions of cannon may produce incompatible state and as a result deployment state will be borked.
Using exactly same cannon version as all the repo maintainers use is a requirement and not an recommendation.

Run `yarn upgrade-interactive` and make sure that `@usecannon/cli` and `hardhat-cannon` are updated to the latest versions.
Run `yarn upgrade-interactive` and make sure that `@usecannon/cli` and `@usecannon/builder` are updated to the latest versions.
If not, make a separate PR with cannon update (even though cannon updates are automated, there is a delay up to a day for that to happen)

After installing for the first time, run `yarn cannon setup` to configure a reliable IPFS URL for publishing packages and any other preferred settings,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const assert = require('assert');
const { ethers } = require('ethers');
const crypto = require('crypto');
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/omnibus-arbitrum-mainnet.toml/Rewards_ARB.e2e.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const assert = require('assert');
const { ethers } = require('ethers');
require('../../inspect');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const assert = require('assert');
const { ethers } = require('ethers');
require('../../inspect');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const assert = require('assert');
const { ethers } = require('ethers');
require('../../inspect');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const assert = require('assert');
const { ethers } = require('ethers');
const crypto = require('crypto');
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/omnibus-arbitrum-sepolia.toml/Rewards_ARB.e2e.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const assert = require('assert');
const { ethers } = require('ethers');
require('../../inspect');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const assert = require('assert');
const { ethers } = require('ethers');
require('../../inspect');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const assert = require('assert');
const { ethers } = require('ethers');
const crypto = require('crypto');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const assert = require('assert');
const { ethers } = require('ethers');
require('../../inspect');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const assert = require('assert');
const { ethers } = require('ethers');
require('../../inspect');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const assert = require('assert');
const { ethers } = require('ethers');
const crypto = require('crypto');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/omnibus-mainnet.toml/LegacyMarket.e2e.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const assert = require('assert');
const { getLpPosition } = require('../../tasks/getLpPosition');
const { getAccountCollateral } = require('../../tasks/getAccountCollateral');
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/omnibus-mainnet.toml/Staking.e2e.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const assert = require('assert');
const { ethers } = require('ethers');
const crypto = require('crypto');
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/omnibus-optimism-mainnet.toml/Stub.e2e.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/omnibus-sepolia.toml/BFP_Market_ETH.e2e.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers, BigNumber } = require('ethers');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers, BigNumber } = require('ethers');
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/omnibus-sepolia.toml/BFP_Market_snxUSD.e2e.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/omnibus-sepolia.toml/LegacyMarket.e2e.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const assert = require('assert');
const { getLpPosition } = require('../../tasks/getLpPosition');
const { getAccountCollateral } = require('../../tasks/getAccountCollateral');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/omnibus-snaxchain-mainnet.toml/Stub.e2e.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/omnibus-snaxchain-testnet.toml/Stub.e2e.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it, before, after } = require('node:test');
const crypto = require('crypto');
const assert = require('assert');
const { ethers } = require('ethers');
Expand Down
29 changes: 9 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
"build:arbitrum-sepolia": "cannon build omnibus-arbitrum-sepolia.toml --dry-run --port 8545 --upgrade-from synthetix-omnibus:latest@main --chain-id 421614 --provider-url https://arbitrum-sepolia.infura.io/v3/$INFURA_API_KEY | tee ./e2e/cannon-build.log",
"build:snax": "cannon build omnibus-snaxchain-mainnet.toml --dry-run --port 8545 --upgrade-from synthetix-omnibus:latest@main --chain-id 2192 --provider-url https://mainnet.snaxchain.io | tee ./e2e/cannon-build.log",
"build:snax-testnet": "cannon build omnibus-snaxchain-testnet.toml --dry-run --port 8545 --upgrade-from synthetix-omnibus:latest@main --chain-id 13001 --provider-url https://testnet.snaxchain.io | tee ./e2e/cannon-build.log",
"test:mainnet": "DEBUG='e2e:*' mocha ./e2e/tests/omnibus-mainnet.toml/**/*.e2e.js",
"test:sepolia": "DEBUG='e2e:*' mocha ./e2e/tests/omnibus-sepolia.toml/**/*.e2e.js",
"test:optimism": "DEBUG='e2e:*' mocha ./e2e/tests/omnibus-optimism-mainnet.toml/**/*.e2e.js",
"test:base": "DEBUG='e2e:*' mocha ./e2e/tests/omnibus-base-mainnet-andromeda.toml/**/*.e2e.js",
"test:base-sepolia": "DEBUG='e2e:*' mocha ./e2e/tests/omnibus-base-sepolia-andromeda.toml/**/*.e2e.js",
"test:arbitrum": "DEBUG='e2e:*' mocha ./e2e/tests/omnibus-arbitrum-mainnet.toml/**/*.e2e.js",
"test:arbitrum-sepolia": "DEBUG='e2e:*' mocha ./e2e/tests/omnibus-arbitrum-sepolia.toml/**/*.e2e.js",
"test:snax": "DEBUG='e2e:*' mocha ./e2e/tests/omnibus-snaxchain-mainnet.toml/**/*.e2e.js",
"test:snax-testnet": "DEBUG='e2e:*' mocha ./e2e/tests/omnibus-snaxchain-testnet.toml/**/*.e2e.js",
"test:mainnet": "DEBUG='e2e:*' node --test --test-reporter spec ./e2e/tests/omnibus-mainnet.toml/**/*.e2e.js",
"test:sepolia": "DEBUG='e2e:*' node --test --test-reporter spec ./e2e/tests/omnibus-sepolia.toml/**/*.e2e.js",
"test:optimism": "DEBUG='e2e:*' node --test --test-reporter spec ./e2e/tests/omnibus-optimism-mainnet.toml/**/*.e2e.js",
"test:base": "DEBUG='e2e:*' node --test --test-reporter spec ./e2e/tests/omnibus-base-mainnet-andromeda.toml/**/*.e2e.js",
"test:base-sepolia": "DEBUG='e2e:*' node --test --test-reporter spec ./e2e/tests/omnibus-base-sepolia-andromeda.toml/**/*.e2e.js",
"test:arbitrum": "DEBUG='e2e:*' node --test --test-reporter spec ./e2e/tests/omnibus-arbitrum-mainnet.toml/**/*.e2e.js",
"test:arbitrum-sepolia": "DEBUG='e2e:*' node --test --test-reporter spec ./e2e/tests/omnibus-arbitrum-sepolia.toml/**/*.e2e.js",
"test:snax": "DEBUG='e2e:*' node --test --test-reporter spec ./e2e/tests/omnibus-snaxchain-mainnet.toml/**/*.e2e.js",
"test:snax-testnet": "DEBUG='e2e:*' node --test --test-reporter spec ./e2e/tests/omnibus-snaxchain-testnet.toml/**/*.e2e.js",
"pretty": "prettier . '**/*.toml' --write",
"pretty:check": "prettier . '**/*.toml' --check",
"fetch-deployments": "DEBUG='e2e:*' node e2e/extractCannonState ./e2e/cannon-build.log > /tmp/cannonState.json && DEBUG='e2e:*' node e2e/generateDeployments /tmp/cannonState.json",
Expand All @@ -58,10 +58,6 @@
"@usecannon/cli": "2.18.4",
"debug": "^4.3.7",
"ethers": "^5.7.2",
"hardhat": "^2.22.14",
"mocha": "^10.7.3",
"mocha-junit-reporter": "^2.2.1",
"mocha-multi": "^1.1.7",
"numbro": "^2.5.0",
"pako": "^2.1.0",
"prettier": "^3.3.3",
Expand All @@ -70,12 +66,5 @@
"supports-color": "^8.1.1",
"viem": "^2.21.34"
},
"mocha": {
"timeout": "5m",
"recursive": true,
"bail": true,
"async-only": true,
"exit": true
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit 181d357

Please sign in to comment.