You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add pre-compare transforms for non-deterministic test output
Introduces a `pre-compare` frontmatter option that normalizes test output
before comparison, allowing tests with non-deterministic ordering to pass
reliably.
Usage in TQL/shell/Python tests:
---
pre-compare: [sort]
---
Or in test.yaml for directory-level configuration:
pre-compare: [sort]
The initial transform is `sort`, which sorts output lines lexicographically.
Transforms apply only at comparison time - baselines store original output.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
title: Add pre-compare transforms for non-deterministic output
3
+
type: feature
4
+
authors:
5
+
- mavam
6
+
- claude
7
+
created: 2026-01-30T20:46:00.000000Z
8
+
---
9
+
10
+
The test framework now supports pre-compare transforms that normalize output before comparison with baselines. This helps handle tests with non-deterministic output like unordered result sets from hash-based aggregations or parallel operations.
11
+
12
+
Configure the `pre-compare` option in `test.yaml` or per-test frontmatter to apply transforms to both actual output and baselines before comparison:
13
+
14
+
```yaml
15
+
# Sort output lines for comparison (baseline stays unchanged)
16
+
pre-compare: sort
17
+
```
18
+
19
+
The `sort` transform sorts output lines lexicographically, making it easy to handle unordered results. Transforms only affect comparison—baseline files remain untransformed on disk, and `--update` continues to store original output.
0 commit comments