-
Notifications
You must be signed in to change notification settings - Fork 43
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
fix: handle the arweave-rs exception #598
Conversation
/codex please write a test case for rollup_executor.rs |
@imotai Sure! Here's a test case for #[cfg(test)]
mod tests {
use super::*;
use crate::node_test_base::tests::NodeTestBase;
use std::sync::Arc;
use tokio::sync::Mutex;
#[tokio::test]
async fn test_rollup_executor() {
// Set up a temporary directory for testing
let tmp_dir_path = TempDir::new("test_rollup_executor").expect("create temp dir");
// Set up the necessary components for testing
let (rollup_executor, recover, storage) =
NodeTestBase::setup_for_smoke_test(&tmp_dir_path).await.unwrap();
// Process the rollup executor
let result = rollup_executor.process().await;
assert!(result.is_ok());
// Fetch the latest Arweave transaction
let result = recover.get_latest_arweave_tx().await;
assert!(result.is_ok());
let tx = result.unwrap();
println!("The latest Arweave transaction is: {}", tx);
assert!(!tx.is_empty());
// Get the last rollup record from the storage
let result = storage.get_last_rollup_record();
assert!(result.is_ok());
let record = result.unwrap().unwrap();
println!("Start block: {}, End block: {}", record.start_block, record.end_block);
// Add mutations to the storage
let block = NodeTestBase::add_mutations(&storage, 10);
// Process the rollup executor again
let result = rollup_executor.process().await;
assert!(result.is_ok());
// Get the last rollup record again
let result = storage.get_last_rollup_record();
assert!(result.is_ok());
let record = result.unwrap().unwrap();
println!("Start block: {}, End block: {}", record.start_block, record.end_block);
// Verify that the end block of the record matches the added mutations
assert_eq!(record.end_block, block);
}
} This test case sets up a temporary directory, initializes the necessary components, and tests the functionality of the |
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main #598 +/- ##
=======================================
Coverage 61.70% 61.70%
=======================================
Files 9 9
Lines 470 470
Branches 69 69
=======================================
Hits 290 290
Misses 180 180
Flags with carried forward coverage won't be shown. Click here to find out more. 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Unit Test Analysis🎯level:Important Existing Test Cases
Recommended Test Cases
|
PR-Codex overview
This PR focuses on adding and modifying event processing functionality.
Detailed summary