Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): create sequencer integration test workflow #2508

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/sequencer_integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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-and-run-run-sequencer-integration-tests:
runs-on: starkware-ubuntu-latest-large
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap
- 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
Loading