From 2c2cbe07f5e10fdb996e2a039cde84be44866f18 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 21 Feb 2026 16:13:40 +0200 Subject: 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 --- integrationtests/parse.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 integrationtests/parse.go (limited to 'integrationtests/parse.go') 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 +} -- cgit v1.2.3