Skip to content

test(e2e): add end-to-end payload decoder coverage#3321

Merged
rossedfort merged 5 commits intomainfrom
add-payload-coverage-workflow-and-tests
Apr 21, 2026
Merged

test(e2e): add end-to-end payload decoder coverage#3321
rossedfort merged 5 commits intomainfrom
add-payload-coverage-workflow-and-tests

Conversation

@rossedfort
Copy link
Copy Markdown
Contributor

Description & motivation 💭

Adds a payload-coverage-workflow that exercises every Temporal payload touchpoint — workflow input/output, memo, search attributes, activity input/output, activity failure, child workflow, signals, and queries — with all payloads AES-GCM encrypted via the codec server.

Uses this workflow as the foundation for a new e2e test suite (payload-decoder.desktop.spec.ts) that verifies the UI correctly decodes payloads at every touchpoint when the codec endpoint is configured.

What changed

Temporal infrastructure (temporal/)

  • Adds payload-coverage-workflow with activities, child workflows, signals (add-data), and queries (get-status, get-field)
  • Replaces payload-codec.ts with a full encryption-codec.ts implementing AES-GCM encrypt/decrypt
  • Adds crypto.ts for key generation and data-converter.ts wiring
  • Extends codec-server.ts with encryption support and client.ts with startPayloadCoverageWorkflow

E2e tests (tests/)

  • global-setup.ts: starts payload-coverage-workflow fire-and-forget so the workflow stays running during tests (enabling signal/query interactions)
  • payload-decoder.desktop.spec.ts: 11 tests covering workflow input, memo, search attributes, 5 event history event types, 2 query types, signal sending + history verification, and call stack
  • 4 new page object classes: WorkflowDetailPage, EventHistoryPage, WorkflowQueryPage, SignalModalPage

Screenshots (if applicable) 📸

Design Considerations 🎨

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

Start payload-coverage-workflow fire-and-forget in global setup so the
workflow remains running when tests execute, enabling signal and query
interaction.

Add payload-decoder.desktop.spec.ts covering:
- Workflow input decoded via cluster codec
- Memo payloads decoded
- Search attributes decoded
- Event history: WorkflowExecutionStarted, ActivityTaskScheduled,
  ActivityTaskCompleted, ActivityTaskFailed, StartChildWorkflowExecutionInitiated,
  ChildWorkflowExecutionCompleted
- Query results (get-status, get-field)
- Send signal and verify decoded payload in history
- Call stack stack trace

Use getByRole('textbox') within event-summary-row-expanded to access
CodeMirror contentDOM directly, matching the pattern used by existing
query and call-stack tests.
Add four page classes to encapsulate e2e test interactions:
- WorkflowDetailPage: tab navigation and input/result/main locators
- EventHistoryPage: feed toggle, event row expansion, and editor access
- WorkflowQueryPage: query type selection, arg input, and result
- SignalModalPage: signal modal open, signal selection, payload fill and submit

Refactor payload-decoder.desktop.spec.ts to use these classes, removing
all raw page.getByTestId/getByRole calls from the test body. Also upgrades
@temporalio/* packages from 1.15.0 to 1.16.0.
@rossedfort rossedfort requested a review from a team as a code owner April 17, 2026 19:34
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview, Comment Apr 17, 2026 8:15pm

Request Review

@temporal-cicd
Copy link
Copy Markdown
Contributor

temporal-cicd Bot commented Apr 17, 2026

Warnings
⚠️

📊 Strict Mode: 10 errors in 2 files (1.0% of 1048 total)

src/lib/pages/workflow-query.svelte (9)
  • L49:5: Type 'string | undefined' is not assignable to type 'string'.
  • L58:32: 'a.name' is possibly 'undefined'.
  • L59:32: 'b.name' is possibly 'undefined'.
  • L64:13: 'a.name' is possibly 'undefined'.
  • L64:34: No overload matches this call.
  • L96:6: Type 'Promise | Promise<IPayload[]>' is not assignable to type 'Promise'.
  • L113:6: Type '{ payloads: IPayloads; } | null' is not assignable to type 'IPayloads | undefined'.
  • L155:12: Type '"retry" | null' is not assignable to type '"action" | "activity" | "add-square" | "add" | "apple" | "archives" | "arrow-down" | "arrow-left" | "arrow-up" | "arrow-right" | "ascending" | "astronaut" | "batch-operation" | ... 140 more ... | undefined'.
  • L183:12: Type 'false | "opacity-50"' is not assignable to type 'string | undefined'.
utilities/temporal-server.ts (1)
  • L144:33: Property 'open' does not exist on type 'false | ReturnObject'.

Generated by 🚫 dangerJS against 2efa7ac

@Alex-Tideman
Copy link
Copy Markdown
Collaborator

Definitely don't need to add to this PR, but would be nice to also cover Updates, Nexus Operations, Schedules, SAAs, Start Workflows

Comment thread utilities/temporal-server.ts Outdated

const temporal = $`${cliPath} server start-dev ${flags}`.quiet();

await $`${cliPath} operator search-attribute create --name CustomKeywordField --type Keyword --name CustomIntField --type Int`;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do you need to pass in a namespace?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nope, it just adds them to the default namespace. For some reason this was causing a failure in CI so I had to inline it with the main temporal server start-dev command above

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, maybe it was failing because I didn't supply a namespace. Either way, should be fixed now.

@rossedfort rossedfort merged commit ca90492 into main Apr 21, 2026
24 checks passed
@rossedfort rossedfort deleted the add-payload-coverage-workflow-and-tests branch April 21, 2026 16:27
rossedfort added a commit that referenced this pull request Apr 22, 2026
Auto-generated version bump from 2.48.4 to 2.49.0

Bump type: minor

Changes included:
- [`9146199f`](9146199) fix: ref main in reusable PR review workflows (#3326)
- [`ca904926`](ca90492) test(e2e): add end-to-end payload decoder coverage (#3321)
- [`4e32d230`](4e32d23) chore: add setup-worktree skill (#3278)
- [`a789fbdb`](a789fbd) Fix decoding payloads for user metadata (#3328)
- [`21f2d448`](21f2d44) ci: remove unused Set up Protoc step from workflows (#3323)
- [`39c41d25`](39c41d2) fix(ui): guard getApiOrigin against undefined VITE_API (#3332)
- [`627cbb1b`](627cbb1) feat: add showInstancesLink prop to deployment header (#3331)
- [`0726c65e`](0726c65) Check certFile modification time instead of keyFile (#3178)
- [`8c79931b`](8c79931) feat(DT-3887): remove Dispatch Rate Epsilon from compute scaling UI (#3334)

Co-authored-by: rossedfort <11775628+rossedfort@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants