Run Jepsen Tests #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Jepsen Tests | |
on: | |
workflow_dispatch: | |
inputs: | |
workloads: | |
description: Workloads (as JSON) | |
type: string | |
required: true | |
default: "[ 'powersync-single' ]" | |
nemeses: | |
description: 'Nemeses (as JSON)' | |
type: string | |
required: true | |
default: "[ 'none' ]" | |
rates: | |
description: 'Rates (as JSON)' | |
type: string | |
required: true | |
default: "[ '150' ]" | |
time-limits: | |
description: 'Timelimits (as JSON)' | |
type: string | |
required: true | |
default: "[ '100' ]" | |
cli-opts: | |
description: 'CLI opts string' | |
type: string | |
required: false | |
default: --nodes n1 | |
workflow_call: | |
inputs: | |
workloads: | |
description: 'Workloads (as JSON)' | |
type: string | |
required: true | |
default: "[ 'powersync-single' ]" | |
nemeses: | |
description: 'Nemeses (as JSON)' | |
type: string | |
required: true | |
default: "[ 'none' ]" | |
rates: | |
description: 'Rates (as JSON)' | |
type: string | |
required: true | |
default: "[ '150' ]" | |
time-limits: | |
description: 'Timelimits (as JSON)' | |
type: string | |
required: true | |
default: "[ '100' ]" | |
cli-opts: | |
description: 'CLI opts string' | |
type: string | |
required: false | |
default: --nodes n1 | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
workload: ${{ fromJSON(inputs.workloads) }} | |
nemesis: ${{ fromJSON(inputs.nemeses) }} | |
rate: ${{ fromJSON(inputs.rates) }} | |
time-limit: ${{ fromJSON(inputs.time-limits) }} | |
env: | |
test-title: ${{ matrix.workload }}-${{ matrix.nemesis }}-${{ matrix.rate }}tps-${{ matrix.time-limit }}s | |
steps: | |
- name: Checkout jepsen-powersync | |
uses: actions/checkout@v4 | |
- name: Bring Up Docker Environment | |
run: | | |
cd $GITHUB_WORKSPACE/docker | |
./docker-build.sh | |
./docker-compose-up.sh | |
- name: ${{ env.test-title }} | |
run: | | |
cd $GITHUB_WORKSPACE/docker | |
./docker-run.sh lein run test --workload ${{ matrix.workload }} \ | |
--nemesis ${{ matrix.nemesis }} \ | |
--rate ${{ matrix.rate }} \ | |
--time-limit ${{ matrix.time-limit }} \ | |
${{ inputs.cli-opts }} | |
- name: Jepsen, PowerSync, and PostgreSQL Logs | |
if: ${{ always() }} | |
run: | | |
mkdir -p $GITHUB_WORKSPACE/store/current | |
docker logs powersync &> $GITHUB_WORKSPACE/store/current/powersync.log || echo "no docker logs" > $GITHUB_WORKSPACE/store/current/powersync.log | |
docker logs pg-db &> $GITHUB_WORKSPACE/store/current/pg-db.log || echo "no docker logs" > $GITHUB_WORKSPACE/store/current/pg-db.log | |
docker logs mongo &> $GITHUB_WORKSPACE/store/current/mongo.log || echo "no docker logs" > $GITHUB_WORKSPACE/store/current/mongo.log | |
docker logs mongo-rs-init &> $GITHUB_WORKSPACE/store/current/mongo-rs-init.log || echo "no docker logs" > $GITHUB_WORKSPACE/store/current/mongo-rs-init.log | |
docker cp jepsen-control:/jepsen/jepsen-powersync/store/current/. $GITHUB_WORKSPACE/store/current | |
tail -n 100 $GITHUB_WORKSPACE/store/current/jepsen.log > $GITHUB_WORKSPACE/store/current/tail-jepsen.log | |
- name: 'Jepsen Test Artifacts: summary' | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: '${{ env.test-title }}-summary' | |
path: | | |
${{ github.workspace }}/store/current/results.edn | |
${{ github.workspace }}/store/current/tail-jepsen.log | |
- name: 'Jepsen Test Artifacts: failure-full' | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: '${{ env.test-title }}-failure-full' | |
path: | | |
${{ github.workspace }}/store/current |