Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: run CI DB tool contract tests on macOS (#10656)

Adam Eivy49080bbaf783
diff --git a/scripts/ci-install-db-tools.sh b/scripts/ci-install-db-tools.sh
index a5374738ee..ec2e81003d 100644
--- a/scripts/ci-install-db-tools.sh
+++ b/scripts/ci-install-db-tools.sh
@@ -54,7 +54,10 @@ echo "deb [signed-by=${keyring#"$ROOT"}] https://apt.postgresql.org/pub/repos/ap
if ! download_by "$PRIMARY_BUDGET"; then
echo "⚠️ Runner mirror did not deliver packages within ${PRIMARY_BUDGET}s; switching to ${OFFICIAL_ARCHIVE}"
- mapfile -t sources < <(grep -lE "$RUNNER_MIRROR" "${ROOT}/etc/apt/sources.list" "${ROOT}/etc/apt/sources.list.d/"*.sources 2>/dev/null || true)
+ sources=()
+ while IFS= read -r source; do
+ sources+=("$source")
+ done < <(grep -lE "$RUNNER_MIRROR" "${ROOT}/etc/apt/sources.list" "${ROOT}/etc/apt/sources.list.d/"*.sources 2>/dev/null || true)
(( ${#sources[@]} > 0 )) || fail "The runner mirror was slow and no Ubuntu source names it, so there is no mirror to replace."
sudo sed -i -E "s#${RUNNER_MIRROR}#${OFFICIAL_ARCHIVE}#g" "${sources[@]}"
download_by "$TOTAL_BUDGET" ||
diff --git a/scripts/ci-install-db-tools.test.js b/scripts/ci-install-db-tools.test.js
index 50052f5e04..8b97a2e83d 100644
--- a/scripts/ci-install-db-tools.test.js
+++ b/scripts/ci-install-db-tools.test.js
@@ -39,6 +39,9 @@ function run(mirror, { primaryBudget = '1', totalBudget = '3' } = {}) {
writeFileSync(sourcesFile, RUNNER_SOURCES);
const fake = (name, body) => writeFileSync(join(bin, name), `#!/bin/bash\n${body}\n`, { mode: 0o755 });
fake('sudo', 'exec "$@"');
+ // Keep the production GNU sed invocation intact while adapting its in-place
+ // flag only inside this synthetic command fixture on macOS.
+ fake('sed', 'if [ "$(uname -s)" = Darwin ]; then exec /usr/bin/sed -i "" -E "$@"; fi\nexec /usr/bin/sed -i -E "$@"');
fake('curl', 'while [ $# -gt 0 ]; do [ "$1" = -o ] && echo key > "$2"; shift; done');
const stall = { ok: 'false', slowRunner: `grep -q azure '${sourcesFile}'`, dead: 'true' }[mirror];
fake('apt-get', `echo "apt-get $*" >> '${log}'\nif ${stall}; then exec sleep 30; fi`);