Skip to content

Conversation

@pombosilva
Copy link
Contributor

@pombosilva pombosilva commented Dec 15, 2025

Fixes WOR-1059.

Introduces two new test handlers to workflow instances in vitest-pool-workers:

  • getOuput(): retrieves the output of a successful instance
  • getError(): retrieves the error info of a failed instance

I decided to introduce these as two separate functions rather than having one single function like getResult so tests end up more readable, and to not confuse between outputs that might have the same error structure ({name: string, message: string})

These are intended to be used after the workflow instance has reached either a complete or errored state, thus should be called after a waitForStatus({status: <status>}).


A picture of a cute animal (not mandatory, but encouraged)
Meet Kiara, my cousin's dog. She loves to snore.
image

@changeset-bot
Copy link

changeset-bot bot commented Dec 15, 2025

🦋 Changeset detected

Latest commit: a5dd99d

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Dec 15, 2025
@pombosilva pombosilva force-pushed the osilva/add-workflows-result-testing-utils branch 2 times, most recently from b10a473 to 4d03906 Compare December 16, 2025 10:27
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 16, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@11648

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@11648

miniflare

npm i https://pkg.pr.new/miniflare@11648

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@11648

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@11648

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@11648

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@11648

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@11648

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@11648

wrangler

npm i https://pkg.pr.new/wrangler@11648

commit: a5dd99d

@pombosilva pombosilva force-pushed the osilva/add-workflows-result-testing-utils branch from 4d03906 to 14d7720 Compare December 16, 2025 11:39
@pombosilva pombosilva marked this pull request as ready for review December 16, 2025 11:39
@pombosilva pombosilva requested review from a team as code owners December 16, 2025 11:39
@claude
Copy link
Contributor

claude bot commented Dec 16, 2025

Claude finished @pombosilva's task —— View job


Changeset Review

Reviewing changeset files...

  • Read changeset guidelines
  • Review .changeset/wicked-cities-attend.md
  • Validate version type, changelog quality, and markdown headers
  • Check out the cute dog

All changesets look good

The changeset follows all guidelines:

  • Version Type: Correctly uses minor for all three packages (new feature: getOutput() and getError() methods)
  • Changelog Quality: Clear title and body with practical code examples showing how to use the new handlers
  • Markdown Headers: No h1/h2/h3 headers used (only regular text and code blocks)

Cuteness Report: This is Kiara. She's living her best life on the grass doing a full-body smile with her tongue out. Absolute queen of relaxation. Champion snorer according to reports. 14/10 would give all the pets.

@pombosilva pombosilva force-pushed the osilva/add-workflows-result-testing-utils branch 2 times, most recently from b28e84f to 58ec74c Compare December 18, 2025 13:34
@pombosilva pombosilva force-pushed the osilva/add-workflows-result-testing-utils branch 2 times, most recently from d70d9a9 to 93028fc Compare December 18, 2025 13:40
Copy link
Member

@edmundhung edmundhung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me overall. But please get a review from your team too (Update: I missed the reivew above 😅 ) :)

@pombosilva pombosilva force-pushed the osilva/add-workflows-result-testing-utils branch 2 times, most recently from d4d6059 to d2ba6d8 Compare December 19, 2025 15:55
@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Dec 19, 2025
@pombosilva pombosilva force-pushed the osilva/add-workflows-result-testing-utils branch from d2ba6d8 to 23c29ca Compare December 22, 2025 12:14
@pombosilva pombosilva force-pushed the osilva/add-workflows-result-testing-utils branch from 23c29ca to a5dd99d Compare December 23, 2025 09:30
@petebacondarwin petebacondarwin merged commit eac5cf7 into main Dec 23, 2025
38 of 39 checks passed
@petebacondarwin petebacondarwin deleted the osilva/add-workflows-result-testing-utils branch December 23, 2025 12:22
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Dec 23, 2025
AmirSa12 pushed a commit to AmirSa12/workers-sdk that referenced this pull request Jan 5, 2026
…of a workflow instance (cloudflare#11648)

* [Workflows/vitest-pool-workers] Add Workflows result testing utils

* [Workflows/vitest-pool-workers] Add a test handler to get the result of a workflow instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants