Skip to content

Commit

Permalink
chore(ci): create sequencer integration test workflow
Browse files Browse the repository at this point in the history
commit-id:55e84a9b
  • Loading branch information
Itay-Tsabary-Starkware committed Dec 8, 2024
1 parent 91647e8 commit 377ae68
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/sequencer_integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Sequencer-Integration-Tests-CI-Flow

on:
push:
branches:
- main
- main-v[0-9].**
tags:
- v[0-9].**

pull_request:
types:
- opened
- reopened
- synchronize
- auto_merge_enabled
- edited

env:
SEQUENCER_INTEGRATION_TESTS: 1
RUSTFLAGS: "-D warnings"

# On PR events, cancel existing CI runs on this same PR for this workflow.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
run-integration-tests:
runs-on: starkware-ubuntu-latest-large
steps:
- uses: actions/checkout@v4
with:
# Fetch the entire history.
fetch-depth: 0
- uses: ./.github/actions/bootstrap

- name: "Run test end-to-end integration test"
run: |
cargo build --bin starknet_sequencer_node
cargo test --test end_to_end_integration_test
4 changes: 4 additions & 0 deletions crates/starknet_integration_tests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,7 @@ pub fn create_batcher_config(
..Default::default()
}
}

pub fn run_integration_test() -> bool {
std::env::var("SEQUENCER_INTEGRATION_TESTS").is_ok()
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ use starknet_api::block::BlockNumber;
use starknet_api::core::{ContractAddress, Nonce};
use starknet_api::state::StateNumber;
use starknet_integration_tests::integration_test_setup::IntegrationTestSetup;
use starknet_integration_tests::utils::{create_integration_test_tx_generator, send_account_txs};
use starknet_integration_tests::utils::{
create_integration_test_tx_generator,
run_integration_test,
send_account_txs,
};
use starknet_sequencer_infra::trace_util::configure_tracing;
use starknet_sequencer_node::test_utils::compilation::spawn_run_node;
use starknet_types_core::felt::Felt;
Expand Down Expand Up @@ -59,6 +63,10 @@ async fn await_block(
#[rstest]
#[tokio::test]
async fn test_end_to_end_integration(mut tx_generator: MultiAccountTransactionGenerator) {
if !run_integration_test() {
return;
}

const EXPECTED_BLOCK_NUMBER: BlockNumber = BlockNumber(15);

configure_tracing();
Expand Down

0 comments on commit 377ae68

Please sign in to comment.