Skip to main content

Overview

The update() method allows you to modify an existing test after it has been created.
Only name and metadata are mutable post-creation. All other fields (type, variants, strategies, uri, ground_truth_uri, data_catalog_uri, source_test_id, max_test_cases, etc.) are fixed for the lifetime of the test because they drive generation, credit accounting, and the stored test-case shape. Sending any of them in an update returns a 400.

Parameters

test_id
string
required
The ID of the test to update.
name
string
New test name. Must be a non-empty string; leading and trailing whitespace are trimmed server-side.
metadata
Any
Arbitrary JSON-serializable metadata for tracking purposes. Replaces the existing metadata wholesale. Pass None to clear.

Returns

Returns the updated Test object.

Example

renamed = galtea.tests.update(
    test_id=test.id,
    name=f"renamed-test-{run_identifier}",
)

Use Cases

Replacing Metadata

Overwrite the metadata object on an existing test:
with_new_metadata = galtea.tests.update(
    test_id=test.id,
    metadata={"owner": "platform-team", "ticket": "QA-200", "priority": "high"},
)

Updating Name and Metadata Together

updated = galtea.tests.update(
    test_id=test.id,
    name=f"final-test-{run_identifier}",
    metadata={"owner": "platform-team", "archived": True},
)

Notes

All fields except test_id default to PydanticUndefined (from pydantic_core). Omit a field (or pass PydanticUndefined) to leave it unchanged. Pass None to explicitly clear an optional field. Pass a value to update it.