Skip to content

Commit 07b7341

Browse files
authored
Merge pull request #25 from levelcodeai/fix/ci-gate-all-extension-tests
fix(ci): gate every extension's tests, not just levelcode-ai
2 parents ba941c1 + d994b2a commit 07b7341

1 file changed

Lines changed: 23 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,30 @@ jobs:
2929
with:
3030
node-version: "24"
3131
- name: Extension unit tests
32+
# `shopt` is a bash builtin, so pin the shell instead of relying on the runner default (bash on
33+
# Linux/macOS, but pwsh on Windows — where this step would break if the job were ever copied).
34+
# Explicit `shell: bash` also upgrades the default `bash -e` to
35+
# `bash --noprofile --norc -eo pipefail`, so a stray profile file can't perturb the gate either.
36+
shell: bash
37+
# DISCOVERS suites — it used to `cd extensions/levelcode-ai`, so levelcode-updater's tests never
38+
# ran here, including the one guarding the updater's Download button against serving a raw
39+
# .app.zip. Globbing every extension means a new suite is gated the moment it is added, with no
40+
# list here to keep in sync. Requires are file-relative, so running from the repo root is fine.
3241
run: |
33-
cd extensions/levelcode-ai
34-
for t in test/*.test.js; do node "$t"; done
42+
shopt -s nullglob
43+
count=0
44+
for t in extensions/*/test/*.test.js; do
45+
echo "── $t"
46+
node "$t" # `-e` (from `shell: bash` above) aborts the job on the first failure
47+
count=$((count + 1))
48+
done
49+
# A zero-match glob would otherwise report success and gate nothing — the exact failure this
50+
# step is fixing. Fail loudly instead.
51+
if [ "$count" -eq 0 ]; then
52+
echo "::error::No suites matched extensions/*/test/*.test.js — the gate would pass vacuously."
53+
exit 1
54+
fi
55+
echo "──────── $count test files passed ────────"
3556
3657
build:
3758
name: Build ${{ matrix.arch }}

0 commit comments

Comments
 (0)