49 lines
1.8 KiB
Gherkin
49 lines
1.8 KiB
Gherkin
Feature: Stderr Suppression in Tool Execution
|
|
As a developer
|
|
I want debug output from tools to be suppressed when not in DEBUG mode
|
|
So that users don't see internal debugging messages
|
|
|
|
Background:
|
|
Given the stderr suppression test environment is initialized
|
|
|
|
Scenario Outline: Stderr suppression based on logging level
|
|
Given I have a tool that writes to stderr
|
|
And the logging level is set to <log_level>
|
|
When I execute the tool
|
|
Then stderr output should be <suppression_state>
|
|
And the tool should execute successfully
|
|
|
|
Examples:
|
|
| log_level | suppression_state |
|
|
| CRITICAL | suppressed |
|
|
| ERROR | suppressed |
|
|
| WARNING | suppressed |
|
|
| INFO | suppressed |
|
|
| DEBUG | not_suppressed |
|
|
|
|
Scenario: Stderr is properly restored after tool execution
|
|
Given I have a tool that writes to stderr
|
|
And the logging level is set to INFO
|
|
When I execute the tool
|
|
Then stderr should be restored to original value
|
|
And subsequent stderr writes should work normally
|
|
|
|
Scenario: Stderr is restored even when tool raises exception
|
|
Given I have a tool that writes to stderr and raises an exception
|
|
And the logging level is set to INFO
|
|
When I execute the tool and catch the exception
|
|
Then stderr should be restored to original value
|
|
|
|
Scenario: Tool without stderr output works normally
|
|
Given I have a tool without stderr output
|
|
And the logging level is set to INFO
|
|
When I execute the tool
|
|
Then the tool should execute successfully
|
|
|
|
Scenario: Multiple stderr writes are all suppressed
|
|
Given I have a tool with multiple stderr writes
|
|
And the logging level is set to INFO
|
|
When I execute the tool
|
|
Then all stderr output should be suppressed
|
|
And the tool should execute successfully
|