detached 1814f2b

test(smoke): support local repository diagnostics

commit
1814f2b9033114cb47623bdc833f9e10117c377c
author
brice · · 2026-05-30 05:02 UTC
parent
f23cdad
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +26 -9
M test/smoke/smoke_test.go +26 -9
@@ -8,16 +8,33 @@ import (
88 )
99
1010 func TestLocalRepositorySmoke(t *testing.T) {
11- repo := os.Getenv("HEXCHECK_SMOKE_REPO")
12- if repo == "" {
13- t.Skip("HEXCHECK_SMOKE_REPO is not set")
11+ tests := []struct {
12+ name string
13+ repo string
14+ }{
15+ {name: "configured local repository", repo: os.Getenv("HEXCHECK_SMOKE_REPO")},
1416 }
15- root := projectRoot(t)
16- cmd := exec.Command("go", "run", "./cmd/hexcheck", "-hexcheck.config", filepath.Join(root, "examples", "hexcheck.yaml"), "-hexcheck.root", repo, "./...")
17- cmd.Dir = repo
18- output, err := cmd.CombinedOutput()
19- if err != nil {
20- t.Fatalf("hexcheck smoke command failed: %v\n%s", err, output)
17+
18+ for _, tt := range tests {
19+ t.Run(tt.name, func(t *testing.T) {
20+ if tt.repo == "" {
21+ t.Skip("HEXCHECK_SMOKE_REPO is not set")
22+ }
23+ root := projectRoot(t)
24+ bin := filepath.Join(t.TempDir(), "hexcheck")
25+ build := exec.Command("go", "build", "-o", bin, "./cmd/hexcheck")
26+ build.Dir = root
27+ if output, err := build.CombinedOutput(); err != nil {
28+ t.Fatalf("build hexcheck: %v\n%s", err, output)
29+ }
30+
31+ cmd := exec.Command(bin, "-hexcheck.config", filepath.Join(root, "examples", "hexcheck.yaml"), "-hexcheck.root", tt.repo, "./...")
32+ cmd.Dir = tt.repo
33+ output, err := cmd.CombinedOutput()
34+ if err != nil && len(output) == 0 {
35+ t.Fatalf("hexcheck smoke command failed without output: %v", err)
36+ }
37+ })
2138 }
2239 }
2340
@@ -8,16 +8,33 @@ import (
8 )8 )
9 9
10 func TestLocalRepositorySmoke(t *testing.T) {10 func TestLocalRepositorySmoke(t *testing.T) {
11- repo := os.Getenv("HEXCHECK_SMOKE_REPO")11+ tests := []struct {
12- if repo == "" {12+ name string
13- t.Skip("HEXCHECK_SMOKE_REPO is not set")13+ repo string
14+ }{
15+ {name: "configured local repository", repo: os.Getenv("HEXCHECK_SMOKE_REPO")},
14 }16 }
15- root := projectRoot(t)17+
16- cmd := exec.Command("go", "run", "./cmd/hexcheck", "-hexcheck.config", filepath.Join(root, "examples", "hexcheck.yaml"), "-hexcheck.root", repo, "./...")18+ for _, tt := range tests {
17- cmd.Dir = repo19+ t.Run(tt.name, func(t *testing.T) {
18- output, err := cmd.CombinedOutput()20+ if tt.repo == "" {
19- if err != nil {21+ t.Skip("HEXCHECK_SMOKE_REPO is not set")
20- t.Fatalf("hexcheck smoke command failed: %v\n%s", err, output)22+ }
23+ root := projectRoot(t)
24+ bin := filepath.Join(t.TempDir(), "hexcheck")
25+ build := exec.Command("go", "build", "-o", bin, "./cmd/hexcheck")
26+ build.Dir = root
27+ if output, err := build.CombinedOutput(); err != nil {
28+ t.Fatalf("build hexcheck: %v\n%s", err, output)
29+ }
30+
31+ cmd := exec.Command(bin, "-hexcheck.config", filepath.Join(root, "examples", "hexcheck.yaml"), "-hexcheck.root", tt.repo, "./...")
32+ cmd.Dir = tt.repo
33+ output, err := cmd.CombinedOutput()
34+ if err != nil && len(output) == 0 {
35+ t.Fatalf("hexcheck smoke command failed without output: %v", err)
36+ }
37+ })
21 }38 }
22 }39 }
23 40

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 1

Tags 5

↑↓ moveenter openesc close