Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
apps/worker/tests/fixtures/workflow-histories/*.json linguist-generated=true -diff
apps/worker/tests/fixtures/workflow-histories/*.json text eol=lf
39 changes: 39 additions & 0 deletions .github/workflows/temporal-replay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Temporal replay compatibility

on:
pull_request:
push:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: temporal-replay-${{ github.ref }}
cancel-in-progress: true

jobs:
temporal-replay:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci --no-audit --no-fund
- name: Build workspace dependencies and typecheck
run: npm run check
- name: Run worker suite within three minutes
shell: bash
run: |
started=$SECONDS
npm test -w @space/worker
elapsed=$((SECONDS - started))
echo "Worker suite: ${elapsed}s" >> "$GITHUB_STEP_SUMMARY"
test "$elapsed" -lt 180
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,20 @@ check also refuse to run on `main`.
Opt-in database and authenticated provider proofs require separate isolated
fixtures; skipped proofs are not passing evidence.

## Temporal workflow tests and replay histories

`npm test -w @space/worker` runs workflow integration tests against Temporal's
time-skipping test server with synthetic activities. The tests do not connect
to application services. Checked-in fixtures in
`apps/worker/tests/fixtures/workflow-histories/` are replayed against the real
workflow bundle on every worker test run.

Re-record fixtures with `npm run temporal:record-histories -w @space/worker`
only when a deliberate `patched()` workflow change requires new history
coverage. Review the JSON histories and include them with that patch. Never
re-record merely to silence a replay failure; investigate and preserve the
existing history first.

In the maintainers' source repository, `npm run check:claims` compares the
version, licence, Node requirement, runtime list and key constants stated in
the README and `docs/` with the code, and rejects unqualified latency or
Expand Down
5 changes: 4 additions & 1 deletion apps/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"start": "node dist/worker.js",
"build": "tsc -p tsconfig.json",
"check": "tsc -p tsconfig.json --noEmit",
"test": "vitest run"
"test": "vitest run",
"temporal:record-histories": "node tests/record-temporal-histories.mjs"
},
"dependencies": {
"@space/codex-app-server": "0.2.5",
Expand All @@ -26,6 +27,8 @@
"undici": "8.10.2"
},
"devDependencies": {
"@temporalio/proto": "1.24.0",
"@temporalio/testing": "1.24.0",
"typescript": "^5.9.3",
"vitest": "^4.1.11"
},
Expand Down
Loading