test(e2e): use requireGit so CI cannot skip the Git tests
- commit
- 89fd514a218935cad6e85258b60e047a06c002b2
- author
- brice · · 2026-10-10 07:11 UTC
- parent
- b0a4fdf
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +2 -8
M cmd/ermite/e2e_helpers_test.go +1 -4
| @@ -48,10 +48,7 @@ type harnessOpts struct { | |||
| 48 | 48 | // lives in it and Unix socket paths are limited to about 100 bytes. | |
| 49 | 49 | func newHarness(t *testing.T, o harnessOpts) *harness { | |
| 50 | 50 | t.Helper() | |
| 51 | - | gitBin, err := exec.LookPath("git") | |
| 52 | - | if err != nil { | |
| 53 | - | t.Skip("git not found") | |
| 54 | - | } | |
| 51 | + | gitBin := requireGit(t) | |
| 55 | 52 | data, err := os.MkdirTemp("", "ermite") | |
| 56 | 53 | require.NoError(t, err) | |
| 57 | 54 | t.Cleanup(func() { _ = os.RemoveAll(data) }) | |
| @@ -48,10 +48,7 @@ type harnessOpts struct { | |||||
| 48 | // lives in it and Unix socket paths are limited to about 100 bytes. | 48 | // lives in it and Unix socket paths are limited to about 100 bytes. | ||
| 49 | func newHarness(t *testing.T, o harnessOpts) *harness { | 49 | func newHarness(t *testing.T, o harnessOpts) *harness { | ||
| 50 | t.Helper() | 50 | t.Helper() | ||
| 51 | - | gitBin, err := exec.LookPath("git") | 51 | + | gitBin := requireGit(t) |
| 52 | - | if err != nil { | |||
| 53 | - | t.Skip("git not found") | |||
| 54 | - | } | |||
| 55 | data, err := os.MkdirTemp("", "ermite") | 52 | data, err := os.MkdirTemp("", "ermite") | ||
| 56 | require.NoError(t, err) | 53 | require.NoError(t, err) | ||
| 57 | t.Cleanup(func() { _ = os.RemoveAll(data) }) | 54 | t.Cleanup(func() { _ = os.RemoveAll(data) }) | ||
M cmd/ermite/e2e_test.go +1 -4
| @@ -691,10 +691,7 @@ func TestFsckRejectsMalformedObjects(t *testing.T) { | |||
| 691 | 691 | // The built binary end to end: `ermite serve` as a process, its hook scripts | |
| 692 | 692 | // exec'ing the same binary, and a real git client pushing and cloning. | |
| 693 | 693 | func TestBuiltBinaryPushAndClone(t *testing.T) { | |
| 694 | - | gitBin, err := exec.LookPath("git") | |
| 695 | - | if err != nil { | |
| 696 | - | t.Skip("git not found") | |
| 697 | - | } | |
| 694 | + | gitBin := requireGit(t) | |
| 698 | 695 | data, err := os.MkdirTemp("", "ermite") | |
| 699 | 696 | require.NoError(t, err) | |
| 700 | 697 | t.Cleanup(func() { _ = os.RemoveAll(data) }) | |
| @@ -691,10 +691,7 @@ func TestFsckRejectsMalformedObjects(t *testing.T) { | |||||
| 691 | // The built binary end to end: `ermite serve` as a process, its hook scripts | 691 | // The built binary end to end: `ermite serve` as a process, its hook scripts | ||
| 692 | // exec'ing the same binary, and a real git client pushing and cloning. | 692 | // exec'ing the same binary, and a real git client pushing and cloning. | ||
| 693 | func TestBuiltBinaryPushAndClone(t *testing.T) { | 693 | func TestBuiltBinaryPushAndClone(t *testing.T) { | ||
| 694 | - | gitBin, err := exec.LookPath("git") | 694 | + | gitBin := requireGit(t) |
| 695 | - | if err != nil { | |||
| 696 | - | t.Skip("git not found") | |||
| 697 | - | } | |||
| 698 | data, err := os.MkdirTemp("", "ermite") | 695 | data, err := os.MkdirTemp("", "ermite") | ||
| 699 | require.NoError(t, err) | 696 | require.NoError(t, err) | ||
| 700 | t.Cleanup(func() { _ = os.RemoveAll(data) }) | 697 | t.Cleanup(func() { _ = os.RemoveAll(data) }) | ||