Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/ob/ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func addOpsCommands(root *cobra.Command, g *globalFlags) {
proxyCmd.AddCommand(proxyApplyCmd)
root.AddCommand(proxyCmd)

// schedule apply | list | history | logs — see schedule.go.
// schedule apply | list — see schedule.go; job run | history | logs — see job.go.
addScheduleCommands(root, g)

// secrets list | edit | push
Expand Down
6 changes: 3 additions & 3 deletions e2e/server_execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ workloads:
// A legacy compose-run container can survive a crash without durable labels.
// The first durable activation must reclaim this stopped, owned container.
s.run(t, "docker compose -p "+name+" --project-directory "+root+"/current -f "+root+"/current/compose.yaml run --no-deps --name "+name+"-refresh-1 refresh true")
if out, err := s.ob(t, dir, "schedule", "run", "refresh", "--input", "SOURCE=custom", "--wait"); err == nil {
if out, err := s.ob(t, dir, "job", "run", "refresh", "--input", "SOURCE=custom", "--wait"); err == nil {
t.Fatalf("index should fail before allow marker: %s", out)
}
list := s.mustOb(t, dir, "execution", "list", "--output", "json")
Expand Down Expand Up @@ -114,15 +114,15 @@ workloads:
// Interrupted work is retained independently of the host journal. A new
// failed execution can be inspected after its runner and notifier exit.
s.run(t, "rm -f "+base+"/data/allow")
_, _ = s.ob(t, dir, "schedule", "run", "refresh", "--wait")
_, _ = s.ob(t, dir, "job", "run", "refresh", "--wait")
pins := s.run(t, "/usr/bin/python3 "+root+"/schedule/execution-v1.py pins "+root)
if strings.TrimSpace(pins) == "" {
t.Fatal("failed execution lost its durable release reference")
}
// A killed activation must be inspectable and resume only its interrupted
// step. Concurrent resume and deployment coordination must refuse live work.
s.run(t, "touch "+base+"/data/hold")
s.mustOb(t, dir, "schedule", "run", "refresh")
s.mustOb(t, dir, "job", "run", "refresh")
deadline := time.Now().Add(15 * time.Second)
for s.try(t, "test -f "+base+"/data/started") != nil {
if time.Now().After(deadline) {
Expand Down
12 changes: 6 additions & 6 deletions e2e/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ ExecStart=/usr/bin/docker compose -p observer -f /var/lib/ob/observer/current/co

// The notifier wrote a record for that run; a hand-started unit has no
// TRIGGER_UNIT, so it is recorded as a operator activation.
history := s.mustOb(t, dir, "schedule", "history", "chore", "--output", "json")
history := s.mustOb(t, dir, "job", "history", "chore", "--output", "json")
for _, want := range []string{`"outcome": "success"`, `"trigger": "manual"`, `"attempts": 1`} {
if !strings.Contains(history, want) {
t.Fatalf("run history is missing %q:\n%s", want, history)
Expand All @@ -248,7 +248,7 @@ ExecStart=/usr/bin/docker compose -p observer -f /var/lib/ob/observer/current/co
// One failure, one sleep, one success: the record counts both attempts.
s.run(t, "rm -rf /tmp/onebox-e2e-retry && mkdir -p /tmp/onebox-e2e-retry")
s.run(t, "systemctl start ob-observer-retry--chore.service")
retry := s.mustOb(t, dir, "schedule", "history", "retry-chore", "--output", "json")
retry := s.mustOb(t, dir, "job", "history", "retry-chore", "--output", "json")
for _, want := range []string{`"outcome": "success"`, `"attempts": 2`} {
if !strings.Contains(retry, want) {
t.Fatalf("retry history is missing %q:\n%s", want, retry)
Expand All @@ -257,13 +257,13 @@ ExecStart=/usr/bin/docker compose -p observer -f /var/lib/ob/observer/current/co

// A operator run with an input override reaches the container as its
// environment, is journaled with the operator, and shows up as such.
manual := s.mustOb(t, dir, "schedule", "run", "input-chore", "--input", "GREETING=hello", "--wait", "--output", "json")
manual := s.mustOb(t, dir, "job", "run", "input-chore", "--input", "GREETING=hello", "--wait", "--output", "json")
for _, want := range []string{`"GREETING": "hello"`, `"outcome": "success"`, `"trigger": "manual"`} {
if !strings.Contains(manual, want) {
t.Fatalf("operator run result is missing %q:\n%s", want, manual)
}
}
logs := s.mustOb(t, dir, "schedule", "logs", "input-chore")
logs := s.mustOb(t, dir, "job", "logs", "input-chore")
if !strings.Contains(logs, "greeting=hello") {
t.Fatalf("run logs do not show the override:\n%s", logs)
}
Expand Down Expand Up @@ -312,7 +312,7 @@ HTTPServer(("127.0.0.1", 18080), Handler).handle_request()
t.Fatalf("timed-out scheduled run result = %q, want timeout", result)
}
// The runner was killed mid-run; ExecStopPost still wrote the record.
if timedOut := s.mustOb(t, dir, "schedule", "history", "timeout-chore", "--output", "json"); !strings.Contains(timedOut, `"outcome": "timeout"`) {
if timedOut := s.mustOb(t, dir, "job", "history", "timeout-chore", "--output", "json"); !strings.Contains(timedOut, `"outcome": "timeout"`) {
t.Fatalf("timeout was not recorded:\n%s", timedOut)
}
out, err := s.ob(t, dir, "status")
Expand All @@ -334,7 +334,7 @@ HTTPServer(("127.0.0.1", 18080), Handler).handle_request()
// clears the failure from `ob status`; only a later successful run
// does. A operator run with the input that makes the job finish in time
// is that run, and it must leave status green for the steps after.
s.mustOb(t, dir, "schedule", "run", "timeout-chore", "--input", "SLEEP=0", "--wait")
s.mustOb(t, dir, "job", "run", "timeout-chore", "--input", "SLEEP=0", "--wait")
if cleared := s.mustOb(t, dir, "status"); !strings.Contains(cleared, "schedule timeout-chore active") {
t.Fatalf("a successful operator run did not clear the recorded timeout:\n%s", cleared)
}
Expand Down