detached 1e6ecdb

test(oracle): report oracle dump write errors

The transcript dump now reports Flush and Close errors at the end of each
scenario instead of discarding them, which golangci-lint's errcheck flagged.
commit
1e6ecdbaf24da935633f33b601209754c954e7c1
author
brice · · 2026-10-02 17:54 UTC
parent
1315cb1
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
refs
perf/html-runs
1 file · +8 -6
M oracle_test.go +8 -6
@@ -5,6 +5,7 @@ import (
55 "bytes"
66 "crypto/sha256"
77 "encoding/hex"
8+ "errors"
89 "flag"
910 "fmt"
1011 "hash"
@@ -99,10 +100,8 @@ func (o *oracleRun) emit(concern, format string, args ...any) {
99100 h.Write([]byte(line))
100101 h.Write([]byte{'\n'})
101102 if o.dump != nil {
102- o.dump.WriteString(concern)
103- o.dump.WriteString(": ")
104- o.dump.WriteString(line)
105- o.dump.WriteByte('\n')
103+ // bufio.Writer keeps the first error; the deferred Flush reports it.
104+ _, _ = fmt.Fprintf(o.dump, "%s: %s\n", concern, line)
106105 }
107106 }
108107
@@ -529,9 +528,12 @@ func runOracleScenario(t *testing.T, idx int) string {
529528 if err != nil {
530529 t.Fatal(err)
531530 }
532- defer f.Close()
533531 o.dump = bufio.NewWriter(f)
534- defer o.dump.Flush()
532+ defer func() {
533+ if err := errors.Join(o.dump.Flush(), f.Close()); err != nil {
534+ t.Errorf("write oracle dump: %v", err)
535+ }
536+ }()
535537 }
536538 if sc.history != nil {
537539 o.screen = vt.NewScreenWithHistory(sc.cols, sc.rows, *sc.history)
@@ -5,6 +5,7 @@ import (
5 "bytes"5 "bytes"
6 "crypto/sha256"6 "crypto/sha256"
7 "encoding/hex"7 "encoding/hex"
8+ "errors"
8 "flag"9 "flag"
9 "fmt"10 "fmt"
10 "hash"11 "hash"
@@ -99,10 +100,8 @@ func (o *oracleRun) emit(concern, format string, args ...any) {
99 h.Write([]byte(line))100 h.Write([]byte(line))
100 h.Write([]byte{'\n'})101 h.Write([]byte{'\n'})
101 if o.dump != nil {102 if o.dump != nil {
102- o.dump.WriteString(concern)103+ // bufio.Writer keeps the first error; the deferred Flush reports it.
103- o.dump.WriteString(": ")104+ _, _ = fmt.Fprintf(o.dump, "%s: %s\n", concern, line)
104- o.dump.WriteString(line)
105- o.dump.WriteByte('\n')
106 }105 }
107 }106 }
108 107
@@ -529,9 +528,12 @@ func runOracleScenario(t *testing.T, idx int) string {
529 if err != nil {528 if err != nil {
530 t.Fatal(err)529 t.Fatal(err)
531 }530 }
532- defer f.Close()
533 o.dump = bufio.NewWriter(f)531 o.dump = bufio.NewWriter(f)
534- defer o.dump.Flush()532+ defer func() {
533+ if err := errors.Join(o.dump.Flush(), f.Close()); err != nil {
534+ t.Errorf("write oracle dump: %v", err)
535+ }
536+ }()
535 }537 }
536 if sc.history != nil {538 if sc.history != nil {
537 o.screen = vt.NewScreenWithHistory(sc.cols, sc.rows, *sc.history)539 o.screen = vt.NewScreenWithHistory(sc.cols, sc.rows, *sc.history)

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 2

Tags 13

↑↓ moveenter openesc close