You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(worker): exercise Temporal workflows and gate saved-history replay - #105
The mocked workflow tests do not exercise Temporal signal ordering, durable timers, child cancellation, or replay compatibility. This adds 27 tests using real time-skipping servers and the eight production workflow implementations, plus 26 synthetic recorded histories replayed against the current bundle. A deliberately incompatible dummy workflow must fail with DeterminismViolationError.
Coverage includes activity retries and failures, dot wake/timeout and continue-as-new, memory maintenance/consolidation/mutation, current and pre-patch supervisors, signal races, active-child cancellation, 50-turn and 250-poll continuation, and bounded carried queues. A guarded test-only loader records the actual legacy branch; replay always uses unmodified current source. Production workflow behavior is unchanged.
The fixture README documents recording and retaining historical evidence; CI never regenerates fixtures. A dedicated Ubuntu job enforces a 180-second limit on the new suite and also runs existing worker tests. Existing worker/public test commands include the suite.
Green Ubuntu 24.04 / Node 22.23.0 CI run: all 27 new tests passed in 52.36 seconds, including cold test-server startup, recorded-history replay and the negative determinism control.
All 215 existing worker tests passed separately in 12.38 seconds on the same runner. Worker dependency builds and typecheck passed.
Windows / Node 22.23.3: all 27 new tests and strict TypeScript checking of the tests passed. Full worker run had 231 passes and 11 existing failures; excluding the new suite reproduced the same 11 failures. Those failures did not occur on Ubuntu.
Repository-wide check/test/build have not been validated on Linux by this contribution's focused job. Local Windows root checks encounter CRLF document comparison, POSIX assumptions and gateway absolute-entry-point handling; a full repository pass is not claimed.
AI assistance: Codex implemented, inspected, and executed the tests. The submitting person has reviewed the contribution and confirmed it should be marked ready for review.
Summary by CodeRabbit
Tests
Added automated checks that replay saved workflow histories and verify workflow behavior across retries, failures, signals, cancellations, and long-running processes.
Added coverage for detecting incompatible workflow changes.
Chores
Added a pull request and push workflow to run worker checks automatically.
Documentation
Added guidance for recording and replaying workflow histories.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
📝 Walkthrough
The pull request adds Temporal workflow tests for worker workflows, saved history fixtures, history recording and replay support, and a dedicated GitHub Actions workflow.
Changes: Temporal workflow testing
Layer / File(s)
Summary
Test harness and workflow registration apps/worker/package.json, apps/worker/tests/temporal/{harness.ts,workflows.ts,historical-workflow-loader.cjs}
Adds a test harness that bundles current and legacy workflows, runs workers and scenarios, and optionally saves sanitized histories. The test worker re-exports production workflows.
Turn, goal, and action workflows apps/worker/tests/temporal-workflows.test.ts, apps/worker/tests/fixtures/workflow-histories/{dot-*,dummy-turn-retry.json,turn-*,action-failure-patch.json}
Adds tests and saved histories for turn retries and failures, dot-goal signals and timeouts, and background-action failure handling.
Adds tests and saved histories for supervisor queueing, stop and follow-up signals, continuation preparation, legacy settling, and continue-as-new behavior.
History recording, replay, and CI apps/worker/package.json, apps/worker/tests/temporal/{record-histories.mjs,incompatible-workflows.ts}, apps/worker/tests/temporal-workflows.test.ts, apps/worker/tests/fixtures/workflow-histories/README.md, .github/workflows/temporal-workflows.yml
Adds a history-recording command, replay and incompatibility tests, fixture documentation, and a CI workflow that runs Temporal tests and remaining worker tests.
This change adds Temporal workflow tests, saved-history replay checks, and a CI job without changing production workflow code. It poses no merge risk to runtime behavior.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 7 files. (25 skipped: …
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main changes: adding Temporal workflow tests and enforcing saved-history replay in CI.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 7 files. (25 skipped: 25 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Fix all pre-merge checks with AI
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #60.
The mocked workflow tests do not exercise Temporal signal ordering, durable timers, child cancellation, or replay compatibility. This adds 27 tests using real time-skipping servers and the eight production workflow implementations, plus 26 synthetic recorded histories replayed against the current bundle. A deliberately incompatible dummy workflow must fail with DeterminismViolationError.
Coverage includes activity retries and failures, dot wake/timeout and continue-as-new, memory maintenance/consolidation/mutation, current and pre-patch supervisors, signal races, active-child cancellation, 50-turn and 250-poll continuation, and bounded carried queues. A guarded test-only loader records the actual legacy branch; replay always uses unmodified current source. Production workflow behavior is unchanged.
The fixture README documents recording and retaining historical evidence; CI never regenerates fixtures. A dedicated Ubuntu job enforces a 180-second limit on the new suite and also runs existing worker tests. Existing worker/public test commands include the suite.
Validation at babb6c5:
AI assistance: Codex implemented, inspected, and executed the tests. The submitting person has reviewed the contribution and confirmed it should be marked ready for review.
Summary by CodeRabbit