Skip to main content

Testing - Ruby SDK

This page shows how to do the following:

The Ruby test-suite feature guide describes the frameworks that facilitate Workflow and integration testing.

Types of Tests

In the context of Temporal, you can create these types of automated tests:

  • End-to-end: Running a Temporal Server and Worker with all its Workflows and Activities; starting and interacting with Workflows from a Client.
  • Integration: Anything between end-to-end and unit testing.
    • Running Activities with mocked Context and other SDK imports (and usually network requests).
    • Running Workers with mock Activities, and using a Client to start Workflows.
    • Running Workflows with mocked SDK imports.
  • Unit: Running a piece of Workflow or Activity code and mocking any code it calls.

We generally recommend writing the majority of your tests as integration tests.

Because the test server supports skipping time, use the test server for both end-to-end and integration tests with Workers.

Test frameworks

Compatible testing frameworks

Testing Workflows

Testing Workflows with standard server

Testing Workflows with time skipping

Automatic time skipping

Manual time skipping

Mocking Activities

Testing Activities

Replay test