Skip to content

test: aggregate e2e circuit tests#1286

Merged
ctrlc03 merged 2 commits into
mainfrom
test/e2e-circuits
Feb 10, 2026
Merged

test: aggregate e2e circuit tests#1286
ctrlc03 merged 2 commits into
mainfrom
test/e2e-circuits

Conversation

@cedoor

@cedoor cedoor commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Refactor

    • Restructured internal circuit input handling for improved code organization and type safety.
    • Streamlined witness generation workflow.
  • Tests

    • Refactored end-to-end test suite with reusable helper functions and parameterized test generation.
    • Enhanced test maintainability and reduced code duplication across circuit tests.
  • Chores

    • Added development dependency for testing infrastructure improvements.

@cedoor cedoor requested a review from ctrlc03 February 10, 2026 16:19
@vercel

vercel Bot commented Feb 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
crisp Ready Ready Preview, Comment Feb 10, 2026 4:20pm
enclave-docs Ready Ready Preview, Comment Feb 10, 2026 4:20pm

Request Review

@coderabbitai

coderabbitai Bot commented Feb 10, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR refactors the PK circuit proof generation pipeline to use a structured PkCircuitInput type instead of directly passing PublicKey. The Provable trait implementation is updated accordingly, and the test suite is reorganized using helper functions and macro-based test generators to reduce duplication.

Changes

Cohort / File(s) Summary
Circuit Input Type Adoption
crates/multithread/src/multithread.rs
Imports PkCircuitInput and refactors proof generation to instantiate and pass circuit_input to PkCircuit::prove instead of passing pk_bfv directly.
Provable Trait Implementation
crates/zk-prover/src/circuits/dkg/pk.rs
Updates Provable::Input associated type from PublicKey to PkCircuitInput and removes intermediate wrapping logic; input is passed directly to Witness::compute.
Test Infrastructure Refactoring
crates/zk-prover/tests/local_e2e_tests.rs
Large-scale reorganization introducing reusable setup helpers (setup_circuit_fixtures, setup_pk_generation_test, setup_pk_bfv_test) and a macro-based test generator (e2e_proof_tests!) to consolidate parameterized e2e tests and eliminate duplication across test cases.
Build Dependencies
crates/zk-prover/Cargo.toml
Adds paste = "1" as a dev-dependency to support macro test generation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • ctrlc03
  • 0xjei

Poem

🐰 Whiskers twitch with circuits bright,
Inputs wrapped in types just right!
Macros hop where tests once sprawled,
Refactored, cleaner, unified called! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'test: aggregate e2e circuit tests' accurately reflects the main change in the changeset, which consolidates multiple e2e circuit tests using a macro-based approach and shared setup helpers to reduce duplication.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test/e2e-circuits

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@crates/zk-prover/tests/local_e2e_tests.rs`:
- Around line 104-132: Currently setup_pk_generation_test hides
sample-generation errors by converting generate_sample(...).ok()? into None,
which gets reported as "bb not found"; change the control flow so
find_bb().await? still returns early only when the binary is missing, but call
PkGenerationCircuitInput::generate_sample(preset, committee) and propagate or
assert its Result (e.g., using ? on a Result-returning function or .expect with
a clear message) so failures surface as test errors; apply the same change to
setup_pk_bfv_test (handle PkBfvCircuitInput sample generation explicitly instead
of .ok()?) and keep existing find_bb, setup_test_prover and
setup_circuit_fixtures usage unchanged.

Comment thread crates/zk-prover/tests/local_e2e_tests.rs
@ctrlc03 ctrlc03 merged commit 26e9777 into main Feb 10, 2026
26 of 27 checks passed
@ctrlc03 ctrlc03 deleted the test/e2e-circuits branch February 10, 2026 16:41
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