Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1451589
feat(ci): add E2E test suite CI job with JS and Rust code coverage
mudigal Jun 3, 2026
4c5e128
feat(e2e): add E2E test suite workflows and updated api.js
mudigal Jun 3, 2026
c307999
Merge branch 'dev' into feat/e2e-coverage
bkontur Jun 3, 2026
fcdd4d9
fix(e2e): fix 6 bugs across E2E workflows and extract CI composite ac…
mudigal Jun 3, 2026
f7f81a6
merge: resolve conflicts in integration-tests.yml
mudigal Jun 3, 2026
b1073b1
chore(e2e): remove unused imports and variables (CodeQL)
mudigal Jun 3, 2026
829a570
perf(e2e): switch tx submission from finalization to best-block for ~…
mudigal Jun 3, 2026
b0a1f3c
fix(e2e): use finalized-block for submitTx so state queries see changes
mudigal Jun 3, 2026
15be944
feat(ci): run E2E tests with 2s dev blocks instead of zombienet
mudigal Jun 3, 2026
12f02be
fix(ci): add --unsafe-force-node-key-generation for ephemeral E2E chain
mudigal Jun 3, 2026
b313b20
fix(e2e): fix test failures in workflows 07, 08, and 10
mudigal Jun 3, 2026
afcb299
fix(e2e): fix workflow 02 reject balance assertion and Burn encoding
mudigal Jun 4, 2026
a346f9f
ci(e2e): consolidate to single runtime and add JS coverage step
mudigal Jun 4, 2026
2cbb1ac
fix(ci): fix Rust coverage profraw generation and add diagnostics
mudigal Jun 4, 2026
54d8fc1
fix(e2e): fix Burn test Token::BelowMinimum and remove unused vars
mudigal Jun 4, 2026
0ecdab4
fix(ci): improve Rust coverage profraw generation reliability
mudigal Jun 4, 2026
3b8cf24
perf(ci): build common artifacts once, run the two test suites in par…
bkontur Jun 4, 2026
464fae4
Merge branch 'bko-ci-build-once-shard' into feat/e2e-coverage
bkontur Jun 4, 2026
a91e231
ci(e2e): single-source runtime + chain-spec from runtimes-matrix.json
bkontur Jun 4, 2026
5ee9cb6
fix(ci): restore artifact paths and shrink build artifact
bkontur Jun 4, 2026
b216b7c
Merge remote-tracking branch 'origin/bko-ci-build-once-shard' into fe…
bkontur Jun 4, 2026
3fa90a9
ci(e2e): drop unused build-artifact dependency from e2e job
bkontur Jun 4, 2026
445f9a0
docs(ci): correct build-once artifact comments
bkontur Jun 4, 2026
d3de2d9
use in-block for tests
bkontur Jun 4, 2026
4f414c1
Merge remote-tracking branch 'origin/bko-ci-build-once-shard' into fe…
bkontur Jun 4, 2026
391f8bf
fix(papi): read demo state at best block, centralised via READ_OPTS
bkontur Jun 4, 2026
456a4b4
Merge remote-tracking branch 'origin/bko-ci-build-once-shard' into fe…
bkontur Jun 4, 2026
de28f36
fix(e2e): read state at best block (READ_OPTS) in e2e workflows
bkontur Jun 4, 2026
18e1416
fix(papi): count ChallengeDefended from tx events, not finalized watch
bkontur Jun 4, 2026
2bd19cf
fix(papi): finalize challenge-creating txs so respond can't hit Chall…
bkontur Jun 4, 2026
42d64c7
demo(papi): shorten full-flow agreement duration 50 -> 15 blocks
bkontur Jun 4, 2026
83328e3
Merge remote-tracking branch 'origin/bko-ci-build-once-shard' into fe…
bkontur Jun 4, 2026
923f158
fix(ci): fix Rust coverage (use continuous mode) and add pallet coverage
mudigal Jun 4, 2026
0c258fe
fix(ci): correct pallet package name for coverage (pallet-storage-pro…
mudigal Jun 4, 2026
c5fa7be
refactor(pallet): split tests.rs into tests/ directory and add CI cov…
mudigal Jun 4, 2026
e507d07
fix(ci): fix pallet binary path (debug not release) and use SIGTERM f…
mudigal Jun 4, 2026
7a37421
ci(ui-e2e): make the required check always report via an aggregate gate
bkontur Jun 4, 2026
189b3ac
docs: trim the explanatory comments added in this PR
bkontur Jun 4, 2026
e288a37
Merge remote-tracking branch 'origin/bko-ci-build-once-shard' into fe…
bkontur Jun 4, 2026
57814d9
fix(ci): add safe.directory for container git ops, fix pallet binary …
mudigal Jun 5, 2026
3bc91fc
Merge remote-tracking branch 'origin/feat/e2e-coverage' into feat/e2e…
mudigal Jun 5, 2026
23fa0dc
Merge remote-tracking branch 'origin/dev' into feat/e2e-coverage
mudigal Jun 5, 2026
0801b5a
refactor(ci): consolidate Rust coverage into check.yml, keep JS-only …
mudigal Jun 5, 2026
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
50 changes: 50 additions & 0 deletions .github/actions/start-e2e-chain/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Start E2E dev chain
description: >-
Start polkadot-omni-node in standalone mode with fast block production
for E2E testing. No relay chain required — blocks finalize instantly.

inputs:
chain-spec-script:
description: Script that generates the chain spec to stdout.
required: true
block-time:
description: Block production interval in milliseconds.
required: false
default: "2000"
rpc-port:
description: RPC port for the node.
required: false
default: "2222"
log-file:
description: Where to redirect omni-node stdout/stderr.
required: false
default: /tmp/omni-node.log

runs:
using: composite
steps:
- shell: bash
run: |
SPEC_FILE="/tmp/e2e-chain-spec.json"
echo "Generating chain spec from ${{ inputs.chain-spec-script }}..."
${{ inputs.chain-spec-script }} > "$SPEC_FILE"

echo "Starting polkadot-omni-node with ${{ inputs.block-time }}ms blocks..."
nohup .bin/polkadot-omni-node \
--chain "$SPEC_FILE" \
--alice --tmp \
--unsafe-force-node-key-generation \
--dev-block-time ${{ inputs.block-time }} \
--rpc-port ${{ inputs.rpc-port }} \
--rpc-cors all \
-lruntime=info \
> ${{ inputs.log-file }} 2>&1 &

NODE_PID=$!
sleep 10
if ! kill -0 $NODE_PID 2>/dev/null; then
echo "ERROR: polkadot-omni-node exited early"
cat "${{ inputs.log-file }}" || true
exit 1
fi
echo "polkadot-omni-node running with ${{ inputs.block-time }}ms blocks (PID $NODE_PID)"
35 changes: 35 additions & 0 deletions .github/actions/start-zombienet/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Start zombienet
description: >-
Spawn a zombienet network in the background and verify the process stays
alive after initial setup. Does NOT wait for block production — use the
wait-for-parachain action for that.

inputs:
config:
description: Path to the zombienet TOML config file.
required: true
log-file:
description: Where to redirect zombienet stdout/stderr.
required: false
default: /tmp/zombienet.log
startup-delay:
description: Seconds to wait before checking the process is alive.
required: false
default: "15"

runs:
using: composite
steps:
- shell: bash
run: |
nohup env PROJECT_ROOT=$(pwd) .bin/zombienet spawn -p native ${{ inputs.config }} \
> ${{ inputs.log-file }} 2>&1 &
ZOMBIE_PID=$!
echo "Waiting ${{ inputs.startup-delay }}s for zombienet to set up nodes..."
sleep ${{ inputs.startup-delay }}
if ! kill -0 $ZOMBIE_PID 2>/dev/null; then
echo "ERROR: zombienet exited early"
cat "${{ inputs.log-file }}" || true
exit 1
fi
echo "Zombienet is running (PID $ZOMBIE_PID)"
41 changes: 41 additions & 0 deletions .github/actions/wait-for-provider-health/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Wait for provider health
description: >-
Poll a storage-provider-node /health endpoint until it responds with a valid
JSON status, or time out.

inputs:
url:
description: Provider HTTP base URL to poll.
required: false
default: http://127.0.0.1:3333
attempts:
description: Number of poll attempts, 2s apart (60 ≈ 2min).
required: false
default: "60"
label:
description: Human label for log messages (e.g. "inmemory", "disk").
required: false
default: Provider
log-file:
description: Log to cat on timeout (for post-mortem); skipped if absent.
required: false
default: /tmp/provider.log

runs:
using: composite
steps:
- shell: bash
run: |
echo "Waiting for ${{ inputs.label }} provider (${{ inputs.url }})..."
for i in $(seq 1 ${{ inputs.attempts }}); do
if curl -s "${{ inputs.url }}/health" | jq -e '.status' > /dev/null 2>&1; then
echo "${{ inputs.label }} provider is healthy (attempt $i)"
break
fi
if [ "$i" -eq ${{ inputs.attempts }} ]; then
echo "Timeout: ${{ inputs.label }} provider did not become healthy"
cat "${{ inputs.log-file }}" 2>/dev/null || true
exit 1
fi
sleep 2
done
102 changes: 101 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,111 @@ jobs:
run: |
cargo test -p pallet-drive-registry --features runtime-benchmarks

coverage:
name: Rust coverage
runs-on: parity-large
timeout-minutes: 60
needs: [set-image, check]
if: github.event_name == 'pull_request'
container:
image: ${{ needs.set-image.outputs.CI_IMAGE }}
env:
SKIP_WASM_BUILD: 1
CARGO_INCREMENTAL: '0'
steps:
- name: Checkout PR sources (with base branch history)
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0

- name: Rust cache
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
shared-key: "web3-storage-cache-coverage"
save-if: false

- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov --locked

- name: Measure PR coverage
run: |
PALLET_COV=$(cargo llvm-cov --lib -p pallet-storage-provider \
--ignore-filename-regex='(weights\.rs|runtime_api\.rs|mock\.rs|primitives/)' \
--summary-only 2>&1 \
| grep '^TOTAL' | awk '{print $10}' | tr -d '%')
echo "PR_PALLET_COV=$PALLET_COV" >> $GITHUB_ENV
echo "PR pallet coverage: ${PALLET_COV}%"

cargo llvm-cov clean --workspace 2>/dev/null || true

PROVIDER_COV=$(cargo llvm-cov --lib -p storage-provider-node \
--ignore-filename-regex='(\.cargo|rustc)' \
--summary-only 2>&1 \
| grep '^TOTAL' | awk '{print $10}' | tr -d '%')
echo "PR_PROVIDER_COV=$PROVIDER_COV" >> $GITHUB_ENV
echo "PR provider coverage: ${PROVIDER_COV}%"

- name: Measure base branch coverage
run: |
# Container user differs from repo owner; allow git operations
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git stash --include-untracked 2>/dev/null || true
git checkout ${{ github.event.pull_request.base.sha }}

cargo llvm-cov clean --workspace 2>/dev/null || true

BASE_PALLET_COV=$(cargo llvm-cov --lib -p pallet-storage-provider \
--ignore-filename-regex='(weights\.rs|runtime_api\.rs|mock\.rs|primitives/)' \
--summary-only 2>&1 \
| grep '^TOTAL' | awk '{print $10}' | tr -d '%')
echo "BASE_PALLET_COV=$BASE_PALLET_COV" >> $GITHUB_ENV
echo "Base pallet coverage: ${BASE_PALLET_COV}%"

cargo llvm-cov clean --workspace 2>/dev/null || true

BASE_PROVIDER_COV=$(cargo llvm-cov --lib -p storage-provider-node \
--ignore-filename-regex='(\.cargo|rustc)' \
--summary-only 2>&1 \
| grep '^TOTAL' | awk '{print $10}' | tr -d '%')
echo "BASE_PROVIDER_COV=$BASE_PROVIDER_COV" >> $GITHUB_ENV
echo "Base provider coverage: ${BASE_PROVIDER_COV}%"

git checkout -
git stash pop 2>/dev/null || true

- name: Compare coverage
run: |
echo ""
echo "═══════════════════════════════════════════════════════════"
echo " Rust Coverage (PR vs base)"
echo "═══════════════════════════════════════════════════════════"
echo ""

FAILED=0
for COMPONENT in PALLET PROVIDER; do
eval "PR_VAL=\$PR_${COMPONENT}_COV"
eval "BASE_VAL=\$BASE_${COMPONENT}_COV"
LABEL=$(echo "$COMPONENT" | tr '[:upper:]' '[:lower:]')
DECREASED=$(awk "BEGIN { print ($PR_VAL < $BASE_VAL) ? 1 : 0 }")
if [ "$DECREASED" = "1" ]; then
echo "FAIL: $LABEL coverage decreased: ${BASE_VAL}% → ${PR_VAL}%"
FAILED=1
else
echo "PASS: $LABEL coverage: ${BASE_VAL}% → ${PR_VAL}%"
fi
done

echo ""
if [ "$FAILED" = "1" ]; then
echo "Coverage decreased — add tests to cover new or modified code."
exit 1
fi

# Aggregate gate — the stable check to require in branch protection, instead
# of pinning each job (fmt/check/clippy/test/benchmarks) individually.
basic-checks:
name: Basic checks
needs: [check-fmt, check, clippy, test, benchmarks]
needs: [check-fmt, check, clippy, test, benchmarks, coverage]
if: always()
runs-on: ubuntu-latest
steps:
Expand Down
Loading
Loading