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 003c211 commit 5e67c52
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/sequencer_integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Sequencer-Integration-Tests-CI-Flow

on:
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:
build-sequencer-node:
runs-on: starkware-ubuntu-latest-large
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap
- run: cargo build --bin starknet_sequencer_node

run-sequencer-integration-tests:
needs: build-sequencer-node
runs-on: starkware-ubuntu-latest-large
steps:
- uses: actions/checkout@v4
- name: "Run test end-to-end integration test"
run: |
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 5e67c52

Please sign in to comment.