Skip to content

Self-hosted oracle test suite #1

Self-hosted oracle test suite

Self-hosted oracle test suite #1

Workflow file for this run

name: Self-hosted oracle test suite
on:
workflow_dispatch:
schedule:
# Nightly only: this job boots the full docker any-sync stack (mongo
# replica set, redis, minio, coordinator, 3 sync nodes, consensus node,
# filenode, netcheck) from a cold cache, which is much slower than the
# other CI jobs and pulls several GB of images. Not run on every push/PR.
- cron: '0 7 * * *'
jobs:
test-oracle:
runs-on: ubuntu-latest
steps:
- name: Checkout ManyType
uses: actions/checkout@v4
with:
path: ManyType
- name: Require dependency checkout token
env:
DEPENDENCY_CHECKOUT_TOKEN: ${{ secrets.DEPENDENCY_CHECKOUT_TOKEN }}
run: |
if [ -z "${DEPENDENCY_CHECKOUT_TOKEN:-}" ]; then
echo "DEPENDENCY_CHECKOUT_TOKEN must be a read-only PAT that can clone sneurlax/manyui" >&2
exit 1
fi
- name: Checkout pinned ManyUI
uses: actions/checkout@v4
with:
repository: sneurlax/manyui
ref: e6aa5314b47868ac8d0d8b44474545fed6004226
path: ManyUI
token: ${{ secrets.DEPENDENCY_CHECKOUT_TOKEN }}
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: ManyType/rust
- name: Build release FFI library and manytype_server
working-directory: ManyType/rust
run: >-
timeout --signal=TERM --kill-after=30s 45m
cargo build --release -p manytype_quic_ffi -p manytype_server
- uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Activate melos
run: dart pub global activate melos
- name: melos bootstrap
working-directory: ManyType
run: timeout --signal=TERM --kill-after=30s 15m dart pub global run melos bootstrap
- name: Pin oracle versions and official CLI image
working-directory: ManyType
run: timeout --signal=TERM --kill-after=30s 15m bash scripts/self_hosted_oracle_pin.sh
- name: Start self-hosted any-sync oracle stack
working-directory: ManyType/docker/any-sync
run: timeout --signal=TERM --kill-after=30s 45m make -s start
- name: Wait for oracle netcheck to report healthy
working-directory: ManyType
run: |
for i in $(seq 1 60); do
status="$(docker inspect -f '{{.State.Health.Status}}' any-sync-netcheck-1 2>/dev/null || echo starting)"
if [ "$status" = "healthy" ]; then
echo "netcheck healthy after ${i}0s"
exit 0
fi
sleep 10
done
echo "netcheck did not become healthy in time" >&2
docker compose -f docker/any-sync/docker-compose.yml logs --tail=200
exit 1
- name: Self-hosted oracle preflight
working-directory: ManyType
run: timeout --signal=TERM --kill-after=30s 10m bash scripts/self_hosted_oracle_preflight.sh
- name: Start manytype_server (required by round_trip_test.dart)
working-directory: ManyType/rust
run: |
./target/release/manytype_server manytype_server/test_config.toml >/tmp/manytype_server.log 2>&1 &
echo $! > /tmp/manytype_server.pid
for _ in $(seq 1 30); do
if python3 ../scripts/read_server_ready.py /tmp/manytype_server.log >/dev/null 2>&1; then
exit 0
fi
sleep 1
done
echo "manytype_server did not become ready" >&2
cat /tmp/manytype_server.log >&2
exit 1
- name: melos run test:oracle
working-directory: ManyType
run: >-
timeout --signal=TERM --kill-after=30s 90m
dart pub global run melos run test:oracle --no-select
env:
LD_LIBRARY_PATH: ${{ github.workspace }}/ManyType/rust/target/release
- name: Stop manytype_server
if: always()
run: kill "$(cat /tmp/manytype_server.pid)" 2>/dev/null || true
- name: Oracle stack logs (always, for debugging)
if: always()
working-directory: ManyType/docker/any-sync
run: docker compose logs --tail=100
- name: Tear down oracle stack
if: always()
working-directory: ManyType/docker/any-sync
run: docker compose down --remove-orphans --volumes