Skip to content

Commit 110e113

Browse files
committed
Cleanup and Undo some changes
1 parent 5ca29e6 commit 110e113

File tree

12 files changed

+110
-170
lines changed

12 files changed

+110
-170
lines changed

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@ magicblock-config = { path = "./magicblock-config" }
124124
magicblock-config-helpers = { path = "./magicblock-config-helpers" }
125125
magicblock-config-macro = { path = "./magicblock-config-macro" }
126126
magicblock-core = { path = "./magicblock-core" }
127-
# magicblock-delegation-program = { git = "https://github.com/magicblock-labs/delegation-program.git", rev = "5fb8d20", features = [
128-
# "no-entrypoint",
129-
# ] }
130127
magicblock-delegation-program = { path="../delegation-program", features = ["no-entrypoint"] }
131128
magicblock-geyser-plugin = { path = "./magicblock-geyser-plugin" }
132129
magicblock-ledger = { path = "./magicblock-ledger" }

magicblock-api/src/magic_validator.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -707,11 +707,6 @@ impl MagicValidator {
707707
try_get_remote_accounts_and_rpc_config(&self.config.accounts)?;
708708
let validator_pubkey = self.bank().get_identity();
709709

710-
println!(
711-
"ensure_validator_funded_on_chain: {}",
712-
remote_rpc_config.url().to_string()
713-
);
714-
715710
let lamports = RpcClient::new_with_commitment(
716711
remote_rpc_config.url().to_string(),
717712
CommitmentConfig {
@@ -728,13 +723,6 @@ impl MagicValidator {
728723
err.to_string(),
729724
)
730725
})?;
731-
732-
println!(
733-
"validator_pubkey: {}, balance: {}",
734-
validator_pubkey,
735-
(lamports as f64) / (LAMPORTS_PER_SOL as f64)
736-
);
737-
738726
if lamports < MIN_BALANCE_SOL * LAMPORTS_PER_SOL {
739727
Err(ApiError::ValidatorInsufficientlyFunded(
740728
validator_pubkey,

test-integration/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ bincode = "1.3.3"
3434
chrono = "0.4"
3535
cleanass = "0.0.1"
3636
ctrlc = "3.4.7"
37-
#ephemeral-rollups-sdk = { git = "https://github.com/magicblock-labs/ephemeral-rollups-sdk.git", rev = "faad3eb3b44cba9f80ca059297b91053f64def27" }
3837
ephemeral-rollups-sdk = { path = "../../ephemeral-rollups-sdk/rust/sdk"}
3938
integration-test-tools = { path = "test-tools" }
4039
isocountry = "0.3.2"
@@ -53,7 +52,6 @@ magicblock-committor-service = { path = "../magicblock-committor-service" }
5352
magicblock-config = { path = "../magicblock-config" }
5453
magicblock-core = { path = "../magicblock-core" }
5554
magicblock_magic_program_api = { package = "magicblock-magic-program-api", path = "../magicblock-magic-program-api" }
56-
# magicblock-delegation-program = { git = "https://github.com/magicblock-labs/delegation-program.git", rev = "5fb8d20", features = ["no-entrypoint"] }
5755
magicblock-delegation-program = { path="../../delegation-program", features = ["no-entrypoint"] }
5856
magicblock-program = { path = "../programs/magicblock" }
5957
magicblock-rpc-client = { path = "../magicblock-rpc-client" }

test-integration/programs/flexi-counter/src/processor.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ use ephemeral_rollups_sdk::{
1111
cpi::{
1212
delegate_account, undelegate_account, DelegateAccounts, DelegateConfig,
1313
},
14-
ephem::{
15-
commit_accounts, commit_and_undelegate_accounts,
16-
commit_diff_and_undelegate_accounts,
17-
},
14+
ephem::{commit_accounts, commit_and_undelegate_accounts},
1815
};
1916
use magicblock_magic_program_api::{
2017
args::ScheduleTaskArgs, instruction::MagicBlockInstruction,
@@ -52,20 +49,15 @@ pub fn process(
5249
accounts: &[AccountInfo],
5350
instruction_data: &[u8],
5451
) -> ProgramResult {
55-
msg!("process entered");
5652
if instruction_data.len() >= EXTERNAL_UNDELEGATE_DISCRIMINATOR.len() {
5753
let (disc, data) =
5854
instruction_data.split_at(EXTERNAL_UNDELEGATE_DISCRIMINATOR.len());
5955

60-
msg!("process entered alternative");
61-
6256
if disc == EXTERNAL_UNDELEGATE_DISCRIMINATOR {
63-
msg!("process EXTERNAL_UNDELEGATE_DISCRIMINATOR");
6457
return process_undelegate_request(accounts, data);
6558
}
6659

6760
if disc == EXTERNAL_CALL_HANDLER_DISCRIMINATOR {
68-
msg!("process EXTERNAL_CALL_HANDLER_DISCRIMINATOR");
6961
return process_call_handler(accounts, data);
7062
}
7163
}
@@ -341,15 +333,13 @@ fn process_add_and_schedule_commit(
341333

342334
// Request the PDA counter account to be committed
343335
if undelegate {
344-
msg!("invoke commit_and_undelegate_accounts");
345336
commit_and_undelegate_accounts(
346337
payer_info,
347338
vec![counter_pda_info],
348339
magic_context_info,
349340
magic_program_info,
350341
)?;
351342
} else {
352-
msg!("invoke commit_accounts");
353343
commit_accounts(
354344
payer_info,
355345
vec![counter_pda_info],

test-integration/test-ledger-restore/tests/08_commit_update.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ fn restore_ledger_committed_and_updated_account() {
4242
let (_, ledger_path) = resolve_tmp_dir(TMP_DIR_LEDGER);
4343
let payer = payer_keypair();
4444

45-
println!("PAYER: {:?}", payer.pubkey());
46-
4745
let (mut validator, _) = write(&ledger_path, &payer);
4846
validator.kill().unwrap();
4947

test-integration/test-runner/bin/run_tests.rs

Lines changed: 86 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ use test_runner::{
2222

2323
pub fn main() {
2424
let config = TestConfigViaEnvVars::default();
25-
if config.selected_tests.len() != 0 {
26-
println!("config: {:#?}", config);
27-
// return;
28-
}
29-
3025
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
3126
let Ok((security_output, scenarios_output)) =
3227
run_schedule_commit_tests(&manifest_dir, &config)
@@ -35,72 +30,72 @@ pub fn main() {
3530
return;
3631
};
3732

38-
// let Ok(issues_frequent_commits_output) =
39-
// run_issues_frequent_commmits_tests(&manifest_dir, &config)
40-
// else {
41-
// return;
42-
// };
43-
44-
// let Ok(cloning_output) = run_cloning_tests(&manifest_dir, &config) else {
45-
// return;
46-
// };
47-
48-
// let Ok(restore_ledger_output) =
49-
// run_restore_ledger_tests(&manifest_dir, &config)
50-
// else {
51-
// return;
52-
// };
53-
54-
// let Ok(magicblock_api_output) =
55-
// run_magicblock_api_tests(&manifest_dir, &config)
56-
// else {
57-
// return;
58-
// };
59-
60-
// let Ok((table_mania_output, committor_output)) =
61-
// run_table_mania_and_committor_tests(&manifest_dir, &config)
62-
// else {
63-
// return;
64-
// };
65-
66-
// let Ok(magicblock_pubsub_output) =
67-
// run_magicblock_pubsub_tests(&manifest_dir, &config)
68-
// else {
69-
// return;
70-
// };
71-
72-
// let Ok(config_output) = run_config_tests(&manifest_dir, &config) else {
73-
// return;
74-
// };
75-
76-
// let Ok(schedule_intents_output) =
77-
// run_schedule_intents_tests(&manifest_dir, &config)
78-
// else {
79-
// return;
80-
// };
81-
82-
// let Ok(task_scheduler_output) =
83-
// run_task_scheduler_tests(&manifest_dir, &config)
84-
// else {
85-
// return;
86-
// };
87-
88-
// // Assert that all tests passed
33+
let Ok(issues_frequent_commits_output) =
34+
run_issues_frequent_commmits_tests(&manifest_dir, &config)
35+
else {
36+
return;
37+
};
38+
39+
let Ok(cloning_output) = run_cloning_tests(&manifest_dir, &config) else {
40+
return;
41+
};
42+
43+
let Ok(restore_ledger_output) =
44+
run_restore_ledger_tests(&manifest_dir, &config)
45+
else {
46+
return;
47+
};
48+
49+
let Ok(magicblock_api_output) =
50+
run_magicblock_api_tests(&manifest_dir, &config)
51+
else {
52+
return;
53+
};
54+
55+
let Ok((table_mania_output, committor_output)) =
56+
run_table_mania_and_committor_tests(&manifest_dir, &config)
57+
else {
58+
return;
59+
};
60+
61+
let Ok(magicblock_pubsub_output) =
62+
run_magicblock_pubsub_tests(&manifest_dir, &config)
63+
else {
64+
return;
65+
};
66+
67+
let Ok(config_output) = run_config_tests(&manifest_dir, &config) else {
68+
return;
69+
};
70+
71+
let Ok(schedule_intents_output) =
72+
run_schedule_intents_tests(&manifest_dir, &config)
73+
else {
74+
return;
75+
};
76+
77+
let Ok(task_scheduler_output) =
78+
run_task_scheduler_tests(&manifest_dir, &config)
79+
else {
80+
return;
81+
};
82+
83+
// Assert that all tests passed
8984
assert_cargo_tests_passed(security_output, "security");
9085
assert_cargo_tests_passed(scenarios_output, "scenarios");
91-
// assert_cargo_tests_passed(cloning_output, "cloning");
92-
// assert_cargo_tests_passed(
93-
// issues_frequent_commits_output,
94-
// "issues_frequent_commits",
95-
// );
96-
// assert_cargo_tests_passed(restore_ledger_output, "restore_ledger");
97-
// assert_cargo_tests_passed(magicblock_api_output, "magicblock_api");
98-
// assert_cargo_tests_passed(table_mania_output, "table_mania");
99-
// assert_cargo_tests_passed(committor_output, "committor");
100-
// assert_cargo_tests_passed(magicblock_pubsub_output, "magicblock_pubsub");
101-
// assert_cargo_tests_passed(config_output, "config");
102-
// assert_cargo_tests_passed(schedule_intents_output, "schedule_intents");
103-
// assert_cargo_tests_passed(task_scheduler_output, "task_scheduler");
86+
assert_cargo_tests_passed(cloning_output, "cloning");
87+
assert_cargo_tests_passed(
88+
issues_frequent_commits_output,
89+
"issues_frequent_commits",
90+
);
91+
assert_cargo_tests_passed(restore_ledger_output, "restore_ledger");
92+
assert_cargo_tests_passed(magicblock_api_output, "magicblock_api");
93+
assert_cargo_tests_passed(table_mania_output, "table_mania");
94+
assert_cargo_tests_passed(committor_output, "committor");
95+
assert_cargo_tests_passed(magicblock_pubsub_output, "magicblock_pubsub");
96+
assert_cargo_tests_passed(config_output, "config");
97+
assert_cargo_tests_passed(schedule_intents_output, "schedule_intents");
98+
assert_cargo_tests_passed(task_scheduler_output, "task_scheduler");
10499
}
105100

106101
fn success_output() -> Output {
@@ -303,22 +298,22 @@ fn run_schedule_commit_tests(
303298
);
304299
let mut ephem_validator = start_ephem_validator();
305300

306-
// eprintln!("======== RUNNING SECURITY TESTS ========");
307-
// let test_security_dir =
308-
// format!("{}/../{}", manifest_dir, "schedulecommit/test-security");
309-
// eprintln!("Running security tests in {}", test_security_dir);
310-
// let test_security_output =
311-
// match run_test(test_security_dir, Default::default()) {
312-
// Ok(output) => output,
313-
// Err(err) => {
314-
// eprintln!("Failed to run security: {:?}", err);
315-
// cleanup_validators(
316-
// &mut ephem_validator,
317-
// &mut devnet_validator,
318-
// );
319-
// return Err(err.into());
320-
// }
321-
// };
301+
eprintln!("======== RUNNING SECURITY TESTS ========");
302+
let test_security_dir =
303+
format!("{}/../{}", manifest_dir, "schedulecommit/test-security");
304+
eprintln!("Running security tests in {}", test_security_dir);
305+
let test_security_output =
306+
match run_test(test_security_dir, Default::default()) {
307+
Ok(output) => output,
308+
Err(err) => {
309+
eprintln!("Failed to run security: {:?}", err);
310+
cleanup_validators(
311+
&mut ephem_validator,
312+
&mut devnet_validator,
313+
);
314+
return Err(err.into());
315+
}
316+
};
322317

323318
eprintln!("======== RUNNING SCENARIOS TESTS ========");
324319
let test_scenarios_dir =
@@ -337,8 +332,7 @@ fn run_schedule_commit_tests(
337332
};
338333

339334
cleanup_validators(&mut ephem_validator, &mut devnet_validator);
340-
//Ok((test_security_output, test_scenarios_output))
341-
Ok((test_scenarios_output.clone(), test_scenarios_output))
335+
Ok((test_security_output, test_scenarios_output))
342336
} else {
343337
let devnet_validator =
344338
config.setup_devnet(TEST_NAME).then(start_devnet_validator);
@@ -767,11 +761,11 @@ fn run_test(
767761
config: RunTestConfig,
768762
) -> io::Result<process::Output> {
769763
let mut cmd = process::Command::new("cargo");
770-
// cmd.env(
771-
// "RUST_LOG",
772-
// std::env::var("RUST_LOG").unwrap_or_else(|_| "info".to_string()),
773-
// )
774-
cmd.arg("test");
764+
cmd.env(
765+
"RUST_LOG",
766+
std::env::var("RUST_LOG").unwrap_or_else(|_| "info".to_string()),
767+
)
768+
.arg("test");
775769
if let Some(package) = config.package {
776770
cmd.arg("-p").arg(package);
777771
}
@@ -780,9 +774,6 @@ fn run_test(
780774
}
781775
cmd.arg("--").arg("--test-threads=1").arg("--nocapture");
782776
cmd.current_dir(manifest_dir.clone());
783-
784-
println!("run_test CMD: {:#?}", cmd);
785-
786777
Teepee::new(cmd).output()
787778
}
788779

test-integration/test-runner/src/env_config.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#[derive(Debug)]
21
enum ValidatorSetup {
32
Devnet,
43
Ephem,
@@ -27,10 +26,9 @@ impl From<&str> for ValidatorSetup {
2726
}
2827
}
2928

30-
#[derive(Debug)]
3129
pub struct TestConfigViaEnvVars {
3230
validators_only: Option<ValidatorSetup>,
33-
pub selected_tests: Vec<String>,
31+
selected_tests: Vec<String>,
3432
skipped_tests: Vec<String>,
3533
}
3634

0 commit comments

Comments
 (0)