Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/external-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,15 @@ jobs:
if: failure()
shell: bash
run: |
echo "=== fff-test.log ==="
if [ -f fff-test.log ]; then
cat fff-test.log
else
# init_tracing writes session files named fff-test+<ts>+<pid>.log
found=0
for f in fff-test*.log; do
[ -f "$f" ] || continue
found=1
echo "=== $f ==="
cat "$f"
done
if [ "$found" = 0 ]; then
echo "(no log file produced)"
fi

Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
run: cargo test --no-default-features --features zlob --workspace --exclude fff-nvim

stress-test:
name: Stress Test (Watcher + Git)
name: Fuzz Tests
runs-on: ${{ matrix.os }}
strategy:
# Keep going after one OS fails so we can see whether a bug
Expand All @@ -61,6 +61,10 @@ jobs:
# Long-running; don't let a stuck watcher thread burn a full CI
# timeout. Two scenarios should finish well under this limit.
timeout-minutes: 20
env:
FFF_STRESS_CASES: "5"
FFF_STRESS_MIN_OPS: "30"
FFF_STRESS_MAX_OPS: "60"
steps:
- uses: actions/checkout@v5

Expand All @@ -77,21 +81,17 @@ jobs:
cache-key: "v1-rust-stress-${{ matrix.os }}"
components: rustfmt, clippy

- name: Stress test (seeded / deterministic)
- name: Stress test seeded
shell: bash
run: make test-stress-seeded
env:
FFF_STRESS_CASES: "3"
FFF_STRESS_MIN_OPS: "30"
FFF_STRESS_MAX_OPS: "50"

- name: Stress test (random / fuzzy)
- name: Stress test random
shell: bash
run: make test-stress-random
env:
FFF_STRESS_CASES: "5"
FFF_STRESS_MIN_OPS: "30"
FFF_STRESS_MAX_OPS: "60"

- name: Stress test regressions
shell: bash
run: make test-stress-regressions

- name: Upload proptest regressions on failure
if: failure()
Expand Down
27 changes: 12 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,15 @@ FFF_STRESS_DEFAULT_SEED ?= 0xDEADBEEFCAFEBABE
SHELL := bash
# Order matters: `-c` must be last so bash treats the recipe as the script
# string rather than the literal `-o` / `pipefail` tokens.
.SHELLFLAGS := -o pipefail -ec
.SHELLFLAGS := -o pipefail -euc

.PHONY: build build-c-lib install uninstall test test-rust test-c-smoke test-c-api test-lua test-lua-snap test-version test-bun test-node prepare-bun prepare-bun-packaged prepare-node set-npm-version header test-stress test-stress-seeded test-stress-random test-stress-repos test-node-stress sync-js-api sync-js-api-check bump-homebrew-formula bump-install-mcp-sh test-bun-compile
.PHONY: build build-c-lib install uninstall test test-rust test-c-smoke test-c-api test-lua test-lua-snap test-version test-bun test-node prepare-bun prepare-bun-packaged prepare-node set-npm-version header test-stress test-stress-seeded test-stress-random test-stress-regressions test-stress-repos test-node-stress sync-js-api sync-js-api-check bump-homebrew-formula bump-install-mcp-sh test-bun-compile

all: format test lint

# Single source of truth for the shared FileFinder TS interface lives in
# packages/shared/fff-api.ts. tsc cannot import across a package's
# rootDir and the bun package publishes its raw src/, so the file is copied
# into each package instead of symlinked.
SYNC_API_SRC := packages/shared/fff-api.ts
SYNC_API_TARGETS := packages/fff-node/src/fff-api.ts packages/fff-bun/src/fff-api.ts
SYNC_API_BANNER := // ----------------------------------------------------------------------------\n// GENERATED FILE - DO NOT EDIT.\n// Source of truth: packages/shared/fff-api.ts\n// Run make sync-js-api from the repo root to regenerate.\n// ----------------------------------------------------------------------------\n\n
SYNC_API_BANNER := // ----------------------------------------------------------------------------\n// GENERATED FILE - DO NOT EDIT.\n// Copied from: ${SYNC_API_SRC}\n// Run make sync-js-api from the repo root to regenerate.\n// ----------------------------------------------------------------------------\n\n

sync-js-api:
@for target in $(SYNC_API_TARGETS); do \
Expand Down Expand Up @@ -128,13 +124,6 @@ test-lua: test-setup build
exit 1; \
fi

# mini.test reference_screenshot snapshots. Separate runner because mini.test
# spawns child processes and uses its own collector (incompatible with
# PlenaryBustedDirectory). Streams output live via `tee` so failure diffs
# appear as they happen instead of after a long capture-buffered silence.
# `pcall` catches collect-time errors (e.g. parse error in the test file)
# that would otherwise leave headless nvim hanging in its event loop because
# the reporter's `cquit` never fires.
test-lua-snap: test-setup build
@logfile=$$(mktemp); \
trap 'rm -f "$$logfile"' EXIT; \
Expand Down Expand Up @@ -238,6 +227,14 @@ test-stress-random:
--no-default-features --features zlob \
-- --nocapture stress_random

test-stress-regressions:
RUSTFLAGS="$(STRESS_RUSTFLAGS)" \
cargo test --release \
-p fff-search \
--test fuzz_git_watcher_stress \
--no-default-features --features zlob \
-- --nocapture stress_regression stress_merge_conflict_convergence

test-stress-repos:
RUSTFLAGS="$(STRESS_RUSTFLAGS)" \
cargo test --release \
Expand All @@ -246,7 +243,7 @@ test-stress-repos:
--no-default-features --features zlob \
-- --nocapture

test-stress: test-stress-seeded test-stress-random test-stress-repos
test-stress: test-stress-seeded test-stress-random test-stress-regressions test-stress-repos

# Update version in a package.json, including optionalDependencies.
# Usage: make set-npm-version PKG=packages/fff-bun VERSION=1.0.0-nightly.abc1234
Expand Down
Loading
Loading