Skip to content

Commit 0fa7478

Browse files
committed
rename status and action
Signed-off-by: Antoine MAZEAS <antoine.mazeas@filigran.io>
1 parent 39abfbb commit 0fa7478

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

pyoaev/signatures/models.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,19 +191,19 @@ def post_execution_update(self, tool_output: ToolOutput, now: datetime) -> None:
191191
self.end_time = now
192192

193193
if tool_output.error_info and tool_output.error_info.exit_code != 0:
194-
self.execution_status = "failed"
194+
self.execution_status = "ERROR"
195195
if tool_output.error_info.crash_timestamp:
196196
self.end_time = datetime.strptime(
197197
tool_output.error_info.crash_timestamp, "%Y-%m-%dT%H:%M:%SZ"
198198
)
199199
elif tool_output.timeout_info:
200-
self.execution_status = "timeout"
200+
self.execution_status = "TIMEOUT"
201201
elif tool_output.status == "partial":
202-
self.execution_status = "partial"
202+
self.execution_status = "ERROR"
203203
else:
204-
self.execution_status = "success"
204+
self.execution_status = "EXECUTED"
205205

206-
self.execution_action = InjectExecutionActions("complete")
206+
self.execution_action = InjectExecutionActions("command_execution")
207207

208208

209209
class SignatureCallbackPayload(BaseModel):

test/signatures/constraints/signature_manager_post_execution_constraints.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ Feature: SignatureManager post-execution constraints
1818
Scenario: Tool crash sets execution_status to failed and uses crash timestamp as end_time
1919
Given a tool_output containing error_info with exit_code=1 and crash_timestamp="2024-06-26T06:05:00Z"
2020
When I call post_execution_updates with the execution_details, execution_signatures and tool_output
21-
Then execution_status equals "failed"
21+
Then execution_status equals "ERROR"
2222
And end_time equals "2024-06-26T06:05:00Z"
2323
And the execution signature model contains every previous parameter unchanged
2424
And the execution details model contain every previous parameter pair unchanged
2525

2626
Scenario: Timeout sets execution_status to timeout and includes available partial results
2727
Given a tool_output containing timeout_info with partial_results=["result-A", "result-B"]
2828
When I call post_execution_updates with the execution_details, execution_signatures and tool_output
29-
Then execution_status equals "timeout"
29+
Then execution_status equals "TIMEOUT"
3030
And the returned dict contains the partial results ["result-A", "result-B"] from timeout_info
3131
And the execution signature model contains every previous parameter unchanged
3232
And the execution details model contain every previous parameter pair unchanged
3333

3434
Scenario: Timeout with no partial results still sets execution_status to timeout
3535
Given a tool_output containing timeout_info with no partial results available
3636
When I call post_execution_updates with the execution_details, execution_signatures and tool_output
37-
Then execution_status equals "timeout"
37+
Then execution_status equals "TIMEOUT"
3838
And the execution signature model contains every previous parameter unchanged
3939
And the execution details model contain every previous parameter pair unchanged

test/signatures/features/signature_manager_post_execution.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ Feature: SignatureManager post-execution execution elements update
2424
And the execution details model contain every previous parameter pair unchanged
2525
And the end_time parameter in the execution details model is a datetime object
2626
And this end_time is chronologically greater than or equal to start_time "2024-06-26T06:00:00Z"
27-
And the execution_status parameter in the execution details model is equal to "success"
28-
And the execution_action parameter in the execution details model is equal to "complete"
27+
And the execution_status parameter in the execution details model is equal to "EXECUTED"
28+
And the execution_action parameter in the execution details model is equal to "command_execution"

test/signatures/test_signature_manager_post_execution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def execution_details():
8585
target_fixture="tool_output",
8686
)
8787
def successful_tool_output():
88-
return {"status": "success"}
88+
return {"status": "EXECUTED"}
8989

9090

9191
@given(

test/signatures/test_signature_manager_transmission.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def compiled_post_execution_payload(context, inject_id):
185185
@given(parsers.parse("an updated post-execution execution details object"))
186186
def updated_post_execution_execution_details(context):
187187
execution_details = ExecutionDetails(
188-
execution_status="success",
188+
execution_status="SUCCESS",
189189
execution_action="complete",
190190
)
191191
execution_details.end_time = execution_details.start_time + timedelta(0.1)

0 commit comments

Comments
 (0)