81 lines
3.4 KiB
Gherkin
81 lines
3.4 KiB
Gherkin
Feature: Inline Tool Executor Coverage Boost
|
|
As a developer
|
|
I want thorough coverage of inline tool executor edge cases
|
|
So that the executor is well-tested across all code paths
|
|
|
|
# ---- Constructor Validation ----
|
|
|
|
Scenario: Executor rejects non-positive max_runtime_seconds
|
|
Given I create an inline executor with invalid max runtime
|
|
Then creating the executor should raise a ValueError about runtime
|
|
|
|
Scenario: Executor rejects non-positive max_output_bytes
|
|
Given I create an inline executor with invalid max output
|
|
Then creating the executor should raise a ValueError about output
|
|
|
|
# ---- Property Accessors ----
|
|
|
|
Scenario: Executor exposes max_runtime_seconds property
|
|
Given an inline executor with max runtime 5.0 seconds
|
|
Then the executor max_runtime_seconds should be 5.0
|
|
|
|
Scenario: Executor exposes max_output_bytes property
|
|
Given an inline executor with max output 512 bytes
|
|
Then the executor max_output_bytes should be 512
|
|
|
|
# ---- Null Argument Guards ----
|
|
|
|
Scenario: Execute rejects None tool argument
|
|
Given a writable skill context with sandbox "/tmp/inline-sandbox"
|
|
And an inline executor with max runtime 5.0 seconds
|
|
When I execute with None tool
|
|
Then executing should raise a ValueError about tool
|
|
|
|
Scenario: Execute rejects None context argument
|
|
Given an inline tool with code that prints "test"
|
|
When I execute with None context
|
|
Then executing should raise a ValueError about context
|
|
|
|
Scenario: Execute rejects None input_data argument
|
|
Given an inline tool with code that prints "test"
|
|
And a writable skill context with sandbox "/tmp/inline-sandbox"
|
|
When I execute with None input_data
|
|
Then executing should raise a ValueError about input_data
|
|
|
|
Scenario: Validate_tool rejects None tool argument
|
|
Given an inline executor with max runtime 5.0 seconds
|
|
When I validate with None tool
|
|
Then validating should raise a ValueError about tool
|
|
|
|
# ---- Validation Failure Return Path ----
|
|
|
|
Scenario: Execute returns validation failure without running code
|
|
Given an inline tool with no code
|
|
And a writable skill context with sandbox "/tmp/inline-sandbox"
|
|
When I execute the inline tool
|
|
Then the inline result should not be successful
|
|
And the inline result error message should contain "Validation failed"
|
|
And the inline result duration should be zero
|
|
|
|
# ---- Sandbox Path Validation ----
|
|
|
|
Scenario: Execute rejects input paths outside sandbox
|
|
Given an inline tool with code that prints "file op"
|
|
And a writable skill context with sandbox "/tmp/inline-sandbox"
|
|
When I execute the inline tool with path input escaping sandbox
|
|
Then the inline result should not be successful
|
|
And the inline result error message should contain "escapes sandbox"
|
|
|
|
Scenario: Execute accepts input paths inside sandbox
|
|
Given an inline tool with code that prints "ok"
|
|
And a writable skill context with sandbox "/tmp/inline-sandbox"
|
|
When I execute the inline tool with path input inside sandbox
|
|
Then the inline result should be successful
|
|
|
|
Scenario: Execute handles invalid path values gracefully
|
|
Given an inline tool with code that prints "test"
|
|
And a writable skill context with sandbox "/tmp/inline-sandbox"
|
|
When I execute the inline tool with an invalid path value
|
|
Then the inline result should not be successful
|
|
And the inline result error message should contain "Invalid path"
|