Skip to content

Commit

Permalink
Merge branch 'master' into feat/e2e-tests-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fbozic committed Nov 25, 2024
2 parents 46ff2e6 + 8b26910 commit b8e873d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 182 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ jobs:
- name: Run e2e tests
run: |
export NO_COLOR=1
echo "Running e2e tests, check job summary for details"
echo "# E2E tests 🏗️" >> $GITHUB_STEP_SUMMARY
./target/debug/e2e-tests \
--input-dir ./e2e-tests/config \
--output-dir ./e2e-tests/corpus \
--merod-binary ./target/debug/merod \
--meroctl-binary ./target/debug/meroctl >> $GITHUB_STEP_SUMMARY
--meroctl-binary ./target/debug/meroctl \
--output-format markdown >> $GITHUB_STEP_SUMMARY
- name: Run e2e tests
if: success() || failure()
Expand Down
8 changes: 0 additions & 8 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ members = [
"./apps/only-peers",
"./apps/gen-ext",
"./apps/visited",
"./apps/blockchain",

"./contracts/context-config",
"./contracts/registry",
Expand Down
21 changes: 0 additions & 21 deletions apps/blockchain/Cargo.toml

This file was deleted.

18 changes: 0 additions & 18 deletions apps/blockchain/build.sh

This file was deleted.

132 changes: 0 additions & 132 deletions apps/blockchain/src/lib.rs

This file was deleted.

16 changes: 15 additions & 1 deletion contracts/context-config/tests/sandbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,6 @@ async fn test_storage_usage_matches_code_size() -> eyre::Result<()> {

let node1_balance = worker.view_account(&node1.id()).await?.balance;

// Deploy proxy contract
let res = node1
.call(contract.id(), "mutate")
.args_json(Signed::new(
Expand Down Expand Up @@ -1155,11 +1154,15 @@ async fn test_storage_usage_matches_code_size() -> eyre::Result<()> {
let expected_log = format!("Context `{}` added", context_id);
assert!(res.logs().iter().any(|log| log == &expected_log));

worker.fast_forward(1).await?;

let node1_balance_after = worker.view_account(&node1.id()).await?.balance;

let diff = node1_balance.saturating_sub(node1_balance_after);
let node1_balance = node1_balance_after;

println!("Node1 balance diff: {}", diff);

assert!(
diff < NearToken::from_millinear(10),
"Node1 balance should not be reduced by more than 10 milliNEAR, but was reduced by {}",
Expand All @@ -1185,6 +1188,7 @@ async fn test_storage_usage_matches_code_size() -> eyre::Result<()> {
println!("Initial storage usage: {}", initial_storage);
println!("Initial WASM size: {}", initial_code_size);
println!("Initial Balance: {}", initial_balance);
println!("Initial Node1 Balance: {}", node1_balance);

let res = contract
.call("set_proxy_code")
Expand Down Expand Up @@ -1216,11 +1220,15 @@ async fn test_storage_usage_matches_code_size() -> eyre::Result<()> {

assert!(res.failures().is_empty(), "{:#?}", res.failures());

worker.fast_forward(1).await?;

let node1_balance_after = worker.view_account(&node1.id()).await?.balance;

let diff = node1_balance.saturating_sub(node1_balance_after);
let node1_balance = node1_balance_after;

println!("Node1 balance diff: {}", diff);

assert!(
diff < NearToken::from_millinear(10),
"Node1 balance should not be reduced by more than 10 milliNEAR, but was reduced by {}",
Expand All @@ -1236,6 +1244,7 @@ async fn test_storage_usage_matches_code_size() -> eyre::Result<()> {
println!("Intermediate storage usage: {}", intermediate_storage);
println!("Intermediate WASM size: {}", intermediate_code_size);
println!("Intermediate Balance: {}", intermediate_balance);
println!("Intermediate Node1 Balance: {}", node1_balance);

// Calculate raw differences (can be negative)
let storage_change = intermediate_storage as i64 - initial_storage as i64;
Expand Down Expand Up @@ -1291,10 +1300,14 @@ async fn test_storage_usage_matches_code_size() -> eyre::Result<()> {

assert!(res.failures().is_empty(), "{:#?}", res.failures());

worker.fast_forward(1).await?;

let node1_balance_after = worker.view_account(&node1.id()).await?.balance;

let diff = node1_balance.saturating_sub(node1_balance_after);

println!("Node1 balance diff: {}", diff);

assert!(
diff < NearToken::from_millinear(10),
"Node1 balance should not be reduced by more than 10 milliNEAR, but was reduced by {}",
Expand All @@ -1310,6 +1323,7 @@ async fn test_storage_usage_matches_code_size() -> eyre::Result<()> {
println!("Final storage usage: {}", final_storage);
println!("Final WASM size: {}", final_code_size);
println!("Final Balance: {}", final_balance);
println!("Final Node1 Balance: {}", node1_balance);

// Calculate raw differences (can be negative)
let storage_change = final_storage as i64 - intermediate_storage as i64;
Expand Down

0 comments on commit b8e873d

Please sign in to comment.