Diffinery

codician/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

CI: unit tests in two shards; end-to-end in three (#76)

The first main sync with everything in (a84e06b) went from push to green in
9 min 59 s. Two paths now set that time: CI, Deploy and the live test (567 s),
and the end-to-end suite (529 s), whose second shard grew to 433 s of tests
with the agent review and task suites. The agent suites (agentic, review,
tasks) get their own shard, and the unit tests run as two vitest shards, since
they were the longer of CI's two jobs (179 s).


Claude-Session: https://claude.ai/code/session_01Ruyx3Qr4jYrZEpPi466deb

Co-authored-by: Claude <noreply@anthropic.com>
Canberk Demirci authored · GitHub committed signed1 parent d305aa2commit fcbd993fe1540d348113fd1c63286258f2cbc281Browse files
2 files changed+17−3
modified.github/workflows/ci.yml+7−2View file
@@ -39,9 +39,14 @@
3939 run: pnpm exec wrangler deploy --dry-run --env dev --outdir dist
4040
4141 test:
42- name: Unit tests
42+ name: Unit tests (${{ matrix.shard }}/2)
4343 runs-on: ubuntu-latest
4444 timeout-minutes: 20
45+ # Two halves of every package's test files, side by side: CI is the first step of a deploy.
46+ strategy:
47+ fail-fast: false
48+ matrix:
49+ shard: [1, 2]
4550 steps:
4651 - uses: actions/checkout@v4
4752 - uses: pnpm/action-setup@v4
@@ -53,4 +58,4 @@
5358 - name: Build
5459 run: pnpm -r --if-present build
5560 - name: Unit tests
56- run: pnpm -r --if-present test
61+ run: pnpm -r --if-present run test --shard=${{ matrix.shard }}/2
modified.github/workflows/e2e.yml+10−1View file
@@ -26,6 +26,8 @@
2626 include:
2727 - name: git, PRs, Actions
2828 shard: core
29+ - name: agent reviews, tasks, Today
30+ shard: agents
2931 - name: passkeys, registry, email, security
3032 shard: rest
3133 steps:
@@ -42,6 +44,13 @@
4244 - name: Run the shard's tests
4345 working-directory: apps/diffinery
4446 run: |
45- if [ "${{ matrix.shard }}" = core ]; then files=test/e2e/e2e.test.mjs; else files=$(ls test/e2e/*.test.mjs | grep -v '/e2e\.test\.mjs$'); fi
47+ # Shards of similar length; a new test file runs in "rest" unless it's added to another.
48+ core='/e2e\.test\.mjs$'
49+ agents='/(agentic|review|tasks)\.test\.mjs$'
50+ case "${{ matrix.shard }}" in
51+ core) files=$(ls test/e2e/*.test.mjs | grep -E "$core") ;;
52+ agents) files=$(ls test/e2e/*.test.mjs | grep -E "$agents") ;;
53+ *) files=$(ls test/e2e/*.test.mjs | grep -vE "$core|$agents") ;;
54+ esac
4655 echo "$files"
4756 node --test --test-concurrency=1 --test-timeout=600000 $files