From 956193157167db79015f36e95ea1d40f60bdb26d Mon Sep 17 00:00:00 2001 From: Kunal Arora <55632507+aroralanuk@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:56:48 -0500 Subject: [PATCH] fix: failing ci tests for `SmartProvider` and `OpStackIsm.t.sol` (#3148) ### Description - Problem: OpStackIsm.t.sol was failing because of very stale block number for fork Fix: Excluding foundry fork testing from CI and updating block number - Problem: SmartProvider getLogs tests failing because the the results end up being an empty list and getConfirmations results a smaller number of confirmations than expected (712 vs 1705184) fix: excluded from ci ### Drive-by changes None ### Related issues None ### Backward compatibility Yes ### Testing Manual --- .github/workflows/test.yml | 4 ++-- package.json | 1 + solidity/foundry.toml | 4 ++-- solidity/package.json | 1 + solidity/test/isms/OPStackIsm.t.sol | 4 ++-- typescript/cli/package.json | 1 + typescript/helloworld/package.json | 1 + typescript/infra/package.json | 3 ++- typescript/sdk/package.json | 1 + typescript/utils/package.json | 3 ++- 10 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7b560d63b2..8399e8d043 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -126,7 +126,7 @@ jobs: key: ${{ github.sha }} - name: Unit Tests - run: yarn test + run: yarn test:ci metadata-check: runs-on: ubuntu-latest @@ -291,4 +291,4 @@ jobs: - name: Upload coverage reports to Codecov with GitHub Action uses: codecov/codecov-action@v3 with: - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/package.json b/package.json index ab3bf3b78d..4a11640054 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "prettier": "yarn workspaces foreach --since --parallel run prettier", "lint": "yarn workspaces foreach --since --parallel run lint", "test": "yarn workspaces foreach --all --parallel run test", + "test:ci": "yarn workspaces foreach --all --parallel run test:ci", "coverage": "yarn workspaces foreach --since --parallel run coverage", "version:prepare": "yarn changeset version && yarn workspaces foreach --all --parallel run version:update && yarn install --no-immutable", "version:check": "yarn changeset status", diff --git a/solidity/foundry.toml b/solidity/foundry.toml index 111db4f931..4146b69468 100644 --- a/solidity/foundry.toml +++ b/solidity/foundry.toml @@ -13,5 +13,5 @@ optimizer_runs = 999_999 verbosity = 4 [rpc_endpoints] -mainnet = "https://rpc.ankr.com/eth" -optimism = "https://rpc.ankr.com/optimism" +mainnet = "https://eth.merkle.io" +optimism = "https://optimism.llamarpc.com" diff --git a/solidity/package.json b/solidity/package.json index 39522176c8..3452bbac8f 100644 --- a/solidity/package.json +++ b/solidity/package.json @@ -54,6 +54,7 @@ "storage": "./storage.sh", "prettier": "prettier --write ./contracts ./test", "test": "hardhat test && forge test -vvv", + "test:ci": "hardhat test && forge test --no-match-test testFork -vvv", "gas": "forge snapshot", "gas-ci": "yarn gas --check --tolerance 2 || (echo 'Manually update gas snapshot' && exit 1)", "slither": "slither ." diff --git a/solidity/test/isms/OPStackIsm.t.sol b/solidity/test/isms/OPStackIsm.t.sol index d07ce02ca9..3066d7bda7 100644 --- a/solidity/test/isms/OPStackIsm.t.sol +++ b/solidity/test/isms/OPStackIsm.t.sol @@ -75,8 +75,8 @@ contract OPStackIsmTest is Test { function setUp() public { // block numbers to fork from, chain data is cached to ../../forge-cache/ - mainnetFork = vm.createFork(vm.rpcUrl("mainnet"), 17_586_909); - optimismFork = vm.createFork(vm.rpcUrl("optimism"), 106_233_774); + mainnetFork = vm.createFork(vm.rpcUrl("mainnet"), 18_992_500); + optimismFork = vm.createFork(vm.rpcUrl("optimism"), 114_696_811); testRecipient = new TestRecipient(); diff --git a/typescript/cli/package.json b/typescript/cli/package.json index f0aa308a66..f1d9d2269b 100644 --- a/typescript/cli/package.json +++ b/typescript/cli/package.json @@ -35,6 +35,7 @@ "lint": "eslint . --ext .ts", "prettier": "prettier --write ./src ./examples", "test": "mocha --config .mocharc.json", + "test:ci": "yarn test", "version:update": "echo \"export const VERSION = '$npm_package_version';\" > src/version.ts" }, "files": [ diff --git a/typescript/helloworld/package.json b/typescript/helloworld/package.json index 986e8f1f40..2dcc5745d0 100644 --- a/typescript/helloworld/package.json +++ b/typescript/helloworld/package.json @@ -56,6 +56,7 @@ "lint": "solhint contracts/**/*.sol && eslint . --ext .ts", "prettier": "prettier --write ./contracts ./src", "test": "hardhat test ./src/test/**/*.test.ts", + "test:ci": "yarn test", "sync": "ts-node scripts/sync-with-template-repo.ts" }, "types": "dist/src/index.d.ts", diff --git a/typescript/infra/package.json b/typescript/infra/package.json index 4253c8ef5e..895c7df45a 100644 --- a/typescript/infra/package.json +++ b/typescript/infra/package.json @@ -68,7 +68,8 @@ "announce": "hardhat announce --network localhost", "node": "hardhat node", "prettier": "prettier --write *.ts ./src ./config ./scripts ./test", - "test": "mocha --config ../sdk/.mocharc.json test/agents.test.ts" + "test": "mocha --config ../sdk/.mocharc.json test/agents.test.ts", + "test:ci": "yarn test" }, "peerDependencies": { "@ethersproject/abi": "*" diff --git a/typescript/sdk/package.json b/typescript/sdk/package.json index 212091bdc2..87932527ba 100644 --- a/typescript/sdk/package.json +++ b/typescript/sdk/package.json @@ -61,6 +61,7 @@ "prepublishOnly": "yarn build", "prettier": "prettier --write ./src", "test": "yarn test:unit && yarn test:hardhat && yarn test:foundry", + "test:ci": "yarn test:unit --exclude './src/**/SmartProvider.test.ts' && yarn test:hardhat && yarn test:foundry", "test:unit": "mocha --config .mocharc.json './src/**/*.test.ts' --exit", "test:hardhat": "hardhat test $(find ./src -name \"*.hardhat-test.ts\")", "test:metadata": "ts-node ./src/test/metadata-check.ts", diff --git a/typescript/utils/package.json b/typescript/utils/package.json index 1976a5b946..f7721a27f3 100644 --- a/typescript/utils/package.json +++ b/typescript/utils/package.json @@ -30,7 +30,8 @@ "clean": "rm -rf ./dist", "check": "tsc --noEmit", "prettier": "prettier --write ./src", - "test": "mocha --config .mocharc.json './src/**/*.test.ts'" + "test": "mocha --config .mocharc.json './src/**/*.test.ts'", + "test:ci": "yarn test" }, "sideEffects": false, "types": "dist/index.d.ts",