Files
temporal/docs/development/testing.md
Stephan Behnke 80ec9635f0 Testing docs (#6005)
## What changed?
<!-- Describe what has changed in this PR -->

Create new `testing.md` with test-specific developer guidance.

It's still very short, happy to add anything else now if there is any -
or just grow it over time.

## Why?
<!-- Tell your future self why have you made these changes -->

To document testing patterns and agreements.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
2024-05-29 10:25:12 -07:00

714 B

Testing

This document describes the project's testing utilities and best practices.

Test helpers

Test helpers can be found in the common/testing package.

testvars helper

Instead of creating identifiers like task queue name, namespace or worker identity by hand, use the testvars package.

Example:

func TestFoo(t *testing.T) {
    tv := testvars.New(t)

    req := &workflowservice.SignalWithStartWorkflowExecutionRequest{
        RequestId:    uuid.New(),
        Namespace:    tv.NamespaceName().String(),
        WorkflowId:   tv.WorkflowID(),
        WorkflowType: tv.WorkflowType(),
        TaskQueue:    tv.TaskQueue(),
        SignalName:   "foo",
    }
}