Skip to content

Introduce loadtest Command to Soroban RPC #2750

Introduce loadtest Command to Soroban RPC

Introduce loadtest Command to Soroban RPC #2750

Workflow file for this run

name: Soroban RPC
defaults:
run:
shell: bash
on:
push:
branches: [main, release/**]
pull_request:
jobs:
test:
name: Unit tests
strategy:
matrix:
os: [ubuntu-20.04]
go: [1.20.1]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
# For pull requests, build and test the PR head not a merge of the PR with the destination.
ref: ${{ github.event.pull_request.head.sha || github.ref }}
# We need to full history for git-restore-mtime to know what modification dates to use.
# Otherwise, the Go test cache will fail (due to the modification time of fixtures changing).
fetch-depth: "0"
- uses: ./.github/actions/setup-go
with:
go-version: ${{ matrix.go }}
- name: Build soroban contract fixtures
run: |
rustup update
rustup target add wasm32-unknown-unknown
make build-test-wasms
- run: make build-libpreflight
- run: go test -race -cover -timeout 25m -v ./cmd/soroban-rpc/...
build:
name: Build
strategy:
matrix:
include:
- os: ubuntu-latest
rust_target: x86_64-unknown-linux-gnu
go_arch: amd64
- os: ubuntu-latest
rust_target: aarch64-unknown-linux-gnu
go_arch: arm64
- os: macos-latest
rust_target: x86_64-apple-darwin
go_arch: amd64
- os: macos-latest
rust_target: aarch64-apple-darwin
go_arch: arm64
- os: windows-latest
rust_target: x86_64-pc-windows-gnu
go_arch: amd64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
# we cannot use our own ./.github/actions/setup-go action
# because it uses apt-get and some OSs (e.g. windows) don't have it
- uses: actions/setup-go@v3
with:
go-version: 1.20.1
- run: |
rustup target add ${{ matrix.rust_target }}
rustup update
# On windows, make sure we have the same compiler (linker) used by rust.
# This is important since the symbols names won't match otherwise.
- if: matrix.os == 'windows-latest'
name: Install the same mingw gcc compiler used by rust
run: |
C:/msys64/usr/bin/pacman.exe -S mingw-w64-x86_64-gcc --noconfirm
echo "CC=C:/msys64/mingw64/bin/gcc.exe" >> $GITHUB_ENV
echo "C:/msys64/mingw64/bin" >> $GITHUB_PATH
# Use cross-compiler for linux aarch64
- if: matrix.rust_target == 'aarch64-unknown-linux-gnu'
name: Install aarch64 cross-compilation toolchain
run: |
sudo apt-get update
sudo apt-get install -y gcc-10-aarch64-linux-gnu
echo 'CC=aarch64-linux-gnu-gcc-10' >> $GITHUB_ENV
- name: Build libpreflight
run: make build-libpreflight
env:
CARGO_BUILD_TARGET: ${{ matrix.rust_target }}
- name: Build Soroban RPC reproducible build
run: |
go build -trimpath -buildvcs=false ./cmd/soroban-rpc
ls -lh soroban-rpc
file soroban-rpc
env:
CGO_ENABLED: 1
GOARCH: ${{ matrix.go_arch }}
integration:
name: Integration tests
continue-on-error: true
strategy:
matrix:
os: [ubuntu-20.04]
go: [1.20.1]
test: ['.*CLI.*', '^Test(([^C])|(C[^L])|(CL[^I])).*$']
runs-on: ${{ matrix.os }}
env:
SOROBAN_RPC_INTEGRATION_TESTS_ENABLED: true
SOROBAN_RPC_INTEGRATION_TESTS_CAPTIVE_CORE_BIN: /usr/bin/stellar-core
PROTOCOL_20_CORE_DEBIAN_PKG_VERSION: 19.13.1-1481.3acf6dd26.focal
steps:
- uses: actions/checkout@v3
with:
# For pull requests, build and test the PR head not a merge of the PR with the destination.
ref: ${{ github.event.pull_request.head.sha || github.ref }}
# We need to full history for git-restore-mtime to know what modification dates to use.
# Otherwise, the Go test cache will fail (due to the modification time of fixtures changing).
fetch-depth: "0"
- uses: ./.github/actions/setup-integration-tests
with:
go-version: ${{ matrix.go }}
- name: Run Soroban RPC Integration Tests
run: |
go test -race -run '${{ matrix.test }}' -timeout 60m -v ./cmd/soroban-rpc/internal/test/...