detached 99293b6

test(obs): validate canonical local evidence

commit
99293b64ec44dc23f7585d4e3a7b7474041f38dd
author
brice · · 2026-07-13 01:15 UTC
parent
42b3f98
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +60 -0
M cmd/vev-perf-harness/main_test.go +60 -0
@@ -200,6 +200,66 @@ func TestHarnessCanonicalLocalSmokeRealRoles(t *testing.T) {
200200 }
201201 }
202202
203+func TestHarnessCanonicalLocalRolesAreIsolatedAcrossRepetitions(t *testing.T) {
204+ if testing.Short() {
205+ t.Skip("public CLI repetition lifecycle")
206+ }
207+ root, err := filepath.Abs(filepath.Join("..", ".."))
208+ if err != nil {
209+ t.Fatal(err)
210+ }
211+ bin := filepath.Join(t.TempDir(), "vev")
212+ build := exec.Command("/usr/local/go/bin/go", "build", "-o", bin, "./")
213+ build.Dir = root
214+ if output, err := build.CombinedOutput(); err != nil {
215+ t.Fatalf("build public CLI: %v\n%s", err, output)
216+ }
217+ m, err := readManifest(filepath.Join(root, "testdata", "perf", "manifest.json"))
218+ if err != nil {
219+ t.Fatal(err)
220+ }
221+ var local scenario
222+ for _, candidate := range m.Scenarios {
223+ if candidate.ID == "1x4-idle-local" {
224+ local = candidate
225+ break
226+ }
227+ }
228+ if local.ID == "" {
229+ t.Fatal("canonical local scenario missing")
230+ }
231+ out, err := os.MkdirTemp("", "vev-ob-")
232+ if err != nil {
233+ t.Fatal(err)
234+ }
235+ defer os.RemoveAll(out)
236+ raw, err := os.OpenFile(filepath.Join(out, "raw.jsonl"), os.O_CREATE|os.O_EXCL|os.O_WRONLY, 0o600)
237+ if err != nil {
238+ t.Fatal(err)
239+ }
240+ defer raw.Close()
241+ h := defaultHarness()
242+ h.clock = &fakeClock{}
243+ h.launcher = &cliLauncher{bin: bin}
244+ for run := 1; run <= 3; run++ {
245+ result, err := h.runOne(options{vevBin: bin, out: out, duration: minimumDuration}, m, local, run, raw)
246+ if err != nil {
247+ t.Fatalf("run %d: %v", run, err)
248+ }
249+ if len(result.Processes) != 2 {
250+ t.Fatalf("run %d process mappings = %+v", run, result.Processes)
251+ }
252+ for _, process := range result.Processes {
253+ if process.Role != "daemon" && process.Role != "client" {
254+ t.Fatalf("run %d unexpected role %q", run, process.Role)
255+ }
256+ if _, err := os.Stat(process.TracePath); err != nil {
257+ t.Fatalf("run %d %s trace %q: %v", run, process.Role, process.TracePath, err)
258+ }
259+ }
260+ }
261+}
262+
203263 func TestHarnessScenarioSelectionKeepsCanonicalManifestValidation(t *testing.T) {
204264 root, err := filepath.Abs(filepath.Join("..", ".."))
205265 if err != nil {
@@ -200,6 +200,66 @@ func TestHarnessCanonicalLocalSmokeRealRoles(t *testing.T) {
200 }200 }
201 }201 }
202 202
203+func TestHarnessCanonicalLocalRolesAreIsolatedAcrossRepetitions(t *testing.T) {
204+ if testing.Short() {
205+ t.Skip("public CLI repetition lifecycle")
206+ }
207+ root, err := filepath.Abs(filepath.Join("..", ".."))
208+ if err != nil {
209+ t.Fatal(err)
210+ }
211+ bin := filepath.Join(t.TempDir(), "vev")
212+ build := exec.Command("/usr/local/go/bin/go", "build", "-o", bin, "./")
213+ build.Dir = root
214+ if output, err := build.CombinedOutput(); err != nil {
215+ t.Fatalf("build public CLI: %v\n%s", err, output)
216+ }
217+ m, err := readManifest(filepath.Join(root, "testdata", "perf", "manifest.json"))
218+ if err != nil {
219+ t.Fatal(err)
220+ }
221+ var local scenario
222+ for _, candidate := range m.Scenarios {
223+ if candidate.ID == "1x4-idle-local" {
224+ local = candidate
225+ break
226+ }
227+ }
228+ if local.ID == "" {
229+ t.Fatal("canonical local scenario missing")
230+ }
231+ out, err := os.MkdirTemp("", "vev-ob-")
232+ if err != nil {
233+ t.Fatal(err)
234+ }
235+ defer os.RemoveAll(out)
236+ raw, err := os.OpenFile(filepath.Join(out, "raw.jsonl"), os.O_CREATE|os.O_EXCL|os.O_WRONLY, 0o600)
237+ if err != nil {
238+ t.Fatal(err)
239+ }
240+ defer raw.Close()
241+ h := defaultHarness()
242+ h.clock = &fakeClock{}
243+ h.launcher = &cliLauncher{bin: bin}
244+ for run := 1; run <= 3; run++ {
245+ result, err := h.runOne(options{vevBin: bin, out: out, duration: minimumDuration}, m, local, run, raw)
246+ if err != nil {
247+ t.Fatalf("run %d: %v", run, err)
248+ }
249+ if len(result.Processes) != 2 {
250+ t.Fatalf("run %d process mappings = %+v", run, result.Processes)
251+ }
252+ for _, process := range result.Processes {
253+ if process.Role != "daemon" && process.Role != "client" {
254+ t.Fatalf("run %d unexpected role %q", run, process.Role)
255+ }
256+ if _, err := os.Stat(process.TracePath); err != nil {
257+ t.Fatalf("run %d %s trace %q: %v", run, process.Role, process.TracePath, err)
258+ }
259+ }
260+ }
261+}
262+
203 func TestHarnessScenarioSelectionKeepsCanonicalManifestValidation(t *testing.T) {263 func TestHarnessScenarioSelectionKeepsCanonicalManifestValidation(t *testing.T) {
204 root, err := filepath.Abs(filepath.Join("..", ".."))264 root, err := filepath.Abs(filepath.Join("..", ".."))
205 if err != nil {265 if err != nil {

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close