Skip to content

Stabilize client network error coverage #224

Stabilize client network error coverage

Stabilize client network error coverage #224

on:
push:
branches:
- main
pull_request:
branches:
- main
- dev
name: Integration Test
env:
# rippled binary was renamed to xrpld; use the new image name.
# Tracks xrpl.js PR #3270 (https://github.com/XRPLF/xrpl.js/pull/3270).
XRPLD_DOCKER_IMAGE: rippleci/xrpld:develop
# Files measured by the integration coverage gate are the inverse of this regex.
# Unit-test territory (models, core, utils, _serde) is excluded; integration territory
# (CLI, asynch::clients, account/, ledger/, transaction/, faucet) is what remains.
COVERAGE_IGNORE_REGEX: '(_serde|core|models|utils)/|constants\.rs$|macros\.rs$|lib\.rs$|wallet/(mod|exceptions)\.rs$|tests/'
jobs:
integration_test:
name: Integration Test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Run xrpld in standalone mode
run: |
docker run \
--detach \
--rm \
--publish 5005:5005 \
--publish 6006:6006 \
--volume "${{ github.workspace }}/.ci-config/":"/etc/xrpld/" \
--name xrpld-service \
${{ env.XRPLD_DOCKER_IMAGE }} --standalone
- uses: dtolnay/rust-toolchain@stable
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@65851e10cd6c377f11a60e600abc07cb08643468 # v2.79.3
with:
tool: cargo-llvm-cov
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-integration-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-integration-
- name: Run integration tests under coverage
run: |
cargo llvm-cov --no-report --release \
--features std,json-rpc,helpers,cli,websocket,integration \
--test integration_test \
--test cli_integration \
--test funding \
--test utils \
--test test_utils \
-- --test-threads=1
env:
RUST_BACKTRACE: 1
- name: Generate lcov report (scoped to integration territory)
run: |
cargo llvm-cov report --release \
--lcov --output-path lcov.info \
--ignore-filename-regex '${{ env.COVERAGE_IGNORE_REGEX }}'
- name: Upload coverage to Codecov
uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5.5.5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
flags: integration
fail_ci_if_error: true
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: integration-lcov-report
path: lcov.info
- name: Dump xrpld logs and stop container
if: always()
run: |
docker logs xrpld-service 2>&1 || echo "::warning::xrpld-service container not present for logs"
docker stop xrpld-service 2>/dev/null || true