mirror of
https://github.com/temporalio/temporal.git
synced 2026-08-31 02:51:51 -07:00
## 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) -->
714 B
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",
}
}