Skip to content

Separate zkSync Tests to Separate CI Step#939

Merged
nlordell merged 1 commit intomainfrom
chore/refactor-zk-sync-ci
Apr 10, 2025
Merged

Separate zkSync Tests to Separate CI Step#939
nlordell merged 1 commit intomainfrom
chore/refactor-zk-sync-ci

Conversation

@nlordell
Copy link
Copy Markdown
Collaborator

@nlordell nlordell commented Apr 10, 2025

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)
  • Binary no longer hosted on the same URL (example)

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.

@nlordell nlordell requested a review from a team as a code owner April 10, 2025 08:08
@nlordell nlordell requested review from akshay-ap, mmv08, remedcu and rmeissner and removed request for a team April 10, 2025 08:08
@mmv08
Copy link
Copy Markdown
Contributor

mmv08 commented Apr 10, 2025

I'm slightly torn to be honest, because:

  1. I agree with your assessment
  2. At the same time, we could take these failures as a reminder to keep our tooling up to date (we don't have a process for this)

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).

but we cannot make zksync tests mandatory when PRs change the contract logic, right? so maybe we should continue being on the defensive side and update the tooling instead

@nlordell
Copy link
Copy Markdown
Collaborator Author

At the same time, we could take these failures as a reminder to keep our tooling up to date

I agree - which is why I moved the tests to a step (that will still show up as a failure and be a reminder for us) but not block development. I think from a CI perspective, having non-determinism in tests is a huge problem (there is a reason we have a lock file so all NPM dependencies and JS that we pull in is at an exact version).

I don't think we shouldn't fix the zkSync tests, but I also don't know how long it will take (zkSync testing has been challenging in the past), and it is blocking the merge of things we want to have for 1.5.0.

@mmv08
Copy link
Copy Markdown
Contributor

mmv08 commented Apr 10, 2025

i created a pr for dependencies updates #940

@nlordell
Copy link
Copy Markdown
Collaborator Author

I still think zkSync should be a separate CI step to be honest. We can configure it to be mandatory in the project settings (so it is effectively the same) but it makes things more flexible for us.

I also think the test run-times are a bit too high right now... We can discuss in our standup today.

Copy link
Copy Markdown
Contributor

@remedcu remedcu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@nlordell nlordell force-pushed the chore/refactor-zk-sync-ci branch 2 times, most recently from 0197c79 to e702774 Compare April 10, 2025 12:48
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.
@nlordell nlordell force-pushed the chore/refactor-zk-sync-ci branch from e702774 to 2dbe7f5 Compare April 10, 2025 13:04
@nlordell nlordell merged commit c73f36c into main Apr 10, 2025
33 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 10, 2025
@nlordell
Copy link
Copy Markdown
Collaborator Author

Just to follow up here, tests-zk is a required CI check to pass:

image

@nlordell nlordell deleted the chore/refactor-zk-sync-ci branch April 10, 2025 13:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants