agentsclimarketplace

Mopro test

Skill zkmopro/mopro-ai/skills/mopro-test

Write and run tests for mopro projects at three levels: Rust unit tests, FFI binding tests, and mobile UI tests. Use this skill whenever someone wants to test proof generation, verify bindings work, add test coverage, or diagnose test failures. Also use when someone asks "does it work" or "how do I verify" in a mopro project context.From its SKILL.md

Install
npx -y skills add zkmopro/mopro-ai --skill mopro-test

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT OR Apache-2.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.1 KB, as published. Nobody here has run it

Mopro Testing

This skill helps users write and run tests for mopro projects at three levels: Rust unit tests, FFI binding tests, and mobile UI tests.

When to Use

  • User wants to add tests to their mopro project
  • User needs to verify proof generation/verification works
  • User asks about testing FFI bindings
  • User wants platform-specific UI tests
  • User encounters test failures

Related Skills

  • mopro-project: Ensure project is initialized before testing
  • mopro-device: For running FFI/UI tests on simulators/emulators

Three Test Levels

Level 1: Rust Unit Tests

Test the Rust prover logic directly using cargo test. This is the fastest feedback loop and doesn't require any mobile toolchain.

cd <project_dir>
cargo test

What to test:

  • Circuit input validation
  • Proof generation with known inputs
  • Proof verification
  • Error handling (invalid inputs, missing files)

Level 2: FFI Binding Tests

Test the generated UniFFI bindings to ensure the Rust→native bridge works. These tests run through the same FFI layer that mobile apps use.

For iOS bindings:

# Requires Xcode and iOS simulator
swift test  # If using Swift package

For Android bindings:

# Requires Android toolchain
./gradlew test

For WASM bindings:

wasm-pack test --chrome --headless

Level 3: Mobile UI Tests

Platform-specific tests that verify the full stack: UI → FFI → Rust → proof.

  • iOS: XCTest / XCUITest
  • Android: JUnit + Espresso / Compose Testing
  • Flutter: widget tests + integration tests
  • React Native: Jest + Detox

Workflow

Step 1: Determine Test Level

Ask the user what they want to test:

  • "Does proof generation work?" → Level 1 (Rust)
  • "Do the bindings work?" → Level 2 (FFI)
  • "Does the app work end-to-end?" → Level 3 (UI)

Step 2: Generate Test Code

Based on the level, generate appropriate test files. See:

  • references/rust-ffi-tests.md for Level 1 and 2
  • references/mobile-ui-tests.md for Level 3

Step 3: Run Tests

Rust tests (no confirmation needed):

cargo test
cargo test --all-features

FFI tests (confirm before running — requires toolchain):

About to run FFI binding tests. This requires:
- iOS: Xcode simulator
- Android: Android emulator or device
- Web: Chrome + ChromeDriver

Proceed?

UI tests (confirm before running — requires device/simulator):

About to run UI tests on <platform>. This requires:
- A running simulator/emulator or connected device

Proceed?

Step 4: Diagnose Failures

For test failures:

  1. Check if circuit artifacts exist in the correct location
  2. Verify input format matches expected JSON schema
  3. Check that the build was successful and bindings are current
  4. For FFI tests, verify the correct architecture was built

Quick Test Commands

# Rust-level proof test
cargo test

# Rust with all features
cargo test --all-features

# Code formatting check
cargo fmt --all -- --check

# Lint check
cargo clippy --all-targets --all-features

# WASM tests
wasm-pack test --chrome --headless -- --no-default-features --features wasm

Troubleshooting

"Cannot find test-vectors"

Tests expect circuit artifacts at relative paths. Run cargo test from the project root directory (where Cargo.toml lives).

"proof verification failed"

Check that:

  1. The .zkey file is not corrupted
  2. Input values match the circuit's expected inputs
  3. The correct ProofLib variant is used

Tests pass locally but fail in CI

  • CI may not have the Rust targets installed
  • CI timeout may be too short for proof generation
  • Ensure circuit artifacts are committed or downloaded in CI

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.