Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/parmigiana-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Parmigiana Live Tests

on:
schedule:
# Run every 6 hours
- cron: '0 */6 * * *'
workflow_dispatch: # Allow manual runs

jobs:
parmigiana:
name: Parmigiana testnet integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.87"

- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Run Parmigiana live tests
env:
PARMIGIANA_CARGO_PROFILE: ci-rust
PARMIGIANA_ETH_PRIV_KEY: ${{ secrets.PARMIGIANA_ETH_PRIV_KEY }}
run: |
set -o pipefail
./scripts/run_parmigiana_live.sh 2>&1 | tee parmigiana-live-tests.log

- name: Upload Parmigiana live test log
if: always()
uses: actions/upload-artifact@v4
with:
name: parmigiana-live-tests-log
path: parmigiana-live-tests.log
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ Cargo.lock
.idea/
.claude/*.local.*
CLAUDE.local.md
.dmux/
.dmux-hooks/
docs/
72 changes: 72 additions & 0 deletions PARMIGIANA_CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Parmigiana testing context

## Scope

This branch now combines:

- the existing ignored Parmigiana smoke tests for RPC reachability
- one env-gated CI live test that submits a real RU transaction, waits for a receipt, and prints a machine-friendly artifact line containing the confirmed tx hash

## Current Parmigiana coverage

Ignored live smoke tests:

- `test_chain_ids_wss`
- `test_chain_ids_https`
- `test_wallet_and_balance_wss`
- `test_wallet_and_balance_https`
- `test_all_signers_match_users_wss`
- `test_all_signers_match_users_https`

CI live test:

- `ci_submit_transaction_and_wait_for_confirmation`

The CI test only runs when `PARMIGIANA_LIVE_TESTS=1`. It supports an optional
`PARMIGIANA_ETH_PRIV_KEY` override for a funded signer. If no override is provided, it falls
back to the first deterministic Parmigiana test signer. If the selected signer does not have
enough RU native balance, the test skips cleanly instead of failing the workflow.

## Receipt-confirmed artifact output

When the CI live transaction is mined successfully, the test prints:

```text
PARMIGIANA_TX_ARTIFACT test=... chain=rollup tx_hash=0x... block_number=... block_hash=0x... transaction_index=...
```

These lines are emitted only after receipt confirmation, so they are safe to capture as test artifacts.

## Submission path

`ci_submit_transaction_and_wait_for_confirmation` uses:

- `simple_send(...)` and `sign_tx_with_key_pair(...)` from `signet-test-utils`
- `ParmigianaContext::ru_transaction_count(...)` and `ParmigianaContext::ru_native_balance_of(...)`
for live node reads
- `ParmigianaContext::forward_rollup_transaction(...)`, which uses `TxCache::parmigiana()`
- `ParmigianaContext::wait_for_transaction_in_cache(...)` to confirm tx-cache acceptance
- `ParmigianaContext::wait_for_successful_ru_receipt(...)` to confirm the transaction was mined
successfully

On timeout, the test includes `latest_block` and `seen_in_pool` diagnostics.

## Helper script and CI

`scripts/run_parmigiana_live.sh` now defaults to:

```bash
PARMIGIANA_LIVE_TESTS=1 cargo test -p signet-test-utils --test parmigiana ci_ -- --nocapture --test-threads=1
```

It supports:

- `PARMIGIANA_ETH_PRIV_KEY` for a funded signer
- `PARMIGIANA_TEST_FILTER` to narrow the live test selection
- `PARMIGIANA_INCLUDE_IGNORED=1` to run the ignored smoke tests through the same wrapper
- `PARMIGIANA_CARGO_PROFILE` to select a cargo profile such as `ci-rust`
- `PARMIGIANA_RU_RECEIPT_TIMEOUT_SECS`, `PARMIGIANA_ORDER_CACHE_TIMEOUT_SECS`, and `PARMIGIANA_MIN_RU_NATIVE_BALANCE` to tune live-test behavior

The GitHub Actions workflow passes `PARMIGIANA_ETH_PRIV_KEY` from repository secrets when present,
tees the full test log to `parmigiana-live-tests.log`, and uploads that log as a workflow artifact.
Any `PARMIGIANA_TX_ARTIFACT ...` lines are captured inside that uploaded log artifact.
69 changes: 69 additions & 0 deletions TEST_PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Parmigiana test plan

The current Parmigiana coverage has two layers:

- Ignored live smoke tests in `crates/test-utils/tests/parmigiana.rs` for RPC reachability.
- A non-ignored `ci_submit_transaction_and_wait_for_confirmation` live test that:
submits a signed RU transaction through tx-cache, waits for a mined receipt, and prints a
`PARMIGIANA_TX_ARTIFACT ... tx_hash=...` line on success.

The CI-style live test is gated by `PARMIGIANA_LIVE_TESTS=1`. It uses
`PARMIGIANA_ETH_PRIV_KEY` when provided, otherwise it falls back to the first deterministic
Parmigiana test signer. The test skips instead of failing when the chosen signer does not have
enough RU native balance to pay for the transaction. Live node and tx-cache interactions now go
through `signet-test-utils::parmigiana_context` helper methods rather than ad hoc request code in
the test itself.

1. Fast local compile checks

```bash
cargo test -p signet-orders --no-run
cargo test -p signet-test-utils --test bundle --no-run
cargo test -p signet-test-utils --test parmigiana --no-run
```

2. Run deterministic local tests

```bash
cargo test -p signet-orders -- --nocapture
cargo test -p signet-test-utils --test bundle -- --nocapture
```

3. Run Parmigiana live tests directly

```bash
cargo test -p signet-test-utils --test parmigiana test_chain_ids_https -- --ignored --nocapture
PARMIGIANA_LIVE_TESTS=1 cargo test -p signet-test-utils --test parmigiana ci_submit_transaction_and_wait_for_confirmation -- --nocapture
```

4. Run the default CI-style Parmigiana live test

```bash
./scripts/run_parmigiana_live.sh
```

That script defaults to:

```bash
PARMIGIANA_LIVE_TESTS=1 \
PARMIGIANA_TEST_FILTER=ci_ \
PARMIGIANA_INCLUDE_IGNORED=0 \
cargo test -p signet-test-utils --test parmigiana ci_ -- --nocapture --test-threads=1
```

5. Run with a funded signer to get receipt-confirmed tx hash artifacts

```bash
PARMIGIANA_LIVE_TESTS=1 \
PARMIGIANA_ETH_PRIV_KEY=0x<funded-32-byte-private-key> \
PARMIGIANA_CARGO_PROFILE=ci-rust \
./scripts/run_parmigiana_live.sh
```

6. Run the ignored smoke suite through the helper script

```bash
PARMIGIANA_TEST_FILTER=test_ \
PARMIGIANA_INCLUDE_IGNORED=1 \
./scripts/run_parmigiana_live.sh
```
1 change: 1 addition & 0 deletions crates/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ signet-evm.workspace = true
signet-extract.workspace = true
signet-orders.workspace = true
signet-sim.workspace = true
signet-tx-cache.workspace = true
signet-types.workspace = true
signet-zenith.workspace = true

Expand Down
Loading