refactor: simplify journal logs following, fix corrosion unit name

This commit is contained in:
Pasha Sviderski
2026-04-08 19:38:02 +10:00
parent e96cce88c1
commit 943fea0515
3 changed files with 11 additions and 36 deletions
+3 -5
View File
@@ -12,8 +12,6 @@ import (
)
func TestLogs(t *testing.T) {
t.Parallel()
commandContext = func(ctx context.Context, _ string, _ ...string) *exec.Cmd {
return exec.CommandContext(ctx, "/usr/bin/tail", "testdata/logs")
}
@@ -29,8 +27,7 @@ func TestLogs(t *testing.T) {
for range ch {
i++
}
assert.Equal(t, i, 6)
cancel()
assert.Equal(t, 6, i)
commandContext = func(ctx context.Context, _ string, _ ...string) *exec.Cmd {
return exec.CommandContext(ctx, "/usr/bin/tail", "-f", "testdata/logs")
@@ -47,5 +44,6 @@ func TestLogs(t *testing.T) {
for range ch {
i++
}
assert.Equal(t, i, 6) // still six is hardbeats are not written here.
// Still six because heartbeats are not written here and Tail is ignored as the command is overridden.
assert.Equal(t, 6, i)
}