Files
beads/.github/workflows/nightly.yml
Steve Yegge b31bddc210 Optimize test suite performance - 45% reduction in integration tests
- Add testutil.TempDirInMemory() using /dev/shm on Linux for 20-30% I/O speedup
- Update slow hash multiclone tests to use in-memory filesystem
- Convert 17 scripttest tests (~200+s) to fast CLI tests (31s) with --no-daemon
- Disable slow scripttest suite behind build tag
- Add README_TESTING.md documenting test strategy and optimizations
- Update CI to use -short flag for PR checks, full tests nightly

Results:
- TestHashIDs_* reduced from ~20s to ~11s (45% reduction)
- Scripttest suite eliminated from default runs (massive speedup)
- Total integration test time significantly reduced

Closes bd-gm7p, bd-l5gq

Amp-Thread-ID: https://ampcode.com/threads/T-c2b9434a-cd29-4725-b8e0-cbea50b36fe2
Co-authored-by: Amp <amp@ampcode.com>
2025-11-04 11:25:36 -08:00

51 lines
1.4 KiB
YAML

name: Nightly Full Tests
on:
schedule:
# Run at 2am UTC daily
- cron: '0 2 * * *'
workflow_dispatch: # Allow manual trigger
jobs:
full-test:
name: Full Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Configure Git
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
- name: Build
run: go build -v ./cmd/bd
- name: Full Test Suite (including integration tests)
run: go test -v -race -tags=integration -coverprofile=coverage.out -timeout=30m ./...
- name: Check coverage threshold
run: |
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
echo "Coverage: $COVERAGE%"
if (( $(echo "$COVERAGE < 50" | bc -l) )); then
echo "❌ Coverage is below 50% threshold"
exit 1
elif (( $(echo "$COVERAGE < 55" | bc -l) )); then
echo "⚠️ Coverage is below 55% (warning threshold)"
else
echo "✅ Coverage meets threshold"
fi
- name: Upload coverage
uses: codecov/codecov-action@v4
if: success()
with:
file: ./coverage.out
fail_ci_if_error: false