Skip to content

Commit 73e8930

Browse files
committed
test(cli): measure cold and warm checks on each OS
1 parent 4d3ca25 commit 73e8930

2 files changed

Lines changed: 80 additions & 0 deletions

File tree

‎.github/checkfast/measure.sh‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Cold vs warm `check` through the real bin, 6 fixtures; then the warm process tests (orphan proofs) on this OS.
2+
set -u
3+
OUT=checkfast-out; mkdir -p $OUT/runs
4+
BIN="node packages/cli/bin/hyperframes.mjs"
5+
$BIN browser ensure > /dev/null 2>&1
6+
FX="packages/producer/tests/fast-capture-gsap/src packages/producer/tests/chat/src registry/examples/decision-tree registry/examples/product-promo packages/producer/tests/heygen-promo-preview-assets/src registry/examples/kinetic-type"
7+
W=$RUNNER_TEMP/cf-fx; mkdir -p $W
8+
ms() { node -e 'console.log(Date.now())'; }
9+
for src in $FX; do
10+
fx=$(basename $src); [ $fx = src ] && fx=$(basename $(dirname $src))
11+
D=$W/$fx; cp -r $src $D
12+
CI= $BIN check $D --json > /dev/null 2>&1 # first run: compile cache, proxy cache, spawns the warm process
13+
for i in 1 2 3; do
14+
s=$(ms); CI=1 $BIN check $D --json > $OUT/runs/$fx-cold$i.json 2>/dev/null; e=$(ms); echo "$fx cold$i $((e-s))" | tee -a $OUT/summary.txt
15+
CI= $BIN check $D --json > /dev/null 2>&1; sleep 3 # leaves a ready warm process behind
16+
s=$(ms); CI= $BIN check $D --json > $OUT/runs/$fx-warm$i.json 2>/dev/null; e=$(ms); echo "$fx warm$i $((e-s))" | tee -a $OUT/summary.txt
17+
sleep 3
18+
done
19+
done
20+
if [ "$RUNNER_OS" != "Windows" ]; then
21+
Z=$(pgrep -f dist/warmCheck.js | head -1)
22+
if [ -n "$Z" ]; then
23+
ps -A -o pid=,ppid=,rss= | awk -v r=$Z '{p[$1]=$2; m[$1]=$3} END {for (k in p) {x=k; while (x>1 && x!=r) x=p[x]; if (x==r) t+=m[k]} print "idle warm process tree RSS MB: " int(t/1024)}' | tee -a $OUT/summary.txt
24+
fi
25+
fi
26+
cd packages/cli && npx vitest run src/warmCheck.process.test.ts --maxWorkers=1 2>&1 | tee ../../$OUT/warm-tests.txt | grep -E "✓|×|Tests "
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: checkfast warm measure
2+
on:
3+
push:
4+
branches: [checkfast/instant-measure]
5+
permissions:
6+
contents: read
7+
jobs:
8+
measure:
9+
name: warm check ${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}
11+
timeout-minutes: 60
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
env:
17+
HYPERFRAMES_NO_TELEMETRY: "1"
18+
DO_NOT_TRACK: "1"
19+
HYPERFRAMES_SKIP_SKILLS: "1"
20+
steps:
21+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
22+
with:
23+
lfs: true
24+
- name: Install FFmpeg (Windows)
25+
if: runner.os == 'Windows'
26+
uses: ./.github/actions/install-ffmpeg-windows
27+
- name: Set FFMPEG_BIN for bun install
28+
if: runner.os == 'Windows'
29+
shell: pwsh
30+
run: |
31+
$path = (Get-Command ffmpeg.exe).Source
32+
"FFMPEG_BIN=$path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
33+
- name: Install FFmpeg (Linux)
34+
if: runner.os == 'Linux'
35+
run: sudo apt-get update -qq && sudo apt-get install -y -qq ffmpeg
36+
- name: Install FFmpeg (macOS)
37+
if: runner.os == 'macOS'
38+
run: brew install ffmpeg
39+
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
40+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
41+
with:
42+
node-version: 24
43+
- run: bun install --frozen-lockfile
44+
- name: Build
45+
shell: bash
46+
run: bun run build
47+
- name: Measure cold vs warm, then the warm process tests
48+
shell: bash
49+
run: bash .github/checkfast/measure.sh
50+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
51+
if: always()
52+
with:
53+
name: checkfast-measure-${{ matrix.os }}
54+
path: checkfast-out

0 commit comments

Comments
 (0)