-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add integration test ci for zk_toolbox
- Loading branch information
Showing
9 changed files
with
148 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Workflow template for CI jobs for Core Components | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
lint: | ||
name: lint | ||
uses: ./.github/workflows/ci-core-lint-reusable.yml | ||
|
||
build: | ||
runs-on: [matterlabs-ci-runner] | ||
|
||
steps: | ||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 | ||
with: | ||
submodules: "recursive" | ||
fetch-depth: 0 | ||
|
||
- name: Setup environment | ||
run: | | ||
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV | ||
echo $(pwd)/bin >> $GITHUB_PATH | ||
echo IN_DOCKER=1 >> .env | ||
- name: Start services | ||
run: | | ||
ci_localnet_up | ||
- name: Build | ||
run: | | ||
ci_run bash -c "cd zk_toolbox && cargo build --release" | ||
# Compress with tar to avoid permission loss | ||
# https://github.com/actions/upload-artifact?tab=readme-ov-file#permission-loss | ||
- name: Tar zk_toolbox binaries | ||
run: | | ||
tar -C ./zk_toolbox/target/release -cvf zk_toolbox.tar zk_inception zk_supervisor | ||
- name: Upload zk_toolbox binaries | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: zk_toolbox | ||
path: zk_toolbox.tar | ||
compression-level: 0 | ||
|
||
integration_test: | ||
runs-on: [matterlabs-ci-runner] | ||
needs: [build] | ||
|
||
steps: | ||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 | ||
with: | ||
submodules: "recursive" | ||
fetch-depth: 0 | ||
|
||
- name: Download zk_toolbox binaries | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: zk_toolbox | ||
path: . | ||
|
||
- name: Extract zk_toolbox binaries | ||
run: | | ||
tar -xvf zk_toolbox.tar -C ./bin | ||
- name: Setup environment | ||
run: | | ||
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV | ||
echo $(pwd)/bin >> $GITHUB_PATH | ||
echo IN_DOCKER=1 >> .env | ||
- name: Run tests | ||
run: | | ||
ci_run zk_inception ecosystem init --deploy-paymaster --deploy-erc20 \ | ||
--deploy-ecosystem --l1-rpc-url=http://localhost:8545 \ | ||
--server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ | ||
--server-db-name=zksync_server_localhost_era \ | ||
--prover-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ | ||
--prover-db-name=zksync_prover_localhost_era | ||
ci_run zk_inception server & | ||
ci_run zk_supervisor integration-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
eco |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
zk_toolbox/crates/zk_supervisor/src/commands/integration_tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use common::{cmd::Cmd, logger}; | ||
use config::EcosystemConfig; | ||
use xshell::{cmd, Shell}; | ||
|
||
use crate::messages::{MSG_INTEGRATION_TESTS_RUN_INFO, MSG_INTEGRATION_TESTS_RUN_SUCCESS}; | ||
|
||
const TS_INTEGRATION_PATH: &str = "core/tests/ts-integration"; | ||
|
||
pub fn run(shell: &Shell) -> anyhow::Result<()> { | ||
let ecosystem_config = EcosystemConfig::from_file(shell)?; | ||
let _dir_guard = shell.push_dir(ecosystem_config.link_to_code.join(TS_INTEGRATION_PATH)); | ||
|
||
logger::info(MSG_INTEGRATION_TESTS_RUN_INFO); | ||
|
||
Cmd::new( | ||
cmd!(shell, "yarn jest --forceExit --testTimeout 60000") | ||
.env("CHAIN_NAME", ecosystem_config.default_chain), | ||
) | ||
.with_force_run() | ||
.run()?; | ||
|
||
logger::outro(MSG_INTEGRATION_TESTS_RUN_SUCCESS); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pub mod database; | ||
pub mod integration_tests; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters