summaryrefslogtreecommitdiff
path: root/integrationtests/parse.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-21 16:13:40 +0200
committerPaul Buetow <paul@buetow.org>2026-02-21 16:13:40 +0200
commit2c2cbe07f5e10fdb996e2a039cde84be44866f18 (patch)
tree97654c2c9ba9fc91cb569ab0521c4c67247abc0b /integrationtests/parse.go
parenteebc9cba272c1b20296ab998262298c5da99e047 (diff)
Add integration test framework: plan, workload binary, harness scaffolding
- INTEGRATIONTESTS-PLAN.md: full design for e2e integration tests - integrationtests/cmd/ioworkload: standalone binary with 13 I/O scenarios - integrationtests/expectations.go: ExpectedEvent type and assertion helpers - integrationtests/parse.go: .ior.zst parser producing TestResult - Export IterRecord and LoadFromFile in flamegraph package - Fix TraceId -> TraceID, StringByName returns error instead of panic Amp-Thread-ID: https://ampcode.com/threads/T-019c8031-c106-757a-95a0-7a5457163ce7 Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'integrationtests/parse.go')
-rw-r--r--integrationtests/parse.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/integrationtests/parse.go b/integrationtests/parse.go
new file mode 100644
index 0000000..cebb0ba
--- /dev/null
+++ b/integrationtests/parse.go
@@ -0,0 +1,25 @@
+package integrationtests
+
+import (
+ "fmt"
+ "ior/internal/flamegraph"
+)
+
+// TestResult holds all captured I/O records from a single ior run.
+type TestResult struct {
+ Records []flamegraph.IterRecord
+}
+
+// LoadTestResult parses an .ior.zst file into a TestResult.
+func LoadTestResult(iorZstFile string) (TestResult, error) {
+ iter, err := flamegraph.LoadFromFile(iorZstFile)
+ if err != nil {
+ return TestResult{}, fmt.Errorf("load test result: %w", err)
+ }
+
+ var result TestResult
+ for record := range iter {
+ result.Records = append(result.Records, record)
+ }
+ return result, nil
+}