Skip to content

feat(e2e): gas snapshot infra and consolidated test helpers#68

Merged
refcell merged 4 commits intomainfrom
brock/testing-infra
Mar 9, 2026
Merged

feat(e2e): gas snapshot infra and consolidated test helpers#68
refcell merged 4 commits intomainfrom
brock/testing-infra

Conversation

@brockelmore
Copy link
Copy Markdown
Collaborator

Summary

  • Gas snapshot infrastructure: Records per-function execution gas across all optimization levels (O0–O3) during e2e tests. An atexit hook flushes results to /tmp/edge-gas/e2e.csv, and just e2e / just e2e-ci now sort that into crates/e2e/.gas-snapshot (140 entries).
  • Consolidated test helpers: Added call_fn, call_with_value, compile_contract, compile_named, decode_bool, decode_address, encode_address, event_sig, and a structured CallResult type (with logs) to helpers.rs. Replaced raw tuple returns (bool, Vec<u8>) with CallResult across all 20+ test files, eliminating ~1000 lines of boilerplate.
  • Justfile updates: e2e and e2e-ci recipes now automatically collect and write the gas snapshot after test runs.

Test plan

  • All e2e tests pass (cargo test -p edge-e2e)
  • Gas snapshot file generated with 140 entries
  • Verify snapshot is deterministic across runs

🤖 Generated with Claude Code

brockelmore and others added 2 commits March 9, 2026 11:54
Centralize shared test helpers (EvmHandle, CallResult, LogEntry,
selectors, ABI encoding/decoding, for_all_opt_levels) into helpers.rs
with automatic gas recording via atexit handler. Refactor all e2e test
files to use shared helpers, eliminating duplicated code. Add gas
snapshot collection to `just e2e` / `just e2e-ci` recipes.

Gas recording only tracks successful calls (skips reverts) and keeps
the max gas per (function, opt_level) for worst-case analysis.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 9, 2026

Deploy Preview for edgelang ready!

Name Link
🔨 Latest commit 93b5693
🔍 Latest deploy log https://app.netlify.com/projects/edgelang/deploys/69af1f1b5a4cf900081e1868
😎 Deploy Preview https://deploy-preview-68--edgelang.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

brockelmore and others added 2 commits March 9, 2026 12:22
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@refcell refcell merged commit 89f62a6 into main Mar 9, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants