Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
ci(verify): audio suite on all three platforms, document the upload gate
Richie McIlroy65f9c73a3e6a
diff --git a/.github/actions/engine-verify-setup/action.yml b/.github/actions/engine-verify-setup/action.ymlindex 0869aff92..7f86f2452 100644--- a/.github/actions/engine-verify-setup/action.yml+++ b/.github/actions/engine-verify-setup/action.yml@@ -71,6 +71,11 @@ runs:RUST_TARGET_TRIPLE: ${{ inputs.target }}run: node scripts/setup.js+ - name: FFmpeg libraries on the loader path (Linux)+ if: runner.os == 'Linux'+ shell: bash+ run: echo "LD_LIBRARY_PATH=${{ github.workspace }}/target/native-deps/lib" >> "$GITHUB_ENV"+- name: FFmpeg DLLs on PATH (Windows)if: runner.os == 'Windows'shell: pwshdiff --git a/.github/workflows/verify-audio-tmp.yml b/.github/workflows/verify-audio-tmp.ymldeleted file mode 100644index c0bd5f119..000000000--- a/.github/workflows/verify-audio-tmp.yml+++ /dev/null@@ -1,151 +0,0 @@-name: cap-verify audio (temporary triage)--# Temporary workflow for the AUDIO track: runs the cap-verify audio oracle-# on Windows, Linux and macOS runners and uploads the per-case JSON reports.-# Not for merging; the CI-INFRA track owns engine-verify.yml.--on:- push:- branches:- - ci/verify-audio- workflow_dispatch:- inputs:- repeats:- description: "Times to run the audio test binary"- default: "2"- tier:- description: "CAP_VERIFY_TIER (fast or full)"- default: "fast"--concurrency:- group: verify-audio-${{ github.ref_name }}- cancel-in-progress: true--permissions:- contents: read--env:- CARGO_TERM_COLOR: never- CARGO_INCREMENTAL: "0"- RUST_BACKTRACE: "1"--jobs:- audio:- name: audio (${{ matrix.runner }})- strategy:- fail-fast: false- matrix:- include:- - runner: windows-2022- triple: x86_64-pc-windows-msvc- - runner: ubuntu-24.04- triple: x86_64-unknown-linux-gnu- - runner: macos-15- triple: aarch64-apple-darwin- runs-on: ${{ matrix.runner }}- timeout-minutes: 120- env:- REPEATS: ${{ github.event.inputs.repeats || '2' }}- CAP_VERIFY_TIER: ${{ github.event.inputs.tier || 'fast' }}- CAP_VERIFY_FIXTURE_DIR: ${{ github.workspace }}/verify-fixtures- OUT: ${{ github.workspace }}/verify-out- steps:- - uses: actions/checkout@v4-- - uses: dtolnay/[email protected]-- - name: Rust cache (restore only)- uses: ./.github/actions/setup-rust-cache- with:- target: ${{ matrix.triple }}- prefix-key: v1-rust-sync- save-cache: "false"-- - uses: ./.github/actions/install-desktop-deps-- - uses: actions/setup-node@v4- with:- node-version: 24-- - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0- with:- python-version: "3.13"-- - name: Native dependencies- env:- RUST_TARGET_TRIPLE: ${{ matrix.triple }}- run: node scripts/setup.js-- - name: FFmpeg DLLs on PATH (Windows)- if: runner.os == 'Windows'- shell: pwsh- run: Add-Content -Path $env:GITHUB_PATH -Value "${{ github.workspace }}\\target\\ffmpeg\\bin"-- - name: Native libs on LD_LIBRARY_PATH (Linux)- if: runner.os == 'Linux'- run: echo "LD_LIBRARY_PATH=${{ github.workspace }}/target/native-deps/lib:${{ github.workspace }}/target/debug" >> "$GITHUB_ENV"-- - name: Software Vulkan (Linux)- if: runner.os == 'Linux'- run: |- sudo apt-get update- sudo apt-get install -y mesa-vulkan-drivers libvulkan1 vulkan-tools-- - name: Build tests- shell: bash- run: |- mkdir -p "$OUT"- start=$(date +%s)- cargo test --locked -p cap-verify --test audio --no-run 2>&1 | tail -40- echo "build_seconds=$(( $(date +%s) - start ))" | tee -a "$OUT/timings.txt"-- - name: Run audio oracle (${{ env.REPEATS }}x)- shell: bash- run: |- set +e- status=0- for run in $(seq 1 "$REPEATS"); do- export CAP_VERIFY_REPORT_DIR="$OUT/run$run"- mkdir -p "$CAP_VERIFY_REPORT_DIR"- start=$(date +%s)- cargo test --locked -p cap-verify --test audio -- --nocapture > "$OUT/run$run.log" 2>&1- code=$?- echo "run$run exit=$code seconds=$(( $(date +%s) - start ))" | tee -a "$OUT/timings.txt"- grep -E "^\[cap-verify\] (pass|xfail|FAIL|XPASS)|^ |^test .* \.\.\. |panicked|error" "$OUT/run$run.log" | head -200- [ $code -ne 0 ] && status=1- done- exit $status-- - name: Summarise- if: always()- shell: bash- run: |- python - "$OUT" >> "$GITHUB_STEP_SUMMARY" <<'PY'- import glob, json, os, sys, collections- out = sys.argv[1]- cases = collections.OrderedDict()- for path in sorted(glob.glob(os.path.join(out, "run*", "*.jsonl"))):- run = path.split(os.sep)[-2]- for line in open(path, encoding="utf-8"):- r = json.loads(line)- cases.setdefault(r["id"], []).append((run, r["outcome"], r["seconds"], r["summary"].splitlines()[0][:200]))- print(f"## cap-verify audio on {os.environ.get('RUNNER_OS')}")- print()- print("| case | outcomes | seconds | first line |")- print("|---|---|---|---|")- for cid, rs in cases.items():- outs = " ".join(o for _, o, _, _ in rs)- secs = " ".join(f"{s:.1f}" for _, _, s, _ in rs)- print(f"| {cid} | {outs} | {secs} | {rs[0][3].replace('|', '/')} |")- print()- for line in open(os.path.join(out, "timings.txt"), encoding="utf-8"):- print(f"- {line.strip()}")- PY-- - name: Upload reports- if: always()- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2- with:- name: verify-audio-${{ matrix.runner }}- path: ${{ github.workspace }}/verify-out- if-no-files-found: warndiff --git a/crates/verify/README.md b/crates/verify/README.mdindex c7413367b..b2b30e290 100644--- a/crates/verify/README.md+++ b/crates/verify/README.md@@ -17,9 +17,18 @@ The suites are listed in `scripts/verify/suites.json`:| `export` | every exported frame (MP4, GIF, both decoders on macOS) | linux, macos, windows | all || `playback` | offline-driven editor playback frames | linux, macos | all || `seek` | random, keyframe and scrub seeks | linux, macos | all |+| `audio` | export and offline playback audio against sample-accurate markers | linux, macos, windows | all || `decoder-model-ffmpeg` | FFmpeg decoder decisions on scripted media (`cap-rendering` `decoder::model`) | linux | linux || `decoder-model-avf` | AVAssetReader decoder decisions on scripted media | macos | macos |+The upload fault suite (`apps/desktop-gpui/src/upload/verify_tests.rs` and+`upload/queue/verify_resume_tests.rs`: a mock Cap API with scripted 5xx,+resets, outages, hangs and quits, byte-identical objects and request and byte+budgets) lives in the GPUI app's own workspace. It runs inside+`cargo test --bin cap-gpui`, which the `CI / Build GPUI Desktop` job already+runs on all three OSes, so that job is its gate. Run it locally with+`cargo test --manifest-path apps/desktop-gpui/Cargo.toml --bin cap-gpui upload::`.+Platform-independent logic runs on Linux only in CI. Suites that test platformcode run on that platform: AVFoundation, VideoToolbox and Metal on macOS;Media Foundation, Direct3D and WASAPI on Windows. When you run the suitediff --git a/scripts/verify/suites.json b/scripts/verify/suites.jsonindex 42c0517c9..af85eb24c 100644--- a/scripts/verify/suites.json+++ b/scripts/verify/suites.json@@ -4,57 +4,206 @@{"name": "verify-self","about": "marker codecs, reference timeline model, oracle and report self-tests",- "cargo": ["-p", "cap-verify", "--lib", "--test", "codec"],- "binaries": ["cap-verify", "cap-verify::codec"],- "platforms": { "fast": ["linux"], "full": ["linux", "macos"] },- "roots": ["cap-verify"],- "own": ["crates/verify/tests/codec.rs"]+ "cargo": [+ "-p",+ "cap-verify",+ "--lib",+ "--test",+ "codec"+ ],+ "binaries": [+ "cap-verify",+ "cap-verify::codec"+ ],+ "platforms": {+ "fast": [+ "linux"+ ],+ "full": [+ "linux",+ "macos"+ ]+ },+ "roots": [+ "cap-verify"+ ],+ "own": [+ "crates/verify/tests/codec.rs"+ ]},{"name": "export","about": "every exported frame against the reference model (MP4, GIF, both decoders on macOS)",- "cargo": ["-p", "cap-verify", "--test", "export"],- "binaries": ["cap-verify::export"],- "platforms": { "fast": ["linux", "macos", "windows"], "full": ["linux", "macos", "windows"] },- "roots": ["cap-verify"],- "own": ["crates/verify/tests/export.rs"]+ "cargo": [+ "-p",+ "cap-verify",+ "--test",+ "export"+ ],+ "binaries": [+ "cap-verify::export"+ ],+ "platforms": {+ "fast": [+ "linux",+ "macos",+ "windows"+ ],+ "full": [+ "linux",+ "macos",+ "windows"+ ]+ },+ "roots": [+ "cap-verify"+ ],+ "own": [+ "crates/verify/tests/export.rs"+ ]},{"name": "playback","about": "offline-driven editor playback frames against the reference model",- "cargo": ["-p", "cap-verify", "--test", "playback"],- "binaries": ["cap-verify::playback"],- "platforms": { "fast": ["linux", "macos"], "full": ["linux", "macos", "windows"] },- "roots": ["cap-verify"],- "own": ["crates/verify/tests/playback.rs"]+ "cargo": [+ "-p",+ "cap-verify",+ "--test",+ "playback"+ ],+ "binaries": [+ "cap-verify::playback"+ ],+ "platforms": {+ "fast": [+ "linux",+ "macos"+ ],+ "full": [+ "linux",+ "macos",+ "windows"+ ]+ },+ "roots": [+ "cap-verify"+ ],+ "own": [+ "crates/verify/tests/playback.rs"+ ]},{"name": "seek","about": "random, keyframe and scrub seeks against the reference model",- "cargo": ["-p", "cap-verify", "--test", "seek"],- "binaries": ["cap-verify::seek"],- "platforms": { "fast": ["linux", "macos"], "full": ["linux", "macos", "windows"] },- "roots": ["cap-verify"],- "own": ["crates/verify/tests/seek.rs"]+ "cargo": [+ "-p",+ "cap-verify",+ "--test",+ "seek"+ ],+ "binaries": [+ "cap-verify::seek"+ ],+ "platforms": {+ "fast": [+ "linux",+ "macos"+ ],+ "full": [+ "linux",+ "macos",+ "windows"+ ]+ },+ "roots": [+ "cap-verify"+ ],+ "own": [+ "crates/verify/tests/seek.rs"+ ]+ },+ {+ "name": "audio",+ "about": "export and offline playback audio against sample-accurate markers (mic, system audio, cuts, speeds, mute, volume, A/V offset)",+ "cargo": [+ "-p",+ "cap-verify",+ "--test",+ "audio"+ ],+ "binaries": [+ "cap-verify::audio"+ ],+ "platforms": {+ "fast": [+ "linux",+ "macos",+ "windows"+ ],+ "full": [+ "linux",+ "macos",+ "windows"+ ]+ },+ "roots": [+ "cap-verify"+ ],+ "own": [+ "crates/verify/tests/audio.rs",+ "crates/verify/tests/audio_support/**",+ "crates/verify/src/audio_model.rs",+ "crates/verify/src/audio_fixture.rs"+ ]},{"name": "decoder-model-ffmpeg","about": "model-based fuzzing of the FFmpeg decoder's request decisions on scripted media",- "cargo": ["-p", "cap-rendering", "--lib"],- "binaries": ["cap-rendering"],+ "cargo": [+ "-p",+ "cap-rendering",+ "--lib"+ ],+ "binaries": [+ "cap-rendering"+ ],"test": "decoder::model::ffmpeg_answers_match_the_reference_model",- "platforms": { "fast": ["linux"], "full": ["linux"] },- "roots": ["cap-rendering"],+ "platforms": {+ "fast": [+ "linux"+ ],+ "full": [+ "linux"+ ]+ },+ "roots": [+ "cap-rendering"+ ],"own": []},{"name": "decoder-model-avf","about": "model-based fuzzing of the AVAssetReader decoder's request decisions on scripted media",- "cargo": ["-p", "cap-rendering", "--lib"],- "binaries": ["cap-rendering"],+ "cargo": [+ "-p",+ "cap-rendering",+ "--lib"+ ],+ "binaries": [+ "cap-rendering"+ ],"test": "decoder::model::avassetreader_answers_match_the_reference_model",- "platforms": { "fast": ["macos"], "full": ["macos"] },- "roots": ["cap-rendering"],+ "platforms": {+ "fast": [+ "macos"+ ],+ "full": [+ "macos"+ ]+ },+ "roots": [+ "cap-rendering"+ ],"own": []}],@@ -71,8 +220,20 @@"vendor/**"],"runners": {- "linux": { "runner": "ubuntu-24.04", "target": "x86_64-unknown-linux-gnu", "shards": 1 },- "macos": { "runner": "macos-15", "target": "aarch64-apple-darwin", "shards": 1 },- "windows": { "runner": "windows-2022", "target": "x86_64-pc-windows-msvc", "shards": 1 }+ "linux": {+ "runner": "ubuntu-24.04",+ "target": "x86_64-unknown-linux-gnu",+ "shards": 1+ },+ "macos": {+ "runner": "macos-15",+ "target": "aarch64-apple-darwin",+ "shards": 1+ },+ "windows": {+ "runner": "windows-2022",+ "target": "x86_64-pc-windows-msvc",+ "shards": 1+ }}}