25 lines
739 B
Go
25 lines
739 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
"time"
|
|
|
|
"git.cin.su/m/Assistant/contracts/work"
|
|
)
|
|
|
|
func TestLocalExecutorNeverClaimsUnsupportedExecution(t *testing.T) {
|
|
when := time.UnixMilli(1_700_000_000_000)
|
|
executor := localExecutor{now: func() time.Time { return when }}
|
|
result, err := executor.Execute(context.Background(), work.AgentExecutionRequest{Intent: work.AgentDispatchIntent{DispatchID: "dispatch-1"}})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if result.State != work.AgentExecutionWaiting || result.ObservedAtUnixMillis != when.UnixMilli() {
|
|
t.Fatalf("unexpected fallback result: %+v", result)
|
|
}
|
|
if result.OutcomeRef != "" || result.Summary == "" {
|
|
t.Fatalf("local executor must not claim an outcome: %+v", result)
|
|
}
|
|
}
|