maelstrom-software / maelstrom

Maelstrom is a fast Rust, Go, and Python test runner that runs every test in its own container. Tests are either run locally or distributed to a clustered job runner.
https://maelstrom-software.com/
Apache License 2.0
599 stars 11 forks source link

Support color output from tests and test fixtures #404

Open bobbobbio opened 2 months ago

bobbobbio commented 2 months ago

Use Cases Color output can be extremely useful especially when looking at things like Python tracebacks or nice assertion messages. If my terminal supports color I want to be able to see color that is spit out by my tests.

Acceptance Criteria If we are using the test runner connected to a TTY, we should somehow tell tests that they can output color codes. We have some configuration value to control this feature, maybe something like test-color with values of auto/never/always

Implementation Considerations We could make some pseudoterminal when running the tests, but maybe this is undesirable for some reason. We might not support all possible control codes the test might be spitting out (or maybe we will if we use the vt100 parser thing). Things like pytest itself have flags like --color which we could pass, but individual tests won't have such a mechanism. It requires some exploration perhaps of what is possible.

pytest also has the --code-hightlight flag which we should consider maybe supporting plumbing through when this issue is done.

Definition of Done