postjevsql.git / tests / run-check.sh
1#!/usr/bin/env bash
2# The repo's whole check, as one command: every unit and integration test
3# through buck2, in the devshell that provisions the toolchains.
4#
5# Mefi Studio runs this file to verify a finished task (main.cjs
6# baseCheckForProject finds test/ or tests/run-check.sh off Windows).
7#
8# Checks in one checkout share its buck daemon, so they queue on a lock
9# rather than race each other's test executor (tests/CLAUDE.md).
10set -euo pipefail
11root=$(git -C "$(dirname "$0")" rev-parse --show-toplevel)
12cd "$root"
13mkdir -p buck-out
14exec 9>buck-out/run-check.lock
15flock 9
16# Not exec'd, and with fd 9 closed: a daemon buck starts here would otherwise
17# inherit the lock's descriptor and hold it for its whole life, so every later
18# check in this checkout waits forever (tests/CLAUDE.md).
19nix develop -c buck2 test //... 9>&-