@@ -39,12 +39,9 @@ func TestAnalyzeExecutionResult_AllSuccess(t *testing.T) {
3939 },
4040 }
4141
42- success , errorMessage , failedCount , resultStatus := vm .AnalyzeExecutionResult ()
42+ errorMessage , failedCount , resultStatus := vm .AnalyzeExecutionResult ()
4343
4444 // Verify results
45- if ! success {
46- t .Errorf ("Expected success=true, got success=%v" , success )
47- }
4845 if errorMessage != "" {
4946 t .Errorf ("Expected empty error message, got: %s" , errorMessage )
5047 }
@@ -56,8 +53,8 @@ func TestAnalyzeExecutionResult_AllSuccess(t *testing.T) {
5653 }
5754}
5855
59- // TestAnalyzeExecutionResult_PartialSuccess tests the case where some steps succeed and some fail
60- func TestAnalyzeExecutionResult_PartialSuccess (t * testing.T ) {
56+ // TestAnalyzeExecutionResult_SomeStepsFailed tests the case where some steps succeed and some fail
57+ func TestAnalyzeExecutionResult_SomeStepsFailed (t * testing.T ) {
6158 vm := NewVM ()
6259 vm .logger = testutil .GetLogger ()
6360
@@ -89,20 +86,17 @@ func TestAnalyzeExecutionResult_PartialSuccess(t *testing.T) {
8986 },
9087 }
9188
92- success , errorMessage , failedCount , resultStatus := vm .AnalyzeExecutionResult ()
89+ errorMessage , failedCount , resultStatus := vm .AnalyzeExecutionResult ()
9390
9491 // Verify results
95- if success {
96- t .Errorf ("Expected success=false for partial success, got success=%v" , success )
97- }
9892 if errorMessage == "" {
99- t .Errorf ("Expected non-empty error message for partial success " )
93+ t .Errorf ("Expected non-empty error message when some steps failed " )
10094 }
10195 if failedCount != 1 {
10296 t .Errorf ("Expected failedCount=1, got failedCount=%d" , failedCount )
10397 }
104- if resultStatus != ExecutionPartialSuccess {
105- t .Errorf ("Expected resultStatus=ExecutionPartialSuccess , got resultStatus=%v" , resultStatus )
98+ if resultStatus != ExecutionFailed {
99+ t .Errorf ("Expected resultStatus=ExecutionFailed , got resultStatus=%v" , resultStatus )
106100 }
107101
108102 // Check that error message contains failure information
@@ -139,20 +133,17 @@ func TestAnalyzeExecutionResult_AllFailure(t *testing.T) {
139133 },
140134 }
141135
142- success , errorMessage , failedCount , resultStatus := vm .AnalyzeExecutionResult ()
136+ errorMessage , failedCount , resultStatus := vm .AnalyzeExecutionResult ()
143137
144138 // Verify results
145- if success {
146- t .Errorf ("Expected success=false for all failures, got success=%v" , success )
147- }
148139 if errorMessage == "" {
149140 t .Errorf ("Expected non-empty error message for all failures" )
150141 }
151142 if failedCount != 3 {
152143 t .Errorf ("Expected failedCount=3, got failedCount=%d" , failedCount )
153144 }
154- if resultStatus != ExecutionFailure {
155- t .Errorf ("Expected resultStatus=ExecutionFailure , got resultStatus=%v" , resultStatus )
145+ if resultStatus != ExecutionFailed {
146+ t .Errorf ("Expected resultStatus=ExecutionFailed , got resultStatus=%v" , resultStatus )
156147 }
157148
158149 // Check that error message contains failure information
@@ -170,25 +161,22 @@ func TestAnalyzeExecutionResult_NoSteps(t *testing.T) {
170161 // No execution logs
171162 vm .ExecutionLogs = []* avsproto.Execution_Step {}
172163
173- success , errorMessage , failedCount , resultStatus := vm .AnalyzeExecutionResult ()
164+ errorMessage , failedCount , resultStatus := vm .AnalyzeExecutionResult ()
174165
175166 // Verify results
176- if success {
177- t .Errorf ("Expected success=false for no steps, got success=%v" , success )
178- }
179167 if errorMessage != "no execution steps found" {
180168 t .Errorf ("Expected specific error message for no steps, got: %s" , errorMessage )
181169 }
182170 if failedCount != 0 {
183171 t .Errorf ("Expected failedCount=0 for no steps, got failedCount=%d" , failedCount )
184172 }
185- if resultStatus != ExecutionFailure {
186- t .Errorf ("Expected resultStatus=ExecutionFailure for no steps, got resultStatus=%v" , resultStatus )
173+ if resultStatus != ExecutionFailed {
174+ t .Errorf ("Expected resultStatus=ExecutionFailed for no steps, got resultStatus=%v" , resultStatus )
187175 }
188176}
189177
190- // TestGetExecutionStatus_PartialSuccess tests the GetExecutionStatus method for partial success
191- func TestGetExecutionStatus_PartialSuccess (t * testing.T ) {
178+ // TestGetExecutionStatus_StepFailures tests the GetExecutionStatus method when some steps fail
179+ func TestGetExecutionStatus_StepFailures (t * testing.T ) {
192180 // Set up test database and engine
193181 db := testutil .TestMustDB ()
194182 defer storage .Destroy (db .(* storage.BadgerStorage ))
@@ -209,13 +197,13 @@ func TestGetExecutionStatus_PartialSuccess(t *testing.T) {
209197 },
210198 }
211199
212- // Create execution with partial success ( some steps succeed, some fail)
200+ // Create execution where some steps succeed and some fail
213201 execution := & avsproto.Execution {
214202 Id : "test-execution-id" ,
215203 StartAt : time .Now ().UnixMilli (),
216204 EndAt : time .Now ().UnixMilli (),
217- Status : avsproto .ExecutionStatus_EXECUTION_STATUS_PARTIAL_SUCCESS , // Overall status is partial success
218- Error : "Partial success: 1 of 3 steps failed: Database Query" ,
205+ Status : avsproto .ExecutionStatus_EXECUTION_STATUS_FAILED ,
206+ Error : "1 of 3 steps failed: Database Query" ,
219207 Index : 0 , // First execution
220208 Steps : []* avsproto.Execution_Step {
221209 {
@@ -269,9 +257,9 @@ func TestGetExecutionStatus_PartialSuccess(t *testing.T) {
269257 t .Fatalf ("GetExecutionStatus failed: %v" , err )
270258 }
271259
272- // Verify that it returns PARTIAL_SUCCESS status
273- if statusResp .Status != avsproto .ExecutionStatus_EXECUTION_STATUS_PARTIAL_SUCCESS {
274- t .Errorf ("Expected EXECUTION_STATUS_PARTIAL_SUCCESS , got %v" , statusResp .Status )
260+ // Verify that it returns FAILED status (some steps failed)
261+ if statusResp .Status != avsproto .ExecutionStatus_EXECUTION_STATUS_FAILED {
262+ t .Errorf ("Expected EXECUTION_STATUS_FAILED , got %v" , statusResp .Status )
275263 }
276264}
277265
0 commit comments