You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce a CLI flag to capture stdout and stderr during execution. This will enhance the ability of plugins to write structured outputs, such as JSON or XML, to stdout without interference.
Problem
Currently, stdout and stderr are not captured, making it inconvenient for plugins to produce structured output formats like JSON or XML directly to stdout. This limitation hinders use cases where plugins, in addition to tests, generate output that needs to be processed or logged in a structured manner.
Proposal
Detailed Description
Introduce a CLI Flag:
Add a flag (e.g., --capture-output) to enable capturing stdout and stderr.
By default, the flag is off, preserving the current behavior where output is not captured.
Capture and Redirect Output:
Redirect stdout and stderr streams to an in-memory buffer or a designated file when the flag is enabled.
Provide an option to access the captured output at the end of execution.
Integration with Plugins:
Ensure compatibility with existing plugins that may rely on current output behavior.
Plugins should be able to detect if output capturing is enabled and adjust their behavior accordingly.
Examples/Use Cases
CLI Usage:
vedro run --capture-output
Captures stdout and stderr during the execution.
Plugin Scenario:
A reporting plugin writes test results in JSON to stdout. With capturing enabled, the JSON output can be saved or redirected for further processing.
Backward Compatibility Notes
The default behavior remains unchanged (output is not captured).
Users must explicitly enable the feature using the new CLI flag.
Alternatives Considered
Redirecting output to files by default: This approach was deemed intrusive and could disrupt existing workflows.
Plugin-level configuration: While providing flexibility, this would require additional effort from plugin developers and would not address the broader use case.
The text was updated successfully, but these errors were encountered:
Summary
Introduce a CLI flag to capture stdout and stderr during execution. This will enhance the ability of plugins to write structured outputs, such as JSON or XML, to stdout without interference.
Problem
Currently, stdout and stderr are not captured, making it inconvenient for plugins to produce structured output formats like JSON or XML directly to stdout. This limitation hinders use cases where plugins, in addition to tests, generate output that needs to be processed or logged in a structured manner.
Proposal
Detailed Description
Introduce a CLI Flag:
--capture-output
) to enable capturing stdout and stderr.Capture and Redirect Output:
Integration with Plugins:
Examples/Use Cases
CLI Usage:
Plugin Scenario:
Backward Compatibility Notes
Alternatives Considered
The text was updated successfully, but these errors were encountered: