Skip to content

feat: add test_helpers module (error_utils, test_utils) behind function_runner flag#2378

Open
naor-starkware wants to merge 7 commits intonaor/refactor/rename-feature-flagfrom
naor/feat/add_test_helpers
Open

feat: add test_helpers module (error_utils, test_utils) behind function_runner flag#2378
naor-starkware wants to merge 7 commits intonaor/refactor/rename-feature-flagfrom
naor/feat/add_test_helpers

Conversation

@naor-starkware
Copy link
Copy Markdown
Collaborator

@naor-starkware naor-starkware commented Mar 29, 2026

TITLE

Description

Description of the pull request changes and motivation.

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.
    • CHANGELOG has been updated.

This change is Reviewable

Copy link
Copy Markdown
Collaborator Author

naor-starkware commented Mar 29, 2026

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 29, 2026

Codecov Report

❌ Patch coverage is 94.80519% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.06%. Comparing base (5831ff3) to head (e97f3a8).

Files with missing lines Patch % Lines
vm/src/test_helpers/test_utils.rs 84.00% 8 Missing ⚠️
vm/src/test_helpers/error_utils.rs 97.79% 4 Missing ⚠️
Additional details and impacted files
@@                          Coverage Diff                          @@
##           naor/refactor/rename-feature-flag    #2378      +/-   ##
=====================================================================
- Coverage                              96.07%   96.06%   -0.01%     
=====================================================================
  Files                                    105      107       +2     
  Lines                                  37737    37968     +231     
=====================================================================
+ Hits                                   36254    36475     +221     
- Misses                                  1483     1493      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 29, 2026

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.072 ± 0.041 2.039 2.172 1.01 ± 0.03
head big_factorial 2.057 ± 0.033 2.017 2.110 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 1.999 ± 0.016 1.974 2.021 1.00
head big_fibonacci 2.004 ± 0.010 1.987 2.019 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.368 ± 0.087 7.238 7.494 1.01 ± 0.02
head blake2s_integration_benchmark 7.273 ± 0.080 7.187 7.423 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.119 ± 0.019 2.084 2.147 1.00
head compare_arrays_200000 2.135 ± 0.019 2.098 2.154 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.399 ± 0.011 1.381 1.417 1.01 ± 0.02
head dict_integration_benchmark 1.383 ± 0.018 1.370 1.432 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.202 ± 0.009 1.188 1.215 1.00
head field_arithmetic_get_square_benchmark 1.204 ± 0.010 1.188 1.218 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.395 ± 0.051 7.329 7.455 1.00 ± 0.01
head integration_builtins 7.391 ± 0.042 7.326 7.433 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 7.532 ± 0.030 7.481 7.573 1.02 ± 0.01
head keccak_integration_benchmark 7.403 ± 0.029 7.371 7.466 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.108 ± 0.021 2.069 2.133 1.00
head linear_search 2.114 ± 0.021 2.091 2.157 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.455 ± 0.006 1.447 1.469 1.00 ± 0.01
head math_cmp_and_pow_integration_benchmark 1.454 ± 0.010 1.441 1.471 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.424 ± 0.006 1.416 1.432 1.00
head math_integration_benchmark 1.427 ± 0.007 1.419 1.443 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.186 ± 0.006 1.173 1.195 1.00 ± 0.01
head memory_integration_benchmark 1.186 ± 0.005 1.175 1.192 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.501 ± 0.007 1.490 1.515 1.00
head operations_with_data_structures_benchmarks 1.508 ± 0.013 1.477 1.525 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 521.2 ± 5.4 508.2 526.9 1.00
head pedersen 523.2 ± 2.0 521.3 527.6 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 594.6 ± 6.6 583.6 603.0 1.00 ± 0.02
head poseidon_integration_benchmark 593.7 ± 7.5 578.9 602.6 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.784 ± 0.015 1.766 1.813 1.01 ± 0.01
head secp_integration_benchmark 1.769 ± 0.012 1.750 1.792 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 647.9 ± 8.4 632.4 665.3 1.01 ± 0.02
head set_integration_benchmark 643.2 ± 5.0 635.8 650.5 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.138 ± 0.041 4.105 4.241 1.01 ± 0.01
head uint256_integration_benchmark 4.112 ± 0.020 4.081 4.150 1.00

naor-starkware and others added 5 commits March 29, 2026 17:19
…on_runner flag

- Create vm/src/test_helpers/ with error_utils.rs and test_utils.rs
- Move from cairo_test_suite/ (fix filename typo: utlis → utils)
- Fix crate:: import paths (were cairo_vm:: when outside the crate)
- Fix $crate in macro_export macro (clippy::crate_in_macro_def)
- Simplify load_cairo_program! path using with_file_name()
- Gate module behind function_runner feature in lib.rs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ram! and error_utils checkers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add AlwaysFailConversion helper + 2 tests for assert_mr_eq! unwrap_or_else
  panic branch (no-message and message variants)
- Allow clippy::result_large_err on hint_err test helper

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@naor-starkware naor-starkware force-pushed the naor/feat/add_test_helpers branch from 6ec5328 to ce3aeb1 Compare March 29, 2026 14:19
naor-starkware and others added 2 commits March 29, 2026 19:09
… noise

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…y function name error

#[macro_export] macros containing closures (|x| ...) cause llvm-cov to
emit a "function name is empty" error. Replaced unwrap_or_else(|e| panic!(...))
with match expressions to eliminate closures from macro expansions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@naor-starkware naor-starkware marked this pull request as ready for review March 30, 2026 10:35
Copy link
Copy Markdown
Collaborator

@OmriEshhar1 OmriEshhar1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OmriEshhar1 reviewed 7 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on naor-starkware).

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