Skip to main content
Speckle Automate supports robust testing for your functions through local testing setups and test automations—sandbox environments designed to validate your function’s business logic and results against real project data.

What Are Test Automations?

Test automations provide a safe, sandboxed environment for function authors to:
  1. Test how a function’s business logic interacts with Speckle project data.
  2. Validate that the function produces the desired results.
Unlike regular automations, test automations:
  • Are not triggered by project data changes.
  • Cannot be manually triggered via the UI.
  • Do not execute published functions directly, but allow you to run your function locally while connecting to Speckle data.

How to Create a Test Automation

Test automations are created from the project’s Settings → Automations page, like any other automation.
1

Open project Automations

Open the project, then Settings → Automations. You should see New Automation above the automations table.
2

Switch to a test automation

Select New Automation, then Create test automation. The dialog title changes to Create test automation and the function fields disappear.
3

Choose the model and name

Select the model your function should run against in Trigger model, and enter an Automation name.
4

Create the test automation

Select Create. The test automation’s page opens with a Test badge, its Connected model, and a Configuration section.
Each test run uses the latest version of the connected model, so the model needs at least one version.

How to Use Test Automations

Both the C# SDK and Python SDK include utilities for interacting with test automations. Example functions are available in both:

Required Environment Variables

To run your tests, configure the following in your environment:
  • Python: Use a .env file (example).
  • C#: Use an appsettings.json file (example).
Environment Variables:
  • SPECKLE_TOKEN: Create a Personal Access Token.
  • SPECKLE_SERVER_URL: URL of your Speckle Server, e.g., https://app.speckle.systems/.
  • SPECKLE_PROJECT_ID: The ID of your Speckle project with the test automation.
  • SPECKLE_AUTOMATION_ID: The ID of your test automation.
The project and automation IDs are in the URL of your test automation’s page: /projects/[project-id]/settings/automations/[automation-id].
The test automation’s Configuration section shows these values ready to copy. Choose Python or .NET in Language, copy the block, and replace YOUR_TOKEN_HERE with your token.

Token scopes

For local testing with the Python template, a token with five scopes is enough when your function only reads the model and reports results. Add up to four more if it writes anything back. A read-only function (receives the model, attaches results, marks success or failure) needs: If your function writes back, also add:
A read-only function that attaches a report file still needs workspace.blob.write.

Running Test Cases

  1. Set up your local environment with the required values.
  2. Run the test command (pytest, dotnet test, etc.) from your development setup.
  3. The SDK utilities will:
    • Connect to the test automation via the API.
    • Run your function locally, generating results.
    • Submit the results to the test automation for validation.
Each test run appears in the Runs table on the test automation’s page. See Viewing Automation Results for where to see the results it recorded.

Limitations

To set up a test automation, you need permission to manage the project’s automations; project owners have it. A test automation is not tied to a function, so your function does not need a release yet.

Key Notes on Test Automations

  • Test automations do not ask for function inputs during creation; inputs should be set up in your development environment.
  • Test automations are sandboxed environments designed to aid in integration testing. They do not execute functions directly within the Automate runtime.
  • Test runs allow you to debug locally while validating outcomes against Speckle project data.
For further help, see the SDK source and the example repositories linked above.
Last modified on October 19, 2026