MCPcopy Create free account
hub / github.com/compozy/agh / TestAdditionalBranchCoverage

Function TestAdditionalBranchCoverage

internal/task/validate_test.go:1092–1189  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1090}
1091
1092func TestAdditionalBranchCoverage(t *testing.T) {
1093 t.Parallel()
1094
1095 t.Run("Should task missing id", func(t *testing.T) {
1096 t.Parallel()
1097 taskRecord := validTask()
1098 taskRecord.ID = ""
1099 err := taskRecord.Validate()
1100 if err == nil || !errors.Is(err, ErrValidation) {
1101 t.Fatalf("Task.Validate() error = %v, want ErrValidation", err)
1102 }
1103 })
1104
1105 t.Run("Should task parent self", func(t *testing.T) {
1106 t.Parallel()
1107 taskRecord := validTask()
1108 taskRecord.ParentTaskID = taskRecord.ID
1109 err := taskRecord.Validate()
1110 if err == nil || !errors.Is(err, ErrValidation) {
1111 t.Fatalf("Task.Validate() error = %v, want ErrValidation", err)
1112 }
1113 })
1114
1115 t.Run("Should task missing title", func(t *testing.T) {
1116 t.Parallel()
1117 taskRecord := validTask()
1118 taskRecord.Title = ""
1119 err := taskRecord.Validate()
1120 if err == nil || !errors.Is(err, ErrValidation) {
1121 t.Fatalf("Task.Validate() error = %v, want ErrValidation", err)
1122 }
1123 })
1124
1125 t.Run("Should task run missing claimed by ref", func(t *testing.T) {
1126 t.Parallel()
1127 run := validRun()
1128 run.Status = TaskRunStatusClaimed
1129 run.ClaimedBy = &ActorIdentity{Kind: ActorKindHuman}
1130 err := run.Validate()
1131 if err == nil || !errors.Is(err, ErrValidation) {
1132 t.Fatalf("Run.Validate() error = %v, want ErrValidation", err)
1133 }
1134 })
1135
1136 t.Run("Should task run invalid attempt", func(t *testing.T) {
1137 t.Parallel()
1138 run := validRun()
1139 run.Attempt = 0
1140 err := run.Validate()
1141 if err == nil || !errors.Is(err, ErrValidation) {
1142 t.Fatalf("Run.Validate() error = %v, want ErrValidation", err)
1143 }
1144 })
1145
1146 t.Run("Should task event missing event type", func(t *testing.T) {
1147 t.Parallel()
1148 event := validEvent()
1149 event.EventType = ""

Callers

nothing calls this directly

Calls 9

ValidateMethod · 0.95
validTaskFunction · 0.85
validRunFunction · 0.85
validEventFunction · 0.85
validActorContextFunction · 0.85
nestedPathFunction · 0.70
RunMethod · 0.65
ValidateMethod · 0.65
IsMethod · 0.45

Tested by

no test coverage detected