Showing the changes to internal (5 of 17 files). Show all
Unified · Split
| @@ -102,7 +102,7 @@ func fileMode(p string) int64 { · 101 unmodified lines | ||
| 102 | 102 | switch { |
| 103 | 103 | case strings.HasSuffix(p, ".sh"): |
| 104 | 104 | return 0o755 |
| 105 | − case p == "guest/hb" || strings.HasPrefix(p, "guest/hb-"): | |
| 105 | + case p == "guest/hb" || strings.HasPrefix(p, "guest/hb-") || p == "guest/tx9-services": | |
| 106 | 106 | return 0o755 |
| 107 | 107 | case p == "guest/hermes-state": |
| 108 | 108 | return 0o755 |
| @@ -6,6 +6,7 @@ import ( · 5 unmodified lines | ||
| 6 | 6 | "io/fs" |
| 7 | 7 | "os" |
| 8 | 8 | "path/filepath" |
| 9 | + "strings" | |
| 9 | 10 | "testing" |
| 10 | 11 | ) |
| 11 | 12 | |
| @@ -51,9 +52,11 @@ func TestBuildContextTar(t *testing.T) { · 39 unmodified lines | ||
| 51 | 52 | if mode != 0o755 { |
| 52 | 53 | t.Errorf("guest/hb mode = %o, want 0755", mode) |
| 53 | 54 | } |
| 54 | − for _, want := range []string{"box.env", "provision/provision.sh", "docker/entrypoint.sh", "docker/executor-entrypoint.sh", "guest/hb-workload", "guest/hermes-state"} { | |
| 55 | + for _, want := range []string{"box.env", "provision/provision.sh", "docker/entrypoint.sh", "docker/executor-entrypoint.sh", "guest/hb-workload", "guest/tx9-services", "guest/hermes-state"} { | |
| 55 | 56 | if _, ok := modes[want]; !ok { |
| 56 | 57 | t.Errorf("%s missing from build context tar", want) |
| 58 | + } else if strings.HasPrefix(want, "guest/") && modes[want] != 0o755 { | |
| 59 | + t.Errorf("%s mode = %o, want 0755", want, modes[want]) | |
| 57 | 60 | } |
| 58 | 61 | } |
| 59 | 62 | for name := range modes { |
| @@ -42,7 +42,7 @@ func cmdLogs(args []string) error { · 41 unmodified lines | ||
| 42 | 42 | |
| 43 | 43 | fs := flag.NewFlagSet("logs", flag.ContinueOnError) |
| 44 | 44 | opts := logsQueryOptions{} |
| 45 | − fs.StringVar(&opts.Source, "source", "all", "comma-separated sources: agent,executor,hermes,codex,claude") | |
| 45 | + fs.StringVar(&opts.Source, "source", "all", "comma-separated sources: agent,executor,hermes,codex,claude,service-<name>") | |
| 46 | 46 | fs.IntVar(&opts.Tail, "tail", 200, "show the newest N matching events") |
| 47 | 47 | fs.StringVar(&opts.Since, "since", "", "only events after a duration or RFC3339 timestamp (for example 24h)") |
| 48 | 48 | fs.StringVar(&opts.Contains, "grep", "", "only events containing text") |
| @@ -89,7 +89,7 @@ func cmdLogsExport(args []string) error { · 40 unmodified lines | ||
| 89 | 89 | fs := flag.NewFlagSet("logs export", flag.ContinueOnError) |
| 90 | 90 | opts := logsQueryOptions{} |
| 91 | 91 | output := fs.String("output", "", "output .tar.gz path (default: <box>-logs-<timestamp>.tar.gz)") |
| 92 | − fs.StringVar(&opts.Source, "source", "all", "comma-separated sources: agent,executor,hermes,codex,claude") | |
| 92 | + fs.StringVar(&opts.Source, "source", "all", "comma-separated sources: agent,executor,hermes,codex,claude,service-<name>") | |
| 93 | 93 | fs.StringVar(&opts.Since, "since", "", "only events after a duration or RFC3339 timestamp (for example 24h)") |
| 94 | 94 | fs.StringVar(&opts.Contains, "grep", "", "only events containing text") |
| 95 | 95 | fs.StringVar(&opts.Level, "level", "", "only events at this level or above: debug|info|warn|error (unleveled events count as info)") |
| @@ -41,7 +41,7 @@ var commandSpecs = []commandSpec{ · 40 unmodified lines | ||
| 41 | 41 | {name: "enter", help: "exec into a box's agent container (--executor for the executor container)", aliases: []string{"ssh", "shell"}, run: cmdEnter}, |
| 42 | 42 | {name: "start", help: "start a stopped box", run: cmdStart}, |
| 43 | 43 | {name: "stop", help: "stop a running box", run: cmdStop}, |
| 44 | − {name: "logs", help: "query/export durable agent, Executor, Hermes, Codex, and Claude events", run: cmdLogs}, | |
| 44 | + {name: "logs", help: "query/export durable agent, Executor, Hermes, Codex, Claude, and custom-service events", run: cmdLogs}, | |
| 45 | 45 | {name: "resources", help: "show/update container limits and volume budgets", run: cmdResources}, |
| 46 | 46 | {name: "backup", help: "archive a box to a .tx9 file", aliases: []string{"export", "save"}, run: cmdBackup}, |
| 47 | 47 | {name: "import", help: "restore a box from a .tx9 file", aliases: []string{"load", "restore"}, run: cmdImport}, |
| @@ -59,6 +59,14 @@ func TestUsageShowsAliasesFromCommandSpecs(t *testing.T) { · 58 unmodified lines | ||
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | +func TestUsageMentionsCustomServiceLogs(t *testing.T) { | |
| 63 | + var usage bytes.Buffer | |
| 64 | + printUsage(&usage) | |
| 65 | + if !strings.Contains(usage.String(), "custom-service events") { | |
| 66 | + t.Fatalf("logs help does not mention custom services:\n%s", usage.String()) | |
| 67 | + } | |
| 68 | +} | |
| 69 | + | |
| 62 | 70 | func TestNoArgumentsShowsOverviewAndCommands(t *testing.T) { |
| 63 | 71 | var stdout, stderr bytes.Buffer |
| 64 | 72 | status := runWithOverview([]string{"tx9"}, nil, func(w io.Writer) error { |