Skip to content

Commit 2dbe7f5

Browse files
committed
Separate zkSync Tests to Separate CI Step
This PR moves the zkSync tests outside of the normal `test` NPM script. Since this would make it no longer run by default in CI, we added a separate `tests-zk` step to run the zkSync tests only. This split allows us to potentially merge PRs when zkSync tests fail as long as the normal test suite does not. It is not the first time that CI starts failing without cause because of zkSync tests. As far as I can tell, the zkSync tooling downloads an in-memory node binary that it starts for actually executing the tests. In the past, tests have randomly started to fail because of: * Changes to the behaviour of the in-memory node ([example](https://github.com/safe-global/safe-smart-account/actions/runs/14359540825/job/40257156305?pr=938)) * Binary no longer hosted on the same URL ([example](https://github.com/safe-global/safe-smart-account/actions/runs/14359540825/job/40257156305?pr=938)) When this happens, we do not want to block changes that are unrelated to contract logic (as they should not, in theory, have any affect on the zkSync tests). Furthermore, running the zkSync tests takes quite a bit longer than the regular tests, so this also makes local `npm test` a bit faster.
1 parent bf8582f commit 2dbe7f5

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ jobs:
4141
- run: npm run build
4242
- run: npm run test
4343

44+
tests-zk:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: actions/setup-node@v4
49+
with:
50+
node-version: ${{ env.NODE_VERSION }}
51+
cache: "npm"
52+
- run: npm ci
53+
- run: npm run build
54+
- run: npm run test:zk
55+
4456
coverage:
4557
runs-on: ubuntu-latest
4658
strategy:

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818
"build:zk": "HARDHAT_ENABLE_ZKSYNC=1 hardhat compile",
1919
"build:ts": "rimraf dist && tsc -p tsconfig.prod.json",
2020
"build:ts:dev": "rimraf dist && tsc -p tsconfig.json",
21-
"test:zk": "HARDHAT_ENABLE_ZKSYNC=1 hardhat test",
22-
"test": "hardhat test --network hardhat && npm run test:L1 && npm run test:L2 && npm run test:zk",
23-
"test:parallel": "hardhat test --parallel",
21+
"test": "npm run test:hardhat && npm run test:L1 && npm run test:L2",
22+
"test:all": "npm run test && npm run test:zk",
23+
"test:hardhat": "hardhat test --network hardhat",
2424
"test:L1": "HARDHAT_CHAIN_ID=1 hardhat test --grep '@L1'",
2525
"test:L2": "SAFE_CONTRACT_UNDER_TEST=SafeL2 hardhat test --network hardhat",
26+
"test:zk": "HARDHAT_ENABLE_ZKSYNC=1 hardhat test",
2627
"coverage": "hardhat coverage",
2728
"codesize": "hardhat codesize",
2829
"benchmark": "hardhat test benchmark/*.ts",

0 commit comments

Comments
 (0)