mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
* ci(folio): run gradle on jdk 21 for the metro plugin the metro gradle plugin folio builds with publishes org.gradle.jvm.version 21 and java 21 class files, so every leg failed at the folio build on a 17 runtime. local builds pass on jdk 25, which is why only ci saw it. * fix(build): clean pkg/spec/dist, not the dead spec-api path * chore: point stale spec-api comments at pkg/spec * fix(spec): publish src so an installed package carries the runtime entries * fix(testrun): alias the installed spec package so one module graph loads * fix(spec): export Direction, ScrollAction and LongPressAction from the entry * docs(spec): cut the package readme to a description and doc links * docs: say how the cli and spec package versions relate * fix(verifier): report whether the last action was confirmed applied Both hosts get applied: true when the runner saw the dispatch succeed and applied: null when it could not, so an unconfirmed action stops arriving at the spec as no action at all. * fix(runner): an apply error leaves the action's fate unknown, not undone A deadline that fires after the tap was dispatched leaves the effect committed. Reporting nil made the spec see an effect with no action to cause it, which is how the counting property convicts a healthy app. * fix(release): stage the sidecar jar at the renamed embed path * test(replay-ui): trace fixtures for the vacuity counts one real green run, one run that rendered nothing, one that judges every property at least once. * ci(replay-ui): count the steps each property judged the exit code says no property returned false; it does not say any property was ever evaluated. this reads the trace and reports judged vs declined per property, and fails when the step page never rendered. * test(replay-ui): cover the summary script from make test * ci(replay-ui): summarise through the vacuity script * docs(ci): explain the replay-ui judged/declined counts * fix(verifier): encode element-valued extractors into the trace An ax element exports with its find/findAll host functions attached, and json.Marshal refuses the whole value over them: json: unsupported type: func(goja.FunctionCall) goja.Value. The encoding failed, curr stayed nil, and the goja hosts (ios, android) recorded null for every element-valued extractor in both the per-step diff and the violation witness. Apply the web host's sanitize rule before marshaling, so one rule encodes an element on both hosts. * test(verifier): pin element encoding to one rule on both hosts * test(runner): assert an element reaches trace.jsonl and its witness * feat(spec): give state.lastAction an applied field Three states, not two: no action is a null lastAction, applied: true is an action the runner confirmed, applied: null is one it dispatched and never learned the fate of. * fix(folio): do not attribute an effect to an unconfirmed action submitChangesBalanceByTypedAmount and createdAccountHasNonZeroBalance both convict by pinning an effect on the last action, so both decline unless the runner saw it applied. The fixtures now say which fate they mean. * test(folio): an unconfirmed submit belongs in the window The count is an upper bound on the submits a window holds, so the tap that may have landed counts and committedTransactionsExceedSubmits has nothing to convict on. * test(runner): a tap that lands under a failed apply is not a double submit Drives the real folio counting predicates through the runner against a device that commits the tap and then times out. The double-submit case is the control: without it a green proves only that the property never fired. * test(verifier): pin the three lastAction states on both hosts The web page is handed the same applied field the goja object exposes, so a property cannot read one thing on native and another on web. * docs(spec-language): document the three lastAction states
279 lines
9.0 KiB
YAML
279 lines
9.0 KiB
YAML
name: folio
|
|
|
|
# One spec, three platforms. Dispatch-only: each job boots a device or a
|
|
# browser, builds the folio app for that platform, and runs
|
|
# examples/folio/sanderling/spec.ts against it.
|
|
#
|
|
# web and ios are expect-the-bug jobs: folio double-submits a transaction on a
|
|
# double tap, so the run is supposed to end with exit 2. Exit 0 means the fuzzer
|
|
# stopped finding a bug that is still there; exit 1 means the harness broke. The
|
|
# two are worth telling apart, which is why --exit-on-violation exits 2 and not
|
|
# 1.
|
|
#
|
|
# android is a health gate. It convicts in four runs out of five, which is real
|
|
# evidence but not a gate: the fifth would report a regression it had not found.
|
|
# The budget is set so the conviction it usually gets is reported as a bonus.
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
platforms:
|
|
description: which legs to run
|
|
type: choice
|
|
options: [all, android, ios, web]
|
|
default: all
|
|
seed:
|
|
description: seed override (0 = each job's calibrated seed)
|
|
default: "0"
|
|
duration:
|
|
description: wall-clock budget per run
|
|
default: 20m
|
|
max-steps:
|
|
description: step budget override (0 = each job's calibrated budget)
|
|
default: "0"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
android:
|
|
timeout-minutes: 90
|
|
if: ${{ inputs.platforms == 'all' || inputs.platforms == 'android' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Set up the JDKs
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
# The metro gradle plugin folio builds with needs a 21 runtime; the
|
|
# sidecar toolchain pins 17. Both are installed so gradle can pick.
|
|
java-version: |
|
|
17
|
|
21
|
|
|
|
- name: Set up Android SDK
|
|
uses: android-actions/setup-android@v3
|
|
|
|
- name: Set up bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: "1.3.13"
|
|
|
|
- name: Cache Gradle
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: folio-gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
folio-gradle-${{ runner.os }}-
|
|
|
|
# Without this the emulator falls back to software rendering and every
|
|
# step costs several seconds.
|
|
- name: Enable KVM
|
|
run: |
|
|
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
|
|
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
|
sudo udevadm control --reload-rules
|
|
sudo udevadm trigger --name-match=kvm
|
|
|
|
- name: Build the folio APK
|
|
run: ./gradlew :app:androidApp:assembleDebug
|
|
working-directory: examples/folio
|
|
|
|
- name: Build sanderling
|
|
run: make sanderling-android
|
|
|
|
- name: Fuzz folio on an emulator
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
with:
|
|
api-level: 34
|
|
target: google_apis
|
|
arch: x86_64
|
|
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim
|
|
disable-animations: true
|
|
script: .github/scripts/folio-run.sh android
|
|
env:
|
|
SEED: ${{ inputs.seed != '0' && inputs.seed || '9' }}
|
|
MAX_STEPS: ${{ inputs.max-steps != '0' && inputs.max-steps || '200' }}
|
|
DURATION: ${{ inputs.duration }}
|
|
|
|
- name: Upload the run
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: folio-android
|
|
path: runs/
|
|
retention-days: 14
|
|
|
|
ios:
|
|
timeout-minutes: 90
|
|
if: ${{ inputs.platforms == 'all' || inputs.platforms == 'ios' }}
|
|
runs-on: macos-15
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Set up bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: "1.3.13"
|
|
|
|
# idb-companion is not in homebrew-core, only in facebook/homebrew-fb, so
|
|
# it has to be named by its full tap path. xcodegen and just are core.
|
|
- name: Install idb-companion, xcodegen and just
|
|
run: brew install facebook/fb/idb-companion xcodegen just
|
|
|
|
- name: Set up the JDKs
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
# The metro gradle plugin folio builds with needs a 21 runtime; the
|
|
# sidecar toolchain pins 17. Both are installed so gradle can pick.
|
|
java-version: |
|
|
17
|
|
21
|
|
|
|
# The iOS app builds its Kotlin framework through the folio gradle
|
|
# project, which configures :app:androidApp and so needs an Android SDK
|
|
# even on this leg.
|
|
- name: Set up Android SDK
|
|
uses: android-actions/setup-android@v3
|
|
|
|
# Both asset tarballs are built by the prepare scripts, and the runner
|
|
# bundle is an xcodebuild of companion/Sources. Keyed on the scripts and
|
|
# the versions the Makefile embeds, so a later run reuses them.
|
|
- name: Cache the companion and runner bundles
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
internal/driver/ioscompanion/companionassets/assets
|
|
internal/driver/ioscompanion/runnerassets/assets
|
|
key: ios-assets-${{ runner.os }}-${{ hashFiles('internal/driver/ioscompanion/companionassets/prepare.sh', 'companion/prepare.sh', 'companion/project.yml', 'companion/Sources/**') }}
|
|
|
|
- name: Build sanderling
|
|
run: make sanderling-ios
|
|
|
|
- name: Boot a simulator
|
|
run: |
|
|
xcrun simctl boot "$IOS_DEVICE" || true
|
|
xcrun simctl bootstatus "$IOS_DEVICE" -b
|
|
env:
|
|
IOS_DEVICE: iPhone 16 Pro
|
|
|
|
- name: Build and install folio
|
|
run: just ios
|
|
working-directory: examples/folio
|
|
env:
|
|
IOS_DEVICE: iPhone 16 Pro
|
|
|
|
# `just ios` leaves the app running, and the run's own clear-data
|
|
# reinstall on top of a live app has raced FrontBoard into refusing the
|
|
# launch ("app.folio is unknown to FrontBoard") with the run then hanging.
|
|
- name: Stop the app before the run
|
|
run: xcrun simctl terminate booted app.folio || true
|
|
|
|
- name: Fuzz folio on the simulator
|
|
run: .github/scripts/folio-run.sh ios
|
|
env:
|
|
SEED: ${{ inputs.seed != '0' && inputs.seed || '7' }}
|
|
MAX_STEPS: ${{ inputs.max-steps != '0' && inputs.max-steps || '240' }}
|
|
DURATION: ${{ inputs.duration }}
|
|
IOS_DEVICE: iPhone 16 Pro
|
|
|
|
- name: Upload the run
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: folio-ios
|
|
path: runs/
|
|
retention-days: 14
|
|
|
|
web:
|
|
timeout-minutes: 60
|
|
if: ${{ inputs.platforms == 'all' || inputs.platforms == 'web' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Set up the JDKs
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
# The metro gradle plugin folio builds with needs a 21 runtime; the
|
|
# sidecar toolchain pins 17. Both are installed so gradle can pick.
|
|
java-version: |
|
|
17
|
|
21
|
|
|
|
- name: Set up bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: "1.3.13"
|
|
|
|
- name: Cache Gradle
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: folio-gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
folio-gradle-${{ runner.os }}-
|
|
|
|
- name: Set up Chrome
|
|
uses: browser-actions/setup-chrome@v1
|
|
with:
|
|
chrome-version: stable
|
|
|
|
- name: Allow Chrome under unprivileged user namespaces
|
|
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
|
|
|
|
- name: Verify headless Chrome starts
|
|
run: |
|
|
chrome --version
|
|
chrome --headless --no-sandbox --disable-gpu --disable-dev-shm-usage \
|
|
--dump-dom 'data:text/html,<title>ok</title>'
|
|
|
|
- name: Build the folio wasmJs app
|
|
run: ./gradlew :app:webApp:wasmJsBrowserDevelopmentExecutableDistribution
|
|
working-directory: examples/folio
|
|
|
|
- name: Build sanderling
|
|
run: make sanderling-web
|
|
|
|
- name: Fuzz folio in the browser
|
|
run: .github/scripts/folio-run.sh web
|
|
env:
|
|
SEED: ${{ inputs.seed != '0' && inputs.seed || '3' }}
|
|
MAX_STEPS: ${{ inputs.max-steps != '0' && inputs.max-steps || '240' }}
|
|
DURATION: ${{ inputs.duration }}
|
|
|
|
- name: Upload the run
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: folio-web
|
|
path: runs/
|
|
retention-days: 14
|