OUT-4025: L1.0 — test-only Trigger SDK double (inline task graph) - #124
Open
SandipBajracharya wants to merge 2 commits into
Open
OUT-4025: L1.0 — test-only Trigger SDK double (inline task graph)#124SandipBajracharya wants to merge 2 commits into
SandipBajracharya wants to merge 2 commits into
Conversation
Test-only double of @trigger.dev/sdk: trigger/triggerAndWait/batchTrigger/ batchTriggerAndWait invoke each task's own run() inline, in-process. Matches the real error contract - *AndWait resolve a TaskRunResult (never reject), trigger/batchTrigger are fire-and-forget, batches run every item. No-op logger and stub ApiError. 13 unit cases cover the mechanics. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
vi.mock both SDK specifiers (@trigger.dev/sdk/v3 for tasks, base @trigger.dev/sdk for withErrorLogger) so integration tests run the real task graph in-process. Smoke test drives a real exported task (processDropboxChanges) inline against Postgres. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThe PR adds a test-only Trigger SDK double that executes the repository’s task graph inline during integration tests without requiring a Trigger development server.
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issue identified. The global mock covers every Trigger SDK export currently loaded by integration tests, and the observed timing and error-handling differences are deliberate parts of the documented test-harness contract. Important Files Changed
Sequence DiagramsequenceDiagram
participant Test as Integration test
participant Mock as Inline SDK double
participant Task as Real task run()
participant Child as Child task run()
Test->>Mock: triggerAndWait(payload)
Mock->>Task: run(payload)
Task->>Mock: child triggerAndWait(payload)
Mock->>Child: run(payload)
Child-->>Mock: output or error
Mock-->>Task: TaskRunResult
Task-->>Mock: output or error
Mock-->>Test: TaskRunResult
Reviews (1): Last reviewed commit: "test(OUT-4025): wire inline Trigger SDK ..." | Re-trigger Greptile |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What & why
L1.0 — the prerequisite for the L1 flow tests. A test-only double of
@trigger.dev/sdkso that in integration tests, everytrigger/triggerAndWait/batchTrigger/batchTriggerAndWaitinvokes each task's ownrun()inline, in-process. This lets the upcoming L1 tests drive the real task graph (no Trigger dev server) with zero production change.This PR is harness only — it does not test real sync behavior (that's L1.1–L1.4).
Changes (all under
test/**)test/trigger/inlineSdk.ts— the double:task,schedules,logger,ApiErrortest/trigger/index.ts— barreltest/trigger/inlineSdk.test.ts— 13 unit mechanics teststest/trigger/inlineSdk.integration.test.ts— 2 integration smoke tests (drives a real task inline)test/integration/setup.ts—vi.mockboth SDK specifiers (@trigger.dev/sdk/v3for tasks, base@trigger.dev/sdkforwithErrorLogger)Behavior notes
*AndWaitresolve aTaskRunResult({ok:true/false}) on a run failure — never reject;trigger/batchTriggerare fire-and-forget; batches run every item.Testing
pnpm typecheck✅pnpm lint✅pnpm test— 177/177 ✅pnpm test:integration— 40/40 ✅🤖 Generated with Claude Code