Skip to content

Merge pull request #164 from compoundingtech/fix/macos-update-supervisor #387

Merge pull request #164 from compoundingtech/fix/macos-update-supervisor

Merge pull request #164 from compoundingtech/fix/macos-update-supervisor #387

Workflow file for this run

name: test
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
# The watcher is where the platforms genuinely differ, and for two days this
# workflow certified a real bug as fixed because it only ever asked ubuntu.
#
# `a_change_and_a_delete_cross_a_peer_that_is_only_a_relay` was red on macOS
# and green here, at the same commit, while the forwarding defect it names was
# live in the fleet. A node adopted a change and forwarded it to nobody for
# five minutes. The test existed, this workflow ran it, and it passed.
#
# The step at the bottom of the ubuntu job proves every tests/*.rs target runs
# SOMEWHERE. It cannot see this axis: it proves coverage on the one platform it
# knows about. That is the same failure one dimension over.
#
# Scoped deliberately rather than mirroring the whole matrix. macOS runners
# bill at a multiple of Linux, so this runs the library tests and the
# adversarial folder-sync matrix — the watcher-sensitive ones — and not the
# rest. Widen it when something escapes it, not before.
macos:
runs-on: macos-14
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
# `timeout` is GNU coreutils and is NOT on a macOS runner, which is what
# the ubuntu steps below use. Copying them verbatim failed this job with
# `timeout: command not found` before it compiled anything. Use the
# step-level bound instead: it is the platform-independent one, and it
# kills the step rather than the process inside it.
#
# Includes the watcher tests that are #[cfg]-gated per platform and so
# have never executed in CI at all.
- name: Library and model tests
timeout-minutes: 10
run: cargo test --locked --lib
- name: Adversarial folder sync matrix
timeout-minutes: 15
run: cargo test --locked --test folder_sync -- --test-threads=1
deterministic:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Library and model tests
run: timeout 10m cargo test --locked --lib
# The binary's own tests were never built here, so a test in src/main.rs
# could stop COMPILING and this workflow stayed green. One had: the
# `sync ls --json` schema test missed the `sweep` field added in #61.
- name: Binary tests
run: timeout 5m cargo test --locked --bins
- name: Deterministic fake two-machine folder sync
run: >-
timeout 5m cargo test --locked --lib
sync::engine::tests::two_engines_sync_real_folders_over_loopback
-- --exact
- name: Deterministic fake three-machine simultaneous sync
run: >-
timeout 5m cargo test --locked --lib
sync::engine::tests::simultaneous_three_peer_syncs_do_not_deadlock
-- --exact
- name: Provisioning and CLI contract
run: timeout 5m cargo test --locked --test provisioning -- --test-threads=1
- name: Doctor command contract
run: timeout 5m cargo test --locked --test doctor -- --test-threads=1
- name: Real iroh folder sync and restart
run: timeout 10m cargo test --locked --test sync_slice -- --test-threads=1
# The adversarial delete matrix. It was added on 2026-08-25 and NOT added
# here, so the two tests that reproduce a file-loss incident ran only on
# the author's laptop. That is the same shape as the `--bins` gap above.
- name: Adversarial folder sync matrix
run: timeout 10m cargo test --locked --test folder_sync -- --test-threads=1
- name: Update command contract
run: timeout 5m cargo test --locked --test update -- --test-threads=1
- name: Fabric sync diagnostic contract
run: timeout 5m cargo test --locked --test fabric_sync -- --test-threads=1
- name: Serial local multi-node daemon slice
run: timeout 15m cargo test --locked --test local_slice -- --test-threads=1
# PR 76 excluded these three only because they had passed on macOS but had
# never run on Linux CI. It did not record a Linux failure.
- name: Daemon lifecycle contract
run: timeout 10m cargo test --locked --test lifecycle -- --test-threads=1
- name: Path watcher contract
run: timeout 5m cargo test --locked --test pathwatch_slice -- --test-threads=1
- name: Shell and restart contract
run: timeout 15m cargo test --locked --test shell -- --test-threads=1
# A NEW FILE IN tests/ DOES NOT RUN HERE UNLESS SOMEBODY ADDS A STEP FOR
# IT, and forgetting is silent: the suite goes green while the new tests
# never execute. That has now happened twice, once for the binary's own
# tests and once for the delete matrix.
#
# So every target must RUN above. Adding a test file and nothing else
# fails this step, which is the point.
- name: Every test target is accounted for
run: |
set -euo pipefail
# This proves every target runs on THIS platform. It says nothing
# about the others, which is how a macOS-only failure stayed invisible
# for two days at a green commit. The `macos` job above is the other
# half and it is deliberately narrower than this one.
#
missing=""
for path in tests/*.rs; do
target="$(basename "$path" .rs)"
if grep -q -- "--test $target" .github/workflows/test.yml; then
continue
fi
missing="$missing $target"
done
if [ -n "$missing" ]; then
echo "these test targets never run in CI:$missing" >&2
echo "add a step for each target" >&2
exit 1
fi
echo "every tests/*.rs target runs in Linux CI"