21 lines
585 B
Go
21 lines
585 B
Go
package agent_execution_test
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestDispatchQueueMigrationDefinesClaimableDurableState(t *testing.T) {
|
|
data, err := os.ReadFile("../../database/migrations/030_work_agent_dispatch_queue.sql")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
sql := string(data)
|
|
for _, marker := range []string{"work.agent_dispatch_queue", "state IN ('QUEUED','CLAIMED','COMPLETED','FAILED')", "CREATE INDEX IF NOT EXISTS", "REFERENCES work.agent_dispatch_intents"} {
|
|
if !strings.Contains(sql, marker) {
|
|
t.Fatalf("queue contract marker missing: %s", marker)
|
|
}
|
|
}
|
|
}
|