Merge pull request #8914 from dokku/feat/vector-cron-sink

Add vector-cron-sink for scheduled cron task output
This commit is contained in:
Jose Diaz-Gonzalez
2026-08-09 13:16:21 -04:00
committed by GitHub
15 changed files with 1365 additions and 112 deletions

View File

@@ -100,3 +100,26 @@ func TestDokkuRunCommandAltCommandWithLogFile(t *testing.T) {
t.Errorf("DokkuRunCommand() = %q, want %q", got, want)
}
}
// TestDokkuRunCommandAppTaskIgnoresLogFile pins that LogFile is honored only
// for internally injected tasks from the cron-entries trigger. App tasks never
// interpolate a path into the crontab line - their output is shipped by the
// vector integration instead.
func TestDokkuRunCommandAppTaskIgnoresLogFile(t *testing.T) {
task := CronTask{
App: "myapp",
ID: "abc123",
Command: "npm run send-email",
LogFile: "/var/log/dokku/should-not-appear.log",
}
got := task.DokkuRunCommand()
want := "dokku cron:run myapp abc123"
if got != want {
t.Errorf("DokkuRunCommand() = %q, want %q", got, want)
}
if strings.Contains(got, ">>") {
t.Errorf("DokkuRunCommand() interpolated a redirect into an app task line: %q", got)
}
}