Skip to content
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: 26 additions & 3 deletions test-integration/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test-integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ edition = "2021"
anyhow = "1.0.86"
borsh = { version = "1.2.1", features = ["derive", "unstable__schema"] }
cleanass = "0.0.1"
ctrlc = "3.4.7"
ephemeral-rollups-sdk = { git = "https://github.com/magicblock-labs/ephemeral-rollups-sdk.git", rev = "c1fcb91" }
integration-test-tools = { path = "test-tools" }
isocountry = "0.3.2"
Expand Down
54 changes: 53 additions & 1 deletion test-integration/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,38 +39,90 @@ test-force-mb: $(PROGRAMS_SO) test-ledger-restore
test-schedulecommit:
RUN_TESTS=schedulecommit \
$(MAKE) test
setup-schedulecommit-devnet:
RUN_TESTS=schedulecommit \
SETUP_ONLY=devnet \
$(MAKE) test
setup-schedulecommit-both:
RUN_TESTS=schedulecommit \
SETUP_ONLY=both \
$(MAKE) test

test-issues-frequent-commits:
RUN_TESTS=issues_frequent_commmits \
RUN_TESTS=issues_frequent_commits \
$(MAKE) test
setup-issues-frequent-commits-devnet:
RUN_TESTS=issues_frequent_commits \
SETUP_ONLY=devnet \
$(MAKE) test
setup-issues-frequent-commits-both:
RUN_TESTS=issues_frequent_commits \
SETUP_ONLY=both \
$(MAKE) test

test-cloning:
RUN_TESTS=cloning \
$(MAKE) test
setup-cloning-devnet:
RUN_TESTS=cloning \
SETUP_ONLY=devnet \
$(MAKE) test
setup-cloning-both:
RUN_TESTS=cloning \
SETUP_ONLY=both \
$(MAKE) test

test-restore-ledger:
RUN_TESTS=restore_ledger \
$(MAKE) test
setup-restore-ledger-devnet:
RUN_TESTS=restore_ledger \
SETUP_ONLY=devnet \
$(MAKE) test

test-magicblock-api:
RUN_TESTS=magicblock_api \
$(MAKE) test
setup-magicblock-api-devnet:
RUN_TESTS=magicblock_api \
SETUP_ONLY=devnet \
$(MAKE) test
setup-magicblock-api-both:
RUN_TESTS=magicblock_api \
SETUP_ONLY=both \
$(MAKE) test

test-table-mania:
RUN_TESTS=table_mania \
$(MAKE) test
setup-table-mania-devnet:
RUN_TESTS=table_mania \
SETUP_ONLY=devnet \
$(MAKE) test

test-committor:
RUN_TESTS=committor \
$(MAKE) test
setup-committor-devnet:
RUN_TESTS=committor \
SETUP_ONLY=devnet \
$(MAKE) test

test-pubsub:
RUN_TESTS=pubsub \
$(MAKE) test
setup-pubsub-ephem:
RUN_TESTS=pubsub \
SETUP_ONLY=ephem \
$(MAKE) test

test-config:
RUN_TESTS=config \
$(MAKE) test
setup-config-devnet:
RUN_TESTS=config \
SETUP_ONLY=devnet \
$(MAKE) test

$(FLEXI_COUNTER_SO): $(FLEXI_COUNTER_SRC)
cargo build-sbf --manifest-path $(FLEXI_COUNTER_DIR)/Cargo.toml
Expand Down
6 changes: 3 additions & 3 deletions test-integration/configs/cloning-conf.devnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ commit = { frequency_millis = 9_000_000_000_000, compute_unit_price = 1_000_000

[accounts.db]
# size of the main storage, we have to preallocate in advance
# it's advised to set this value based on formula 1KB * N * 3,
# where N is the number of accounts expected to be stored in
# it's advised to set this value based on formula 1KB * N * 3,
# where N is the number of accounts expected to be stored in
# database, e.g. for million accounts this would be 3GB
db-size = 1048576000 # 1GB
# minimal indivisible unit of addressing in main storage
# offsets are calculated in terms of blocks
block-size = "block256" # possible values block128 | block256 | block512
# size of index file, we have to preallocate,
# size of index file, we have to preallocate,
# can be as low as 1% of main storage size, but setting it to higher values won't hurt
index-map-size = 20485760
# max number of snapshots to keep around
Expand Down
3 changes: 1 addition & 2 deletions test-integration/test-ledger-restore/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,14 @@ pub fn setup_validator_with_local_remote(
skip_keypair_match_check,
path: Some(ledger_path.display().to_string()),
size: DEFAULT_LEDGER_SIZE_BYTES,
..Default::default()
},
accounts: accounts_config.clone(),
programs,
..Default::default()
};

let (default_tmpdir_config, Some(mut validator)) =
start_magicblock_validator_with_config_struct(config, &loaded_accounts)
start_magicblock_validator_with_config_struct(config, loaded_accounts)
else {
panic!("validator should set up correctly");
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cleanass::assert_eq;
use cleanass::{assert, assert_eq};
use solana_rpc_client::rpc_client::RpcClient;
use std::{path::Path, process::Child};

Expand Down Expand Up @@ -88,7 +88,7 @@ fn write(ledger_path: &Path) -> (Child, u64) {
owner, executable, ..
} = account;
assert_eq!(owner, bpf_loader_upgradeable::ID, cleanup(&mut validator));
assert_eq!(executable, true, cleanup(&mut validator));
assert!(executable, cleanup(&mut validator));

let slot = wait_for_ledger_persist(&mut validator);

Expand Down Expand Up @@ -125,7 +125,7 @@ fn read(ledger_path: &Path) -> Child {
owner, executable, ..
} = account;
assert_eq!(owner, bpf_loader_upgradeable::ID, cleanup(&mut validator));
assert_eq!(executable, true, cleanup(&mut validator));
assert!(executable, cleanup(&mut validator));

validator
}
1 change: 1 addition & 0 deletions test-integration/test-runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ name = "run-tests"
path = "bin/run_tests.rs"

[dependencies]
ctrlc = { workspace = true }
integration-test-tools = { workspace = true }
teepee = { workspace = true }
Loading